Repository navigation
fix(watch): a resumed rendition continues its arrival estimate - #9141
Conversation
Quest-Claim: f0e50c8c02d48f6e
A pause or a hidden tab releases the rendition, and the resume subscribed again from the cold-start prior. The first outage after it then took a tenth of the histogram, so one late keyframe group held the shared delay near a second and froze audio and video. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A resume onto the fixture's on-demand audio first reads the epoch its encoder ended while unwatched, which the player reports as a declared silence rather than a stall. measurePlayback opened its window there and graded the silence until the retained audio arrived. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
✅ No new issues found.
Approach: Sound. The player threw away its evidence on a pause, and this fixes that in the decoders. It reuses the rename path's existing Jitter.fork() continuity instead of changing the normative cold start.
Reviewed changes
I reviewed the full diff across the watch decoders, the jitter doc, and the interop harness.
- Audio decoder keeps the consumer on stop:
Phasestoppednow carries the lastConsumed.#retire()drops it only on failure, and#consumestill checks the path before forking. - Video decoder remembers the retired consumer:
#retiredis recorded when#runActivereleases a rendition.#runDecoderfalls back to it when nothing is active, and the path check is unchanged. - Harness
audioPlays(): it requires an anchored ring (audioTimestamp > 0). Ringreset()zeroesreadIndex, so a resume reads 0 until a frame anchors it. That makes the check a real "playing" signal. - Doc:
audio-jitter.mdstates the pause rule beside the rename rule.
I checked that the new decoder tests catch the regression. With main's decoder.ts, the video test fails at 1560 ms and the audio test at 810 ms. With the PR, both pass. The contract and tone tests pass too.
claude-opus-5-5 | 𝕏
|
Merge pick (maintainer away, granted the coordinator merges it confidently recommends): ✅ /quest-merge, accepting the choices listed in the PR body. (Written by Claude Opus 5.5 with high) |

Finishes quest/m0/interop-green/media-resume-delay.md.
Problem
The interop
mediastep has failedaudio tone: after resumein the scheduled Interop run (Chromium) and Nightly'sMedia (firefox player)job since 2026-11-12. Two causes, both reproduced locally under load:FRESH_MAX, a tenth of the histogram, so one late burst set the 95th percentile alone: the target went from about 160 ms to 840 to 1120 ms, and the snap rule froze audio and video for about 0.6 s. A codec rename already continued the estimate (fix(watch,publish): keep the delay across a rename and close frames read during teardown; cover renames in media QA #5635, fix(watch): keep the audio arrival estimate across a rename #5824); a pause did not. The doc already said a receiver back from a pause is not cold.measurePlayback's "playback starts" wait passed while the ring held nothing (audio timestamp 0) and graded that silence. This answers the plan's step 3.The burst itself is real lateness, not a join artifact (plan step 1). Per-frame logs at the publisher and player show the Chromium publisher's video and audio encoders stalling 300 to 530 ms about 1.3 s after the resubscribe, and transport adding another 250 to 500 ms, under the CPU spike the resume causes on a shared host. Those frames were captured well after the subscription began, so the join rule rightly measures them.
Approach
js/watchvideo and audio decoders keep the consumer of the rendition they release. A rendition resumed on the same path forks its estimate, as a rename does. The stop says nothing about the path, like a declared silence, so the paused time folds no idle intervals. With the pre-pause evidence, one outage takes1 - FORGET(0.017), below the 5% tail.doc/concept/audio-jitter.mdstates the rule beside the rename one, and the "coming back from a pause" sentence now says it means arrivals that stop within a subscription.audioPlays(sample)helper: the graph runs, the ring isn't refilling, and a frame has anchored it (timestamp, which reads 0 until then).measurePlayback,reachesLive,ToneCheck, and the driver's wrong-tone diagnostic use it instead ofrunning && !stalled.Plan step 2 (what a large rise does) was already decided by the audio playout epic on 2026-11-13: every clock move past 200 ms snaps. Nothing changes there.
Impact
<moq-watch>resumed after a pause, a hidden tab, or a disable continues its arrival estimate for the same path instead of starting at the cold-start prior. A resume onto a path with real lateness starts at that path's target instead of 100 ms and climbing.moq playhas no viewer pause, so the Rust estimator and the conformance corpus are unchanged.Validation
mainwithjust media --media-cases rename,pause --media-engines firefoxpinned withtaskset -c 0-3on a host at load 25 to 35: 3 of 6 instrumented runs failedafter resume, all with the video estimate restarting at 100 and climbing to 1000 to 1120 ms. One unloadedmainrun failed in the second mode (audio timestamp 0 for 0.7 s).Jitter: the resumed track cold reaches 1120 and 1000 ms (matching the freezes); forked from the pre-pause track it reaches 160 and 320 ms (the 180 ms rise is under the snap threshold).reachesLivecase for a declared silence with nothing anchored.bun test watch/srcpasses;just checkpasses.rename,pause. The Chromium failure was neither mode:audio/video sync: after resume: 69/80with the delay steady at 160 to 220 ms and audio playing, while video fell 300 to 450 ms behind as the host's idle reached 0% (other sessions'rustcandmoq_nettest binaries in the window's top list).Decisions
Taken while the maintainer is away; each is reversible in review.
audioTimestamp > 0as "anchored". The probe has no other view of the ring's anchor; the field is documented to read 0 until a frame anchors the ring.Caused by
No single PR: a resume has started its estimate cold since the estimator landed. moq-dev/moq#5635 and moq-dev/moq#5824 added continuity for renames only. moq-dev/moq#8507 made the resulting rise freeze playback (found by check).
Follow-ups
None.
Models
Size: L
Implementer: Claude Code, claude-opus-5-5, high effort
Review
Rewritten by
quest reviewafter each round.Head: 9582607
Base: origin/main at d778edc
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, xhigh effort
Session:
01a1f1a2-0194-7042-b349-7a527ab105d1, round 1Score: 9/10,
The change preserves estimator continuity across resumes without an identified behavioral regression; builds and tests were not run, as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none
🤖 Generated with Claude Code
(Written by Claude Opus 5.5 with high)