Repository navigation
feat: shorten a run from a request to the MP4 - #45
Merged
Merged
Conversation
…and sound effects in the background
…enes two at a time
This was referenced Nov 5, 2026
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.
Why
In #44's benchmark, a 2-minute explainer took 17 min 20 s, Claude's own writing took about 75% of it, and writing the HTML film alone took 8 min 37 s. The narration and sound effects were also generated one at a time.
With this PR the same benchmark film takes about 11 min 35 s.
What changed
RetryInfo,Retry-After) and does not use up an attempt.plan.mdwhile the film is still being written. An effect is keyed bypromptandduration, so moving itsatlater costs nothing.<work>/plan.md, the storyboard with every motion'sfilm.atseconds, and the sharedindex.html. Subagents, one per two scenes (at most 7), then writefilm/scenes/NN-name.htmlat the same time. The runner puts these files in at the<!-- scenes -->line.motion-render check <film> <file>checks one file's scenes alone.kit/parts.css, plusfilm.light,film.ticksandfilm.caption) for the shapes every explainer redraws: step rows, cards, time lanes, rulers and captions.motion-render times <work>prints a per-step table. Each command logs its span to<work>/steps.jsonl, and the time between commands is counted as Claude's.references/pipeline.mdsays which step waits for which, and how to add a step. This is the handoff to Plan the music with the animation and score the BGM to its timing #42.Kit fixes found by the scene writers
transform, whichfilm.spotdoes not count, so a chip sent to a tick landed half a tick off. Ticks are now centered with a negative margin. A test checks that a chip sent withfilm.spotlands on the tick..card,.card-bodytext (--muted) fell to 4.1:1 contrast. Three writers hit this separately. The body now darkens to--inkas the card lights. The test fails without the fix.plan.mdshould name places by id, not by coordinates: the step cards' centers in the first plan were off because one card is wider.html-film.mdnow says so.Fixes found by making the v1.1.0 promo with this branch
checknow prints the page's own errors asrunner …lines, asstillsalready did. A scene writer built an SVG path fromNaN. The path drew nothing but broke no layout rule, socheck, which is the only check the writers run, passed it.timesprinted 179.6 s as "2 min 60 s". It now rounds to the whole second first.The promo (121 s, 14 scenes, 7 writers) took 14 min 11 s from an empty work dir. The slowest writer took 8 min 16 s (29 tool calls), and the other six took 3 min 28 s to 5 min 25 s.
CI runner (#46)
ubuntu-latestmoved to Ubuntu 26.04, and playwright-core 1.56.1 has no Chromium for it, so CI failed at the Chromium install on every PR. The job is pinned toubuntu-24.04. The bundled Chromium is unchanged, so rendering and #29 are unaffected. Upgrading Playwright is left to #46.Verification
tsc, ESLint, Prettier, quality baseline (no new violations), quality-gate tests (21 pass)inParallel, rate-limit waits, the step log and thetimescommand, scene files and per-filecheck, kit parts)checkwithlayout: ok, and the stills of all 14 scenes show nothing broken across the writers' file boundariesffprobe: video and audio tracks, 116 sBenchmark
This is the #44 benchmark film: the motion-render pipeline, in Japanese, 14 scenes, an HTML film with narration, BGM and sound effects, on the same 14-core Mac. The new film is 116 s long (the old one was 119.8 s) and has 53 sound effects in 8 distinct sounds (the old one had 44). Neither run needed any BGM rework.
index.html(new)checkwith fixesbuild¹ The skill had already been read and the scenes outlined before the clock started (the clock starts when the work dir is made). If prep took as long as in 1.0.0, run 2's total would be about 13 min 30 s, which is still 3 min 50 s shorter.
² Run 2 reused run 1's script, audio,
plan.mdandindex.html, and re-ran the scene writing, review and build after the docs were tuned. Its total is run 1 up to the scene step (4 min 21 s) plus run 2 from that step on.Raw
motion-render timesoutputRun 1 (from an empty work dir):
total 15 min 46 s: Claude 13 min 3 s, waiting on commands 2 min 43 s
Run 2 (from the copied plan; scene writers start at about 0:40):
total 7 min 55 s: Claude 5 min 17 s, waiting on commands 2 min 38 s
What the two runs showed
html-film.mdnow records this rule and these numbers.html-film.mdsays so, so the speed-up is a known trade.buildis bound by the encoder, not by capture. Capture alone took 28.7 s and capture with x264mediumtook 54.7 s for 3,480 frames. Withveryfastit took 48.0 s, at 54.5 dB PSNR againstmedium, and the timings varied by more than 10 s between runs. That saves about 1% of a run, so this PR leaves the encoder as it is. Becausebuildis unchanged, build: two builds of the same html film differ slightly (PSNR about 60 dB) #29 (two builds of the same film differ) is not affected.Not verified
Closes #44