Skip to content

test: structural checks for the WebGPU compositor WGSL, close out the README GIF - #137

Merged
BernardJen merged 1 commit into
mainfrom
chore/gpu-wgsl-tests-and-readme
Aug 7, 2026
Merged

BernardJen merged 1 commit into
mainfrom
chore/gpu-wgsl-tests-and-readme

Conversation

@BernardJen

Copy link
Copy Markdown
Contributor

Covers #62 (as far as is possible without hardware) and closes #49.

#62 — the shader still cannot be executed here

Re-checked rather than assumed. navigator.gpu exists, but requestAdapter() returns null by every route — default, low-power, forceFallbackAdapter: true, and SwiftShader forced on the command line. So the compositor that shipped dormant has still never rendered a frame.

Leaving it wholly unverified isn't great, so the WGSL is now exported as COMPOSITOR_WGSL and checked structurally:

Check Why it matters
vs / fs entry points exist the pipeline names them; a mismatch is a runtime pipeline error, not a compile error
all three @bindings declared the JS builds entries for 0/1/2; a missing one fails bind-group creation
texture_external + textureSampleBaseClampToEdge the zero-copy import is the entire premise of #62
Layout struct fits 32 bytes the buffer is allocated at 32; a larger struct truncates silently
quad array holds 6 vertices pass.draw(6) would index out of bounds otherwise
Y flip present compiles perfectly and renders the video upside down
balanced braces, no stray backticks a backtick inside the template literal has broken this build twice

These are the failure modes most likely to be sitting in code nobody has run — each would surface as a pipeline or link error on the first machine that has a GPU.

Confirmed the tests actually bite, by mutation: renaming the vertex entry point and removing the Y flip each fail exactly one test.

This is explicitly not a substitute for running it, and the test file says so in its header. #62 stays open until it can be benchmarked on real hardware — enable gpuCompositing: true in settings.json at the wall.

#49 — closing

The issue asked for "a screenshot/GIF", and its stated rationale was "a single image will communicate the product better than the feature list". The dual-view screenshot added in #131 does that and is live on the README.

The GIF half needs the app running against real capture hardware. I can't produce that, and a fabricated one would misrepresent the product. This removes the commented-out placeholder rather than leaving dead markup in the README — adding a real clip later is a two-line change and doesn't need an open issue to track it.

Verification

150 tests (was 142), lint clean, build clean, npm run shadercheck 60 runs / 0 failures.

🤖 Generated with Claude Code

…placeholder

#62: the compositor still cannot be executed here. Re-checked rather than
assumed -- navigator.gpu exists but requestAdapter() returns null by every
route, including forceFallbackAdapter and SwiftShader forced on the command
line. So the shader that shipped dormant in #129 has still never run a frame.

Rather than leave it entirely unverified, the WGSL is now exported as
COMPOSITOR_WGSL and checked structurally: that the entry points the pipeline
names exist, that all three bindings the JS bind group provides are declared,
that the Layout struct fits the 32-byte buffer allocated for it, that the quad
array holds the six vertices pass.draw(6) requests, and that the Y flip is
present.

Those are the failure modes most likely to be sitting in code nobody has run.
Each would surface as a pipeline or link error on the first machine with a GPU,
and the Y flip in particular compiles perfectly while rendering the video
upside down.

Confirmed the tests bite, by mutation: renaming the vertex entry point and
removing the Y flip each fail exactly one test.

This is explicitly not a substitute for running it -- the test file says so.
#62 stays open until it can be benchmarked on real hardware.

#49: removes the commented-out GIF placeholder. The issue asked for a
screenshot or a GIF, and the dual-view screenshot added in #131 meets its
stated intent ("a single image will communicate the product better than the
feature list"). A GIF of D/S switching needs the app running against real
capture hardware, which cannot be produced here, and a fabricated one would
misrepresent the product. Adding a real clip later is a two-line change and
does not need an open issue to track it.

150 tests (was 142), lint clean, build clean, shadercheck 60/0.

Closes #49
Refs #62

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@BernardJen
BernardJen merged commit 736f1e8 into main Aug 7, 2026
1 check passed
@BernardJen
BernardJen deleted the chore/gpu-wgsl-tests-and-readme branch August 7, 2026 11:35
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.

docs: Add screenshot/GIF of the app to README

1 participant