Repository navigation
Conversation
The decoder discards its first three outputs, but those inputs still counted toward the ring's refill, so at a floor of two or three frames nothing reached the ring and the gate waited on it forever. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
marked this pull request as ready for review
November 21, 2026 01:06
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. The fix leaves the warm-up inputs out of the ring's refill gate instead of teaching the gate about discarded outputs. That keeps the change in the decode loop, and it matches how Backpressure anchors #first on the first timestamp it waits on.
Reviewed changes — the full diff of the single commit, checked against Backpressure in js/watch/src/audio/buffer.ts and the legacy decode loop.
Warmup.ungated(): a second counter that counts decoder inputs the same waydrop()counts outputs. Both make the same 1-input-to-1-output assumption.#playgating: the legacy path passeswarmupin, so the firstLEGACY_WARMUP_CALLBACKSadmitted frames skipring.wait. The CMAF path has no warm-up and is unchanged.- Regression test: drives a real shared-transport
createAudioBufferwith a 40 ms floor and 20 ms frames, then asserts the ring un-stalls once the gated outputs land.
claude-opus-5-5 | 𝕏
This branch has not been deployed
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.

Problem
Buffered playback of a legacy (non-CMAF) audio track never starts when the delay is two or three frames, e.g. 20 or 40 ms of 20 ms Opus frames. While the ring is unanchored, the backpressure gate admits frames from the first one until one reaches the floor. The legacy decoder discards its first three outputs (
Warmup(3)). So every admitted frame's output is thrown away, the ring never anchors, and the gate waits on it forever: silent audio.releaseonly.maindroppedWarmupin moq-dev/moq#5569, too large to backport.Approach
An input whose output the warm-up discards fills no ring space, so it skips
ring.wait.Warmup.ungated()counts those inputs the waydrop()counts the outputs. The gate then starts its refill at the first frame that will actually reach the ring.Impact
@moq/watchpatch.Validation
warmup.test.tscase runs the decode loop against a 40 ms buffered ring with 20 ms frames. Without the fix (ungated()always false) the ring stays stalled; with it the ring fills and un-stalls.@moq/watchtests (272 pass),tsc --noEmit, and biome pass in the dev shell.just check origin/releasefails only on API-report drift (Stats→Stats_2) in@moq/net,@moq/watch, and@moq/publish, which this PR doesn't touch; the local toolchain generates a different alias.Caused by
Alternatives
Follow-ups
js/watch/src/audio/order.tshas no bound against a publisher that repeats timestamps; handled separately.Models
Size: XS
Implementer: Claude Code, claude-opus-5-5, unknown effort
(Written by Claude Opus 5.5)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.Head: 47f0458
Base: origin/release at 17afa89
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, medium effort
Session:
01a1fba3-5cb8-7161-81d7-7c04fd82d823, round 1Score: 9/10,
Source review found no actionable defects in excluding discarded warm-up inputs from ring backpressure while preserving normal gating afterward, but builds, tests, and browser validation were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none