mirror of
https://github.com/daijro/camoufox.git
synced 2026-10-05 08:00:21 +00:00
chore(data): drop the 23 presets whose GPU has no WebGL data
A preset records only its GPU's name. The WebGL parameters, extensions and shader precision behind it have to come from somewhere, and for these 23 nothing Camoufox has describes the GPU: fpgen has never seen Firefox report it on that OS. So each launch paired the name with another device's parameters, a mismatch any WebGL fingerprinter can see. They were: - Windows on ARM (Adreno 650); - Direct3D 10-level GPUs (vs_4_0/vs_4_1); - "Generic Renderer"; - 945GM and GTX 480 on macOS; - nouveau/Mesa buckets on Linux; - one Linux preset pairing NVIDIA's proprietary vendor string with the nouveau renderer name. scripts/clean-fingerprint-data.py now applies the rule, via a shared fingerprints.firefox_gpus(), and test_shipped_data asserts it. 374 presets remain, and every OS keeps its presets. ROADMAP.md lists capturing WebGL data for these GPUs, which would bring them back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7dd0ec21f5
commit
40edebb925
@@ -94,3 +94,21 @@ def test_every_gpu_row_can_be_drawn_on_some_os():
|
||||
)
|
||||
]
|
||||
assert undrawable == []
|
||||
|
||||
|
||||
@pytest.mark.parametrize("filename", PRESET_FILES)
|
||||
def test_every_preset_gpu_has_webgl_data(filename):
|
||||
"""A preset records only its GPU's name; the WebGL parameters behind it come
|
||||
from fpgen. A GPU fpgen has never seen Firefox report on that OS has none, so
|
||||
launching it would pair the name with another device's parameters."""
|
||||
from camoufox.fingerprints import firefox_gpus
|
||||
|
||||
presets = json.loads((DATA / filename).read_text())["presets"]
|
||||
for os_name, entries in presets.items():
|
||||
known = firefox_gpus(os_name)
|
||||
for index, preset in enumerate(entries):
|
||||
gpu = (preset["webgl"]["unmaskedVendor"], preset["webgl"]["unmaskedRenderer"])
|
||||
assert gpu in known, (
|
||||
f"{filename} {os_name}[{index}]: {gpu[1]!r} has no WebGL data"
|
||||
" -- run scripts/clean-fingerprint-data.py --write"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user