fix(webgl): stop the weighted draw from sampling software renderers - #326
fix(webgl): stop the weighted draw from sampling software renderers#326shauneccles wants to merge 1 commit into
Conversation
The weighted sampler draws from every row with a positive OS weight. On linux that includes three llvmpipe spellings (9% of draws on the shipped dataset), and pages read the resulting renderer string back through WEBGL_debug_renderer_info -- a GPU-less software renderer is one of the strongest bot signals there is. daijro/camoufox#743 removed the same bias from the python generator (software rasterizers are excluded from sampling entirely); apify#276 documents the dataset contamination. This applies the same rule to the Node implementation: the software-renderer rows stay in the db and remain reachable through an explicit vendor/renderer pair, but the random draw can no longer hand them out. Software renderers excluded: llvmpipe, SwiftShader, Microsoft Basic Render Driver, Generic Renderer.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd2be56ba5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| test("unknown explicit pairs still report the full (unfiltered) pair list", async () => { | ||
| const pairs = await getPossiblePairs(); | ||
| expect(Array.isArray(pairs.lin)).toBe(true); | ||
| expect(pairs.lin!.length).toBeGreaterThanOrEqual(11); |
There was a problem hiding this comment.
Exercise the unknown-pair error path
This test never supplies an unknown explicit pair to sampleWebGL; it only calls the independent getPossiblePairs() API. Consequently, it would remain green if the error path’s SELECT DISTINCT query were filtered or its reported pair list were otherwise broken, so the behavior named by the test is not actually protected. Invoke sampleWebGL with a nonexistent pair and assert that the rejected error contains a known software-renderer pair.
Useful? React with 👍 / 👎.
Problem
sampleWebGLdraws from everywebgl_fingerprintsrow with a positive OS weight. On linux the shipped dataset holds 11 devices, three of which are llvmpipe spellings — 9.0% of draws, roughly one launch in eleven — and the drawn string is what pages read back throughWEBGL_debug_renderer_info. A GPU-less software renderer is one of the strongest bot signals a consistency check can test for, which makes ~9% of linux launches self-defeating.Prior art
Change
One WHERE clause on the weighted-sampling branch: rows whose renderer mentions
llvmpipe,SwiftShader,Basic Render(Microsoft Basic Render Driver) orGeneric Rendererare excluded from the draw. The rows stay in the dataset and remain selectable through the explicitwebgl_configvendor/renderer pair — that path is untouched, so anyone who wants a software-renderer fingerprint can still ask for it.Tests
New
test/webgl-software-renderers.test.ts(against the shipped dataset):getPossiblePairsstill reports the full unfiltered pair listFull suite: the only failures in this environment are the pre-existing Xvfb/browser-launch timeouts (WSL, no X11 fork server) — identical set with and without this change, verified stash-baseline vs patched.
biome check: same findings before and after (the flaggednoNonNullAssertionlines insample.tsare pre-existing onmaster, shifted only by the added comment).Release note suggestion
sampleWebGLno longer returns software-renderer fingerprints from the weighted draw; explicitwebgl_configpairs are unaffected.