Repository navigation
fix(publish): a range with an end replays the whole retained audio, as in Rust - #9511
Conversation
Quest-Claim: 37fab45634b589f7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…audio A join with no lag limit, as every join before moq-lite-07 is, states no playout target, so encoding its whole max first only held the live edge back by that encode, for history its player skips. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…urvives the replay fix Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Rust Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Maintainer decision (via /quest-run, 2026-11-23): a join with no lag limit replays retained audio according to its Max Age (rejected: (a) live audio only; (b) replay with live audio encoded first; (c) keep replaying the whole retained window). A Live range with no Min Age starts from the oldest group but drops anything older than its Max Age, so the replay budget is the retained audio within Max Age, and all of the retained window only when Max Age is also none. (Written by Claude Opus 5.5) |
…io within its max Maintainer decision on #9511: a Live range with no Min Age starts from the oldest group but drops anything older than its Max Age, so its replay budget is the retained audio within Max Age, and the whole retention only when Max Age is also none. Keeps JS treating a range with an end as history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ay remains under the Max Age rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Applied the decision at 98a8f99: a join with no lag limit replays the retained audio within its Max Age, and the whole retention when Max Age is also none, in both On ARM (run 45309593159), the lite-06 fallback viewer's audio join carries (Written by Claude Opus 5.5 with high) |
|
Maintainer decision (via /quest-run, 2026-11-23): the lite-06 replay is correct: a lite-06 join asks for its oldest group plus a 2.13 s Max Age, and gets exactly that. ✅ Land this PR (the Max Age rule and the JS end fix) and delete the firefox-replacement quest, since 20 of 20 ARM runs pass (rejected: a follow-up to encode live audio before the replay; a looser lite-06 bound; replaying nothing). Merge pick: /quest-merge. (Written by Claude Opus 5.5) |
The maintainer decided a lite-06 join gets exactly what it asks for (its oldest group plus a 2.13 s Max Age), and 20 of 20 ARM runs pass. The epic README records the measurement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Applied the decision in ede9e1e: it deletes (Written by Claude Opus 5.5 with high) |
|
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 8 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. Adding a range.end check to JS replayBudget brings it back in line with Rust's replay_budget, which only bounds (Start::Live { .. }, None). The no-lag-limit rule (bound by max, whole retention when max is also none) is now pinned by tests in both languages.
Reviewed changes
I reviewed all 8 files at ede9e1e: the JS and Rust replay-budget logic, their tests, the docs and the quest notes.
- JS
replayBudgetend check: a range with anendnow returnsundefined, so it replays the whole retention.Range.endis typedbigint | undefinedinjs/net/src/track.ts, so!== undefinedcovers every case. - Rust
replay_budgetdoc: the comment now describes what the code already did:min.into_iter().chain(max).min(), wheremin: Nonefalls back tomax. - Tests: these cases are covered in both languages: a no-lag join with a 130 ms max replays from frame 143, and a join bounded by neither lag nor max replays from frame 0 (all 150 frames in JS). JS also tests that a join with an end replays all 150 frames. Rust's
replays_fromnow takes the expected first frame. - Docs:
doc/lib/js/publish.mdanddoc/lib/rs/moq-audio.mdnow state the rule for joins with no lag limit. - Quest notes:
firefox-replacement.mdis deleted. The epic README andfirefox-arm-resume.mdrecord the ARM measurements and the decision.
claude-opus-5-5 | 𝕏

Finishes
quest/m0/interop-green/firefox-replacement.md: the Nightly'smoq-lite-06fallback on Firefox takes 717 to 1028 ms onubuntu-24.04-armagainst its 1039 ms bound. Nothing drops audio. Each lite-06 join makes the incumbent's audio encoder replay its 2.13 s Max Age of retained PCM before it encodes any live audio.Following the maintainer's decisions, this PR keeps that replay and pins it with tests in both languages, fixes JS replaying too little for a range with an end, and closes the quest: the replay is what a lite-06 join asks for, and the fallback passed 20 of 20 focused ARM runs.
Problem
A lite-06 SUBSCRIBE can't say how far behind live its player wants to start. The relay forwards it upstream as a live join with no lag limit. On ARM the relay's trace shows the fallback viewer's audio join as
Live { min: None, max: Some(2.13s) }(15 of 25 lite-06 audio joins; the rest carry 2.08 s). The player's Max Age reaches 2 s past its delay so its jitter estimator sees every arrival (js/watch/src/audio/decoder.ts#runSubscribeMaxDelay).By default a JS publisher keeps raw PCM while nobody listens (
onDemand: "retain"). It encodes the replay in time order before the first live frame. That is about 300 ms of Opus on ARM, and the player skips that history as it trails the clock (skipping missing groups: track=audio).Decisions
Approach
js/publish/src/audio/encoder.tsreplayBudgetandrs/moq-audio/src/encode/producer.rsreplay_budgetgive a join with no lag limit its Max Age, and the whole retention when Max Age is none too. Rust's code matchesmain; only its comment changed.doc/lib/js/publish.mdanddoc/lib/rs/moq-audio.mdstate the rule.quest/m0/interop-green/firefox-replacement.md. The epic README's Plan records the finding, andfirefox-arm-resume.mddrops its link and keeps the replay ruled out as the page stop's cause.Impact
main.Validation
ARM (
ubuntu-24.04-arm, the Nightly's class), through a temporarypull_requestworkflow like moq-dev/moq#9494's, deleted from the branch. Focusedjust test media --media-engines firefox --media-cases replacement, 5 runs per job:main+ timing logs)In the last run, two of the four jobs ran the relay at
moq_net=trace. Those trace jobs measured 719–1028 ms and the plain jobs 721–924 ms. The trace shows the Max Age above.Local (x86):
cargo test -p moq-audio --features capture replay: 4 pass.bun test src/audio/encoder.test.tsinjs/publish: 61 pass. With option (a)'sreplayBudgetrestored, the new Max Age case fails (demand replays only the retained audio a join with no lag limit's max still wants).just check origin/mainpasses.quest checkpasses, and so doesjust check origin/mainexcepttest rs. That step timed out 4 tests in each of two runs, different ones each time, all whilembx: waiting for machine-wide scheduler capacity before starting this test(host load 37), so they never started. The 1146 that ran passed. CI runs them.Caused by
replayBudgetand dropped itsrange.endcheck, so a range with an end replayed only its max (found by reviewer).Notes
firefox-arm-resumegets only an evidence paragraph here.rejoin reaches livefail once in 6 full Firefox runs, so the replay doesn't explain that page stop;firefox-arm-resume.mdrecords this.Follow-ups
None.
Models
Size: M
Implementer: Claude Code, claude-opus-5-5, high effort
Implementer: Claude Code, claude-opus-5-5, high effort (iterate)
Implementer: Claude Code, claude-opus-5-5, high effort (iterate, M)
🤖 Generated with Claude Code
(Written by Claude Opus 5.5 with high)
Review
Rewritten by
quest reviewafter each round.Head: ede9e1e
Base: origin/main at d80be44
Risk: medium,
If it breaks, the audio a late subscriber receives changes: a join with no lag limit now gets only the retained audio within its max instead of the whole retention, and a range with an end now replays the whole retention, in the shipped `@moq/publish` encoder (`js/publish/src/audio/encoder.ts`) and `moq-audio` (`rs/moq-audio/src/encode/producer.rs`), so a viewer could get less or more history than before, and a revert of the code restores the old replay. This is a behavior fix that keeps the API and wire format, so it is medium rather than high; the rest is docs, tests, and quest plans (low).Classified: medium by Claude Code, claude-haiku-5-5, low effort, session
91d02ca7-91da-46d0-9cb4-e69dcaceed76Reviewer: Codex, gpt-6.1-sol, high effort
Session:
01a20b3a-dce0-79d2-9f22-b11540afd7fe, round 4Score: 10/10,
The incremental changes only update quest notes and remove the completed quest without leaving references to it; no new findings remain.Rounds: 5; first round 0; findings 1 (medium 1): fixed 1, refuted 0, open 0
Findings: none