Repository navigation
Demo project: fix broken render + long-form session demo - #1 8000 48
Merged
johannboehme merged 2 commits intoJul 11, 2026
Merged
Conversation
…crashed the WebGPU backend Any export whose frame loop composites an ImageBitmap (test-pattern gap fill, image cams) killed the render worker with 'HTMLImageElement is not defined': the WebGPU backend's uploadSource measured image sources via a bare instanceof against a DOM global that doesn't exist in workers. The demo project always hits this — its cams' sync offsets leave a few output frames uncovered, and the very first test-pattern frame crashed the render. Only the WebGPU tier was affected, which is why headless Chromium (no worker WebGPU on macOS) never caught it. - extract imageSourceDims() with a typeof guard (same pattern compositor.ts already uses for HTMLCanvasElement) - regression tests: unit (worker-like scope without the DOM global) + a real-Worker browser test across all three backend tiers - demo-render.browser.test.ts: the demo job now renders end-to-end through the real pipeline - Compositor.backendId exposes the picked tier for diagnostics Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ne tempo The demo strip now offers both workflows, matching the two mode cards above it: 'Demo · Direct' (the 17 s song → editor) and 'Demo · Session' (→ triage → arrange → editor). The session is ~48 s at 112 BPM: a drum check, a bass groove, a full take and a short sparse noodle, separated by one-bar silences. Sections and gaps are whole bars on a single grid, so chunk detection finds four clean chunks that all vote for the same global tempo — and the sparse outro is a natural reject candidate. During the gaps the synthesized cams go tacet: the beat disc rests as an outline, the bounce block parks, the bar counter reads '--:-' — the band stopped playing, the camera kept rolling. Verified end-to-end in real Chrome: session demo → sync (4 chunks, BPM 112) → triage → arrange → editor → render done, 36 s output. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two things around the one-click demo project:
1. Fix: the demo (and any export hitting the image path) crashed the render worker on WebGPU machines.
The WebGPU backend's
uploadSourcemeasured image layer sources with a bareinstanceof HTMLImageElement. That DOM global doesn't exist in a Worker, so the first ImageBitmap upload threwHTMLImageElement is not definedand the whole render failed. The demo project always triggers this: its cams' sync offsets leave a few output frames uncovered, and the test-pattern gap fill goes through exactly this path. Machines that fall back to WebGL2 never saw it — which is also why headless Chromium (no worker WebGPU on macOS) kept the browser tests green.imageSourceDims()with atypeofguard (the patterncompositor.tsalready uses forHTMLCanvasElement)demo-render.browser.test.tsrenders the demo job end-to-end through the real pipelineCompositor.backendIdexposes the picked tier for diagnostics2. Feature: the demo now covers the long-form workflow too.
The demo strip offers both flavours, mirroring the two mode cards above it:
--:-counter).Verification
channel: chrome, headed):npm test: 1682 unit tests greennpm run test:browser: green (one pre-existing perf benchmark flaked under parallel GPU load; passes isolated)tsc --noEmitclean🤖 Generated with Claude Code