Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions quest/m1/audio-jitter-target/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ the native decode path too, asserting the same target series the browser's
## Required

- [Opus isolated-ring target](/quest/m1/audio-jitter-target/opus-isolated-target.md) - the isolated ring holds the target at near-zero jitter
- [Audio rename](/quest/m1/audio-jitter-target/audio-rename.md) - a renamed audio track continues the outgoing arrival estimate, so playback neither skips nor stalls
- [Watch](/quest/m1/audio-jitter-target/watch.md) - the browser's measured target, proven on Chrome and Safari against the public relay
- [AAC bursty budgets](/quest/m1/audio-jitter-target/aac-bursty-budgets.md) - post-fix nightlies confirm AAC no longer re-stalls, and its budgets are tightened from them

Expand Down
47 changes: 47 additions & 0 deletions quest/m1/audio-jitter-target/audio-rename.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# [S] An audio rename keeps the arrival estimate

## Goal

When `@moq/publish` renames an audio track after a decoder identity change,
`@moq/watch` keeps playing audio without skipping or stalling: the replacement
audio consumer continues the outgoing track's arrival estimate, as video does.
A track read from another broadcast path still starts from the cold-start
prior, as `doc/concept/audio-jitter.md` ("Across renditions") requires.

## Plan

#5635 added `ConsumerProps.predecessor` to `@moq/hang` and the video hand-off
this quest mirrors; this quest adds no API of its own.

Today the audio decoder's `#runLegacyDecoder` and `#runCmafDecoder` clear
`#measured` on teardown, before the replacement subscription opens, and the
new `Container.Consumer` starts from the prior. At a rename, the audio target
drops out of the shared delay, then returns at the cold 100 ms and climbs as
the new track relearns the path. The ring skips on the drop and parks on each
rise, the same failure #5635 fixed for video.

Decided 2026-10-16 (recommended options; the paper trail is in the plan PR):

- Hand the outgoing `Container.Consumer` to the replacement through
`ConsumerProps.predecessor`, only when both read the same broadcast path,
mirroring the video decoder. No new API.
Comment thread
kixelated marked this conversation as resolved.
Resolved
- Keep the outgoing estimate in `#measured` until the replacement's consumer
exists. Clear it only when no replacement follows (disabled, muted, or the
rendition removed), so a departed track still stops holding the buffer open.
- Prove it with a unit test in `js/watch/src/audio/decoder.test.ts` on a
mocked clock: warm a bursty audio track, rename it, and assert the ring
neither skips nor goes silent and the delay never drops. A second case moves
the media to another path and asserts it does not inherit. No new
real-browser media case: the unit test reproduces the mechanism
deterministically, and the fixture would need a second audio codec
configuration to rename audio at all.

Out of scope: `rs/moq-audio` builds a fresh `Target` per decode consumer, so a
native player that follows a rename restarts cold too. That needs its own
quest if native playback follows renames.

Public API: none. Wire: none.

## Related

- [Browser follows a renamed track](/quest/m1/browser-rename-check.md) - the browser check that found the video stall
1 change: 1 addition & 0 deletions quest/m1/test-flakes-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Public API: none. Wire: none.

## Required

- [Update after finish](/quest/m1/test-flakes-2/update-after-finish.md) - a subscribe update racing a publisher's finish ends the track cleanly in JS and Rust, not with the write's error
- [Auth refresh mocks time](/quest/m1/test-flakes-2/auth-refresh-mock-time.md) - moq-relay's auth refresh and fixed-lease tests measure a grant's life on one mocked clock
- [uring teardown close](/quest/m1/test-flakes-2/uring-teardown-close.md) - moq-uring's published-close teardown test holds under load, fixed at its cause
- [WASM IETF read](/quest/m1/test-flakes-2/wasm-ietf-read.md) - the WASM suite's IETF read case reads whole groups on a loaded runner, fixed at the burst or the assertion as the evidence says
Expand Down
39 changes: 39 additions & 0 deletions quest/m1/test-flakes-2/update-after-finish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# [S] A subscribe update racing a finished track ends it cleanly

## Goal

When a publisher finishes a track while the subscriber is writing
SUBSCRIBE_UPDATE on that track's subscribe stream, the subscriber's track ends
cleanly with the publisher's finish, in JS and Rust, instead of failing with the
write's stream error. A real reset of the subscribe stream still fails the
track with the reset's error.

## Plan

Seen in the real-browser rename media case on #5635. `@moq/publish` finished
the old `video` track after a rename. The relay closed the subscribe stream
while the player wrote a SUBSCRIBE_UPDATE on it. The write threw "The stream
was aborted by the remote server". In `js/net/src/lite/subscriber.ts`, the
rejected `#runSubscriptionUpdates` won the `terminal` race, so the track closed
with that error. Watch logged a spawn error, and the media check failed on the
console error. It reproduced in one of five local runs on a loaded machine.

Decided 2026-10-16 (recommended options; the paper trail is in the plan PR):

- A failed update write defers to the subscribe stream's own outcome. If the
responses end cleanly, the track ends cleanly; if they reject, that error
wins. No retry and no timeout.
- Fix JS and Rust together. `rs/moq-net`'s `lite/subscriber.rs` serve loop
(`ServeMode::Select`) hands the track back with the flush error. Confirm
whether the same race fails a finished track there, and give it the same
rule.
- Regression tests in both languages: a publisher that finishes the track and
stops reading while an update is in flight. The subscriber's track ends
cleanly, and a reset still surfaces its error. Run
`just test interop --all`, since this is session behavior.

Public API: none. Wire: none.

## Related

- [Browser follows a renamed track](/quest/m1/browser-rename-check.md) - the media check this race failed