Repository navigation
fix(core): preserve fresh host-driven timeline updates - #5159
Merged
Merged
Conversation
miguel-heygen
marked this pull request as ready for review
October 7, 2026 06:58
Edit accuracy: accurate 2059 (base branch 2059), smooth 1528 of thoseThe gate passes. Quarantined, measured but not gated (0) |
jrusso1020
approved these changes
Oct 7, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed at 34f726b4.
What I checked
- Receipt in one place: the "rendered this exact time on this timeline" receipt now lives in
seekTimelineAndAdapters(init.ts:4337-4339), not in hand-kept copies at the transport tick and the paused explicit seek. Every seek now records it. The paused transport tick and the hostonTickboth read it. - Where skipping can happen: the host tick (
init.ts:5048) skips only on an exacttand the samecapturedTimeline. The playing transport tick still seeks unconditionally, and explicit seeks never consult the receipt. So skips are limited to the duplicate case. - New behaviour after
applySeek: it now records the receipt, so the first paused transport tick after an explicit seek no longer repeats it. The old code already did that for the capture-wait seek (the removed lines at 3941), so this generalizes an existing rule rather than adding one. - Clock-source extraction:
refreshTransportClockSourceis a straight move of the three-tier audio-clock block, which I compared line by line. Calling it fromonTicktoo fixes the stale WebAudio snapshot when the iframe's own frames stop. - Reuse and simplicity: this removes duplicated logic rather than adding machinery. One receipt and one clock-source function serve both frame paths.
Tests, run locally
- At this head,
transportPark.test.tsandinit.test.tspass 262/262. - With main's
init.tsswapped in, the exact-time dedup witness and the WebAudio-snapshot witness both fail. The rest still pass.
The PR body is honest that this does not promise one seek per frame. With a free-running clock, the host and iframe ticks usually sample different times, so both still render. That matches the stated goal of never skipping a newer time.
Verdict: APPROVE
Reasoning: The skip is limited to an exact duplicate on the same timeline, the clock-source code is a verified move, and both new tests fail without the change.
— Rames
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 changed
The runtime and the parent player both drive playback. A tick-count token could discard a host tick after the iframe had rendered an older timeline time. Cross-process scheduling and iframe throttling made that token stale.
Host ticks now refresh the clock and skip their seek only when the same timeline instance has already rendered that exact requested time. The shared seek function owns the render receipt. End-of-playback handling still runs when a seek is redundant, and explicit seeks remain unconditional.
Both frame paths use one clock-source refresh function. This also refreshes the WebAudio time snapshot when the iframe's own animation frames stop, while preserving the native-audio buffering policy.
Validation
Exact-time equality is intentionally strict. A later clock sample must render even if an earlier seek occurred in the same display frame. This does not promise one seek per frame or retain the tick-token implementation's earlier performance claim.
Limits
The direct-timeline path does not start the parent tick clock. macOS, Windows and the desktop host have not been exercised.
Known gate red
The Studio timeline viewport gate has a known overscan regression addressed by #5151. That change is tracked separately.
No visible change
The player edit is a comment. The runtime preserves continuous host-driven timeline updates while avoiding seeks for an already rendered time.