Skip to content

fix(mux): a live-start export joins at the live edge - #9621

Merged
kixelated merged 6 commits into
mainfrom
quest/m0/ts-congested-path
Nov 26, 2026
Merged

kixelated merged 6 commits into
mainfrom
quest/m0/ts-congested-path

Conversation

@kixelated

@kixelated kixelated commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Completes and deletes quest/m0/ts-congested-path.md.

Problem

The scheduled TS congested path step (just test ts --headroom --rate 7000000 --duration 120) has failed on every main run since 2026-11-22: each audio PID starts 3.008 to 3.024 s after its source, one frame past the 3.0 s join. The audio follows the video, which joins at its fourth group (4.48 s of 1.48 s) instead of its third.

Cause: a TS export subscribes each live track with Live { min: D, max: D } (export::subscribed), and its reader (ExportSource::live) then starts at the newest group. Since #9316 a live join's min is placed exactly, at the group holding the edge minus D. So at the join the relay sent up to two groups of 1 s video (about 2.2 MB) that the export skips. On a 7 Mb/s path that backlog delayed the newest group's keyframe until the next group superseded it. The relay trace showed groups 2.48 and 1.48 served at the subscribe, ahead of 3.48.

The quest's Plan read the f2eab6d3c2 run as an audio-shed failure. It failed on the same late start (its audio also shed 2 to 37 frames per PID, which --shed allows), and no run with the fix sheds audio.

Approach

A live-start ExportSource subscribes with a zero min, so it joins at the group holding the live edge, where it starts reading anyway. Every hop still drops a group by max (D) alone, which is what #9067 stated min: D for. A replay export, which reads from the oldest group the delay reaches, still joins D back.

Validation

  • Bisected locally with quest gate, 20 s runs of the same path: d1c532d3e4 and 3d1bb40f2a~1 join at 3.48 s (4 of 4), 3d1bb40f2a at 4.48 s (2 of 2), and main at 4.48 s (3 of 3 with moq-mux debug logs).
  • With the fix: the same configuration joins at 3.48 s 3 of 3, every audio PID starting at 3.486 s (AC-3 at 3.491 s). Before, passing runs started some audio PIDs at 3.58 to 3.75 s, losing what came between.
  • Full CI command, just test ts --headroom --rate 7000000 --duration 120: passes 3 of 3. Joins at 3.48 s, sheds no audio.
    The third run, on this head (holes.py --shed), keeps every audio frame from the join on, the old quest's Goal:
    PASS  PID 0x100 h264: 1419 frames of 40.00 ms, 1531 frames (61.2 s) shed, from 3.480s to 121.440s of 1.480s to 121.440s
    PASS  PID 0x101 mp2: 4916 frames of 24.00 ms, 0 frames (0.0 s) shed, from 3.486s to 121.446s of 1.470s to 121.446s
    PASS  PID 0x102 mp2: 4916 frames of 24.00 ms, 0 frames (0.0 s) shed, from 3.486s to 121.446s of 1.470s to 121.446s
    PASS  PID 0x103 mp2: 4916 frames of 24.00 ms, 0 frames (0.0 s) shed, from 3.486s to 121.446s of 1.470s to 121.446s
    PASS  PID 0x104 ac3: 3687 frames of 32.00 ms, 0 frames (0.0 s) shed, from 3.491s to 121.443s of 1.475s to 121.443s
    
    The failing f2eab6d3c2 run (45040473444) also shed 2 to 37 audio frames per PID beside the late start.
  • Second check, the relay trace (RUST_LOG=moq_net::lite=debug): the SUBSCRIBE carries Live { min: 0ns, max: 1s }, and the relay serves only the edge group (2.48), then 3.48. Before, it also served 1.48.
  • Other steps the change touches pass: plain just test ts, --mpts --program 2 --join 5, --passthrough --restart 10, and both CUBIC overflowing paths (--headroom and --passthrough, --queue 250ms --duration 120).
  • just test -p moq-mux --all-features (2225 passed), -p moq-srt -p moq-cli (276 passed), just check.
  • After merging main (its floor_range, fix(mux): a TS follow export carries on into a same-instance return while it drains #9662, conflicted with the live-start min): cargo test -p moq-mux --all-features (2227 passed), just check, and the full CI command again pass. Joins at 3.48 s, every audio PID from 3.486 s with 0 frames shed.
  • a_subscription_states_the_whole_delay now asserts min: 0 for a live export and min: D for a replay. latency_is_sent_with_the_initial_subscription asserts the same split for ExportSource. Both failed without the fix.

Impact

  • Public API: none.
  • Wire: none. A live TS (and passthrough release) export's SUBSCRIBE states Live { min: 0, max: D } instead of Live { min: D, max: D }.
  • Behavior: a live-start export no longer pulls a delay of history it discards, so it joins up to one group sooner on a narrow path.

Alternatives

  • Lower subscribed's min in the TS export alone. That would also move a replay's join, and it leaves every other live-start ExportSource caller asking for skipped history. The reader's start is the right place to decide.
  • Widen holes.py's 3.0 s join allowance. Rejected: it would hide the extra group of join latency.

Caused by

Decisions

  • Congested-path policy (maintainer, 2026-11-26 pick round): ✅ newest-first serving stays, a narrow path drops group tails to keep latency low (rejected: a started group keeps the path until it finishes and newer ones are skipped whole). So ✅ the follow-up quest/m4/congested-whole-groups.md is dropped (rejected: keep it). The TS congested path harness has no kept-video-share assertion to delete: holes.py --shed only requires that losses are whole group tails, the shape newest-first produces, and bounds the join.

Follow-ups

  • Outside this quest: EIT fixtures and TS long recovery (and on some runs TS overflowing path and TS private PES) also fail in the scheduled TS workflow. No quest owns them yet.

Models

Size: M
Implementer: Claude Code, claude-opus-5-5, unknown
Implementer: Claude Code, claude-opus-5-5, unknown (iterate, M)
Implementer: Claude Code, claude-opus-5-5, unknown (iterate, S)

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

Review

Rewritten by quest review after each round.

  • Head: f74f35e

  • Base: origin/main at b509328

  • Risk: medium, A live TS export now subscribes with min 0 so the relay joins at the edge, which could drop history a consumer of the moq-mux export path expects. The public Rust API signatures and wire format are unchanged, and a revert fully undoes it, so the blast radius is shipped behavior that the next cut would publish as a patch.

  • Classified: medium by Claude Code, claude-haiku-5-5, low effort, session 83c851e8-2247-475e-8533-92a348d277d5

  • Risk file: bb7b1c0de60b

  • Reviewer: Codex, gpt-6.2-sol, high effort

  • Session: 01a2190a-cb68-7491-bfe8-75dec390e9fd, round 3

  • Score: 10/10, The latest revision changes only quest tracking and introduces no landing blockers.

  • Rounds: 3; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

  • Notes, the author's to take or leave:

    • quest/m0/ts-congested-path.md: Keep the remaining video congestion issue tracked

kixelated and others added 2 commits November 25, 2026 10:46
A TS export subscribed each live track with `Live { min: delay }`, so the
relay sent up to two groups of history that the export's newest-group reader
then skipped. Since #9316 forwards that join upstream exactly, on a congested
path the backlog delayed the newest keyframe by a group, and the scheduled
`TS congested path` step started a group late, its audio one frame past the
3 s join. A live-start `ExportSource` now joins with a zero min; a replay
still reaches back the whole delay, and the max still bounds every group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title The scheduled TS congested path keeps its audio fix(mux): a live-start export joins at the live edge Nov 25, 2026
…its min

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 25, 2026 21:38
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Live subscriptions now send a zero minimum delay while retaining the configured maximum. Replay subscriptions retain the configured delay bounds. Comments and tests describe and verify these bounds. The m0 TS congested-path quest document is removed.

Merge Risk: Minimal · up to f74f3

Live exports now join at the edge without requesting history that is then discarded, while replay exports still join the configured delay back. No concrete merge-blocking risk was found, and the change is easy to revert.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(mux): a live-start export joins at the live edge" matches the main change in the changeset. The changeset makes live-start exports subscribe with a zero minimum delay so they join at th…
Description check Passed The description is closely related to the changeset. It explains the TS congested-path failure, the cause in the live subscription minimum delay, the code change to ExportSource and export::subscribed…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(mux): a live-start export joins at the live edge" matches the main change in the changeset. The changeset makes live-start exports subscribe with a zero minimum delay so they join at the live edge, and it updates the related test and doc comments in moq-mux. The title is short, specific, and follows a conventional prefix.

Full details: Description check

Explanation

The description is closely related to the changeset. It explains the TS congested-path failure, the cause in the live subscription minimum delay, the code change to ExportSource and export::subscribed, the test updates, the validation runs, and the deletion of the quest document. It is detailed and on-topic.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bc5071bb-1256-467e-8646-f122637be66c
Commits

Reviewing files that changed from the base of the PR and between 54f4d7c and f74f35e.

Files selected for processing: 1

  • rs/moq-mux/src/container/ts/export.rs
Files skipped from review as they are similar to previous changes: 1

  • rs/moq-mux/src/container/ts/export.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

kixelated and others added 2 commits November 26, 2026 09:53
…-path

# Conflicts:
#	rs/moq-mux/src/container/source.rs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Maintainer decision (relayed from the maintainer's /quest-run pick round, 2026-11-26):

  • Pick: ✅ /quest-merge (rejected: /quest-iterate, rethink).
  • Follow-up quest/m4/congested-whole-groups.md: ✅ drop it (rejected: keep it). Policy: ✅ (a) newest first, as now (rejected: (b) finish started groups and skip newer ones whole). The maintainer wants a narrow path to drop group tails to keep latency low. If the TS congested path step (or any test) grades on kept video share in a way that rewards holding older groups, which adds latency, delete that assertion.

(Written by Claude Opus 5.5)

The maintainer keeps newest-first serving: a narrow path drops group tails to keep latency low.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 88f8497 Nov 26, 2026
7 checks passed
@kixelated
kixelated deleted the quest/m0/ts-congested-path branch November 26, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant