Builds on the worker migration with prepare-burst pacing and a title-flip fix:
- New game from mid-game left the book on the previous game's spread, so the first block's
source and target spread matched and the title->content page turn was skipped. story:client-reset
now returns the book to the title spread (spread 0) so the first block flips 0->1 and animates.
Verified: requiresSpreadTransition src=0 tgt=1, page-flip-started/near-end fire.
- The lookahead burst-prepared many blocks at once, spiking allocation/GC into multi-second
main-thread stalls. WebGL book prepares are now serialized through a chain and capped to a
small lookahead window (TTS audio prefetch still spans the full window); future lookahead is
also deferred until the current sentence has entered the display pipeline, keeping it off the
first flip/reveal critical path. Worst game-start stall ~6s -> ~3.4s.
- Page flips now drive the scene through the sceneControl prewarm/startPreparedPageFlip API
(awaited) instead of an event, and the scene awaits the async initial spread draw.
Suite 177. Remaining: a per-block prepare stall (~1.6-3.4s for large blocks at game start)
that profiling has not yet attributed to a single function (likely GC from prepare-path
allocation) — needs a DevTools performance capture for exact attribution.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Establish book-playback-timeline as the sole playback owner driving the
scene through formal webgl-book:* events (not the BookLabDebug surface),
with a single reveal clock in the scene render loop and webgl-page-cache as
the only texture cache. Remove the legacy dual playback path and the
ownsPageFlipCommit gating.
Fixes:
- Flip page detached/folded at the spine: restore the raw page-cap line for
flip geometry (matches the prototype/pre-regression), removing
normalizeFlipLineToVisiblePage which moved the pivot off the spine arc.
- Flip textures: distance-based UVs (no horizontal compression),
direction-aware face material (source on the camera-facing side), source
meta derived from the visible spread (manual flips), prewarm shape fix.
- Reveal: flash removed on the static page and the flip back surface;
spanning blocks rebuild the reveal plan at activate and continue the
reveal on the next spread after the fill flip.
- Cache staleness is contentVersion-primary; nav clamps to spreadCount.
Docs updated to describe the intended single-owner architecture. Regression
checks updated to match.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>