Skip to content

Ask for a GPU adapter before downloading 314 MB, not after - #8

Merged
abgnydn merged 1 commit into
mainfrom
fix/webgpu-adapter-check
Aug 3, 2026
Merged

Ask for a GPU adapter before downloading 314 MB, not after#8
abgnydn merged 1 commit into
mainfrom
fix/webgpu-adapter-check

Conversation

@abgnydn

@abgnydn abgnydn commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Found by screenshotting production and actually looking at it. A visitor without usable WebGPU saw a raw JavaScript error — Cannot read properties of undefined (reading 'requestAdapter') — with the flybody bundle 36% downloaded behind it.

The gap

The guard was !("gpu" in navigator) — an existence check. That catches Firefox and older Safari, where the property is absent. It does not catch the case where the property exists and the adapter does not: a blocklisted GPU, or a VM without passthrough. Chrome exposes navigator.gpu there and returns null from requestAdapter(), so that visitor sailed past the bail, downloaded the connectome and the body, and crashed on the first adapter call.

The fix

Ask for the adapter up front; treat null-or-throws the same as a missing property. Verified against both real-world shapes:

case heavy .bin requests message link
property deleted (Firefox) none friendly index.html
requestAdapter → null (blocklist) none friendly index.html

The message also stopped claiming the browser is at fault, since in the blocklist case it usually isn't.

Verification

tsc clean · e2e 34/34. One KC-sparsity failure during the run re-ran clean on an idle machine; the other two KC assertions passed in that same loaded run, which is what a genuine dynamics shift would not do.

Context: vnc.bin was also rebuilt and re-uploaded (not in this diff — the binaries are gitignored)

The shipped blob had not been built by the committed build_vnc.py. Rebuilt from MANC source and pushed to R2, with the manifest bumped 0397588831cc → 32f66b946a16:

before after
leg motor neurons signed inhibitory 323 / 369 (87.5%) 6 (1.6%)
signed excitatory 11 184
sign≠0 with nt_conf < 0.5 (impossible per the script) 1165 0
NaN in nt_conf (impossible per the script) 147 0

Neuron and edge counts are identical (23,188 / 5,243,574). Validated locally at 34/34 before upload; R2, Pages and the HF Space all serve the new manifest.

🤖 Generated with Claude Code

Found by screenshotting production and actually looking at it. A visitor
without usable WebGPU saw a raw JavaScript error — "Cannot read properties of
undefined (reading 'requestAdapter')" — with the flybody bundle 36% downloaded
behind it.

The guard was `!("gpu" in navigator)`, an existence check. That catches Firefox
and older Safari, where the property is absent. It does not catch the case
where the property exists and the adapter does not: a blocklisted GPU, or a VM
without passthrough. Chrome exposes navigator.gpu there and hands back null
from requestAdapter, so that visitor sailed past the bail, downloaded the
connectome and the body, and crashed on the first adapter call.

Now it asks for the adapter up front and treats a null or throwing result the
same as a missing property. Verified against both shapes with the property
deleted (Firefox) and with requestAdapter stubbed to return null (blocklisted
GPU): zero .bin requests in each, the friendly message, and a working relative
link to the landing page.

The message also stopped claiming the browser is at fault, since in the
blocklist case it usually is not.

e2e 34/34 — one KC-sparsity failure during the run re-ran clean on an idle
machine, and the other two KC assertions passed in the same loaded run, which
is what a genuine dynamics shift would not do.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@abgnydn
abgnydn merged commit 912cf15 into main Aug 3, 2026
1 check passed
@abgnydn
abgnydn deleted the fix/webgpu-adapter-check branch August 3, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant