Repository navigation
perf(core): hold a clip at 0 inside a later scene until it is due - #5716
Conversation
Edit accuracy: accurate 271 (base branch 271), smooth 192 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (2)
|
terencecho
left a comment
There was a problem hiding this comment.
Reviewed HEAD 8699ac52329322b7030f9aa6195565c88974b1b0 against effective merge-base d05bc4215d5757da86956217f4a8a4b2ab11b1fd (API base eace3d28b6cb721ec1f9a96d7d2ea76bf215551a). No introduced reachable blocker found in the audited source scope.
The parse-time hold now uses the existing canonical media-start resolver while preserving numeric-own-start and authored-length eligibility. That population remains within runtime-managed media; the inspected discovery, preload-window and active-sync paths provide takeover. The resolver is fresh per mutation callback, and the existing preview discriminator remains in place. The added regression reaches the real entry/observer/resolver and distinguishes local-zero clips in opening and later scenes.
Scope: all changed BASE versions read before HEAD, both changed files fully read, plus bounded producer/resolver/preload/transport/capture integration and independent correctness and contracts/test-boundary audits. Shared resolver ownership does not imply identical parse-time/runtime inputs or retrospective reclassification when a reference appears later. This is a source-only review: tests were not run, and native parser fetching, buffering and performance claims were not independently verified. No whole-repository semantic-coverage claim.
— tai
What
In a preview, a video or audio clip that starts at 0 inside a scene that starts later now parses at
preload="none", like any other clip that is not due yet. Before, the parse-time deferral read only the clip's owndata-start, so these clips started downloading at open and kept their buffers. Renders are unchanged: the deferral only runs in a preview.Why
deferMediaUntilDuegives later clipspreload="none"before Chromium can start fetching them, because anoneset mid-fetch is ignored. It decided "later" from the clip's owndata-start, which is local to its scene. A clip at 0 in a scene at 5:00 looked like it was due now, so the parser started it, and the runtime's laterpreload="none"could not stop it. On a 9-minute film with 91 sub-compositions, 24 such clips were downloading at open, about 64 s of buffered media for scenes nowhere near the playhead.How
resolveMediaStartForElement), the same owner the runtime's preload window uses, instead of readingdata-start.data-startand an authored length, so it never holds a clip the runtime's preload window does not manage.Test plan
entry.test.ts: a clip at 0 in a scene at 0 keeps its default preload and a clip at 0 in a scene at 5 parses atnone. Passes 3 runs in a row with the rest of the file (34 of 34). Fails without the fix:expected [ '', '' ] to deeply equal [ '', 'none' ].hyperframes preview(headless Chrome). Clips starting more than 10 s in that had fetched anything 5 s after the preview was ready: 24 (64 s buffered) before, 0 (0 s) after, in two runs. The 3 clips near the playhead still load. 12 seeks across the film all land on their frame, and seek times and playback frame rates are within run-to-run noise of the build without this change.