Repository navigation
feat(core): the playback health reading says which clock the film followed - #6906
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 blocker · 1 important · 0 nits · head 442af530
The code itself is sound: followedClock() matches getSource(), the one notePlaybackFrame caller passes the clock, and the studio parser accepts only the three names. What blocks is CI, and the body doesn't explain either failure.
- blocker: the required check
Studio and player capturesfails. The PR touchespackages/studio, so the body needs## Before/## Aftersections with captures. If the change is small enough for the gate's exemption, a## No visible changesection works instead. - important: the
Commentsratchet fails. It reports a higher comment share inclock.ts(+2 lines),playbackHealth.ts(+1) andtypes.ts(+1). Cut the new doc comments, or move the meaning into names and types (e.g. thewebAudioflag and theclockunion already say it).
Scope
Read all 8 files at head, plus TransportClock.getSource/attachAudioSource and the attach sites in init.ts (5630–5646). CI was still running other workflows at review time; the two failures above are complete.
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 119 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 31, 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.
What
The playback health reading the runtime posts (
preview-health) now says which clock the film's time came from at its newest tick:clockSourceis"audio"(an audio element'scurrentTime),"webaudio"(the WebAudio context's time) or"monotonic"(performance.now()). Studio'sparsePlaybackHealthkeeps it, and only one of those three values.Why
A choppy preview often shows a high skipped share while the page itself is idle: the film's scripts and rendering take almost none of the frame, and the tick gaps sit near 17 ms. When the clock follows an audio element,
currentTimemoves in the audio device's buffer strides (about 15 to 25 ms on Linux, 90 ms and more at times on macOS in probes). A 60 fps film then draws only when a stride crosses a frame, which the meter counts as skipped. A host reading the health report cannot tell that case apart today, because the reading does not say which clock was in charge.Related work
None open for this. Hosts that already read
preview-healthget the field with no change; a host that ignores it is unaffected.How
TransportClock.followedClock()names the clock from what is attached: no audio source (or a paused one) ismonotonic; an element isaudio; the WebAudio time iswebaudio.getSource()cannot tell the last two apart, because the runtime also attaches a heldcurrentTimeSecondswhile an audio element buffers, so the WebAudio attach ininit.tsnow marks itself (webAudio: true). A held position staysaudio, the clock it is standing in for.getSource()and the snapshot are unchanged.notePlaybackFrametakes the clock as a required input (its one caller is the runtime tick ininit.ts), and the reading posts the clock of its newest tick.RuntimePreviewHealthMessageand studio'sPlaybackHealthcarry the field; the parser drops anything that is not one of the three names, so a page cannot put free text into it.Test plan
On a Linux build box at this head, after building parsers, lint, studio-server and core:
oxlintandoxfmtclean on the changed files;tsc --noEmitgreen inpackages/coreandpackages/studio;clock.test.ts+playbackHealth.test.ts63/63,previewQualitySlice.test.ts5/5.Each new test is red on
main's source (the same run with the five source files checked out frommainand the tests kept: 2 of 63 and 1 of 5 fail, exactly these):clock.test.ts, "names the clock it follows: an audio element, WebAudio, or neither": no element, element, WebAudio, a held buffering time, and detach.playbackHealth.test.ts, "says which clock the film's time came from": the reading follows the tick's clock from monotonic to audio to WebAudio.previewQualitySlice.test.ts, "keeps the clock the runtime names, and only a clock it knows": a path in the field is dropped.Not exercised: a real preview in a browser. The field rides an existing message, so nothing new is drawn.
No visible change
The studio side is one optional field on the stored health reading and its parser (4 lines, no
.tsx/.css/.html); nothing is drawn from it, so there is no capture to take.Size
75 lines, alone on purpose: it changes one message's shape in the runtime and the one parser that reads it, so the release that carries it can be pinned by any host on its own. There is no open runtime PR of mine to fold it into.