8000 Demo project: fix broken render + long-form session demo by johannboehme · Pull Request #148 · johannboehme/tk-1 · GitHub
[go: up one dir, main page]

Skip to content

Demo project: fix broken render + long-form session demo - #148

Merged
johannboehme merged 2 commits into
mainfrom
claude/demo-project-rendering-workflow-0eab27
Jul 11, 2026
Merged

johannboehme merged 2 commits into
mainfrom
claude/demo-project-rendering-workflow-0eab27

Conversation

@johannboehme
Copy link
Copy Markdown
Owner

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 uploadSource measured image layer sources with a bare instanceof HTMLImageElement. That DOM global doesn't exist in a Worker, so the first ImageBitmap upload threw HTMLImageElement is not defined and 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 a typeof guard (the pattern compositor.ts already uses for HTMLCanvasElement)
  • Regression tests: unit test in a worker-like scope without the DOM global, plus a real-Worker browser test across all three backend tiers
  • New demo-render.browser.test.ts renders the demo job end-to-end through the real pipeline
  • Compositor.backendId exposes the picked tier for diagnostics

2. Feature: the demo now covers the long-form workflow too.

The demo strip offers both flavours, mirroring the two mode cards above it:

  • Demo · Direct — the existing 17 s song → sync → editor → render
  • Demo · Session — a ~48 s session at one tempo (112 BPM): drum check → bass groove → full take → sparse noodle, separated by one-bar silences. Sections and gaps are whole bars on a single grid. Chunk detection finds four clean chunks that all vote for the same global tempo; the short sparse outro is a natural reject candidate in Triage. During the gaps the synthesized cams go tacet (outline disc, parked block, --:- counter).

Verification

  • Driven end-to-end in real Chrome (Playwright, channel: chrome, headed):
    • Direct: demo → sync → editor → render done, output playable on the job page
    • Session: demo → sync → Triage (4 chunks, BPM 112, silence gaps visible) → Arrange → Editor → render done, 36 s output
  • npm test: 1682 unit tests green
  • npm run test:browser: green (one pre-existing perf benchmark flaked under parallel GPU load; passes isolated)
  • tsc --noEmit clean

🤖 Generated with Claude Code

johannboehme and others added 2 commits July 11, 2026 15:24
…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>
@johannboehme
johannboehme merged commit 037e90d into main Jul 11, 2026
1 check passed
@johannboehme
johannboehme deleted the claude/demo-project-rendering-workflow-0eab27 branch July 11, 2026 13:43
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

0