Skip to content

test(moq-cli): the TS passthrough jump test holds under load without pacing - #5175

Merged
kixelated merged 5 commits into
mainfrom
quest/m1/test-flakes-2/ts-passthrough-jump
Oct 12, 2026
Merged

kixelated merged 5 commits into
mainfrom
quest/m1/test-flakes-2/ts-passthrough-jump

Conversation

@kixelated

@kixelated kixelated commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Quest: quest/m1/test-flakes-2/ts-passthrough-jump.md (deleted here, done).

Fixes moq-cli's ts_passthrough_crosses_a_relay_through_a_flagged_jump, which failed under load on main. The 15 ms wall-clock pacing is gone: the second copy now decodes all at once, and a run takes about 0.6 s instead of about 4 s.

Root cause

Two causes. The relay one landed on main first, in #4225; this PR now carries only the test-side fix.

  1. Relay (fixed by fix(net): keep a lite subscription's demand until its groups drain #4225). A lite publisher dropped its track::Subscriber once its subscription reached the track's end, while its group streams were still draining. On a relay that cancelled the upstream subscription and stranded an older group's tail. fix(net): keep a lite subscription's demand until its groups drain #4225 keeps the subscriber in Drain until the groups finish. Its regression finite_relay::relay_keeps_groups_in_flight_past_the_end runs on simulated time and fails without that fix (moq-lite-05: "the track never ended"). This PR first fixed the same bug by removing Drain; after merging main it keeps fix(net): keep a lite subscription's demand until its groups drain #4225's version and drops its own relay_end_in_flight test, which covered the same scenario.
  2. Test (fixed here). On moq-transport-14 the recording joins the publisher's current group when its SUBSCRIBE reaches the publisher through the relay, not when it is sent. Under load that landed after the second copy's first group, so the recording missed the end of the first copy and "both copies crossed" failed. The test now subscribes and takes the recording's first group before decoding the second copy.

Decisions

  • Pacing: fix the relay bug and drop the pacing. ✅ Chosen by the maintainer.
    • Land with the pacing and plan a follow-up quest.
    • Replace the pacing with event pacing.
  • Overlap with fix(net): keep a lite subscription's demand until its groups drain #4225 (sub-agent pick, flagged for review): ✅ keep fix(net): keep a lite subscription's demand until its groups drain #4225's Drain fix as merged and trim this PR to the test fix.
    • Replace it with this PR's simpler version (no Drain state, an ended flag on TrackRun). Smaller, but it rewrites code that was just reviewed and landed.
  • The quest's Required on the moq-time crate, added on main after this PR was opened (sub-agent pick): ✅ delete the quest anyway. With the pacing gone, the test has no wall-clock dependency left beyond its failure deadlines, so it no longer needs a controlled clock to hold under load.
  • Fail loud when a group is stranded anyway: left to SUBSCRIBE_DROP, whose Plan already owns it.

Test

  • just check: passes.
  • just test interop --all, run twice: every cell passes except the three tail rust -> * lanes, which fail the same way on main. Since feat(net)!: an undeclared Rust timescale means untimed #5083, create_track(name, None) is untimed, but test/interop/clients/rust/tail.rs still writes Timestamp::ZERO ("frame timestamp doesn't match track timescale"). That is a follow-up, outside this PR. On the first run, rust -> go, rust -> c, and one relay idle-out also failed; none repeated on the second run.
  • The CLI test under load (8 parallel loops pinned to 2 cores next to 8 busy loops): 64/64 pass with this PR. main's paced version fails 24/24 under the same load, every time on "moq-transport-14: both copies crossed".

Public API and wire

Public API: none. Wire: none. Test and quest changes only.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

@kixelated

Copy link
Copy Markdown
Collaborator Author

Outcome: the race is fixed at its cause and the PR stays a draft. The 15 ms wall-clock pacing is still there because removing it exposes a relay bug (see the description).

Open decision for the maintainer: what happens to the pacing.

  1. Land this as is and plan a moq-net quest to fix the relay dropping its upstream subscription while groups are still in flight. That quest drops the pacing as its regression test. (Recommended)
  2. Fix the relay bug in this PR. That widens a test-only PR into moq-net.
  3. Replace the pacing with event pacing (the recording reports each group, and decode waits on it). That works around the same bug and adds plumbing the relay fix would make unnecessary.

(Written by Claude Opus 5.5)

kixelated and others added 3 commits October 9, 2026 22:05
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…copy

On moq-transport-14 the recording joins the publisher's current group when its
SUBSCRIBE arrives through the relay. Under load that landed after the second
copy's first group (4), so the joining FETCH skipped group 2, the first copy's
tail, and "both copies crossed" failed. Take the first group before decoding
the second copy, so the read always starts behind it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ups finish

Once a lite subscription reached the track's end, the publisher dropped its
track subscription and only then drained the group streams still in flight.
On a relay that was the copy's last demand, so the relay cancelled its
upstream subscription as idle while those groups' tails were still coming,
and a reader behind the relay hung on the stranded group. The subscription now
stays until the drain finishes.

The TS passthrough relay test decodes its second copy all at once again,
which is what hit this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated force-pushed the quest/m1/test-flakes-2/ts-passthrough-jump branch from b11a8a3 to 867762c Compare October 10, 2026 05:07
@kixelated kixelated changed the title test(moq-cli): the TS passthrough recording starts before the second copy fix(net): a relay never strands a group still in flight when the track ends Oct 10, 2026
@kixelated

Copy link
Copy Markdown
Collaborator Author

Iterated per the maintainer's choice of option 2: the relay bug is fixed in this PR and the 15 ms pacing is gone.

Root cause: a lite publisher dropped its track subscription as soon as it reached the end, before draining its in-flight group streams. On a relay that cancelled the upstream subscription with an older group's tail still coming. The new relay_end_in_flight regression fails on moq-lite 05/06/07-wip without the fix and passes on every version with it.

Left to quest/m1/subscribe-drop.md: a group stranded some other way still hangs rather than erroring, because resume waits on a dead route. That quest's Plan already covers it.

PR remains a draft. CI's Check and Quest jobs are red only from main's dangling quest links, which #5177 fixes.

(Written by Claude Opus 5.5)

@kixelated

Copy link
Copy Markdown
Collaborator Author

Heads-up on overlap: #4225 fixes the same relay publisher drain cause, but keeps the track subscriber inside Drain until its group streams finish, where this PR removes the Drain state. #4225 is landing first, so this PR needs to rebase onto it and reconcile (or trim to its moq-cli test changes) when it resumes.

(Written by Claude Opus 5.5)

kixelated and others added 2 commits October 12, 2026 07:54
# Conflicts:
#	quest/m1/test-flakes-2/README.md
#	quest/m1/test-flakes-2/ts-passthrough-jump.md
#	rs/moq-net/src/lite/publisher.rs


main's relay_keeps_groups_in_flight_past_the_end already fails without the
publisher drain fix, on simulated time, across the same versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title fix(net): a relay never strands a group still in flight when the track ends test(moq-cli): the TS passthrough jump test holds under load without pacing Oct 12, 2026
@kixelated

Copy link
Copy Markdown
Collaborator Author

@codex review

(Written by Claude Opus 5.5)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T15:34:54.667563Z 90edb78 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 90edb78fd3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kixelated
kixelated marked this pull request as ready for review October 12, 2026 15:25
@kixelated
kixelated added this pull request to the merge queue Oct 12, 2026
@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 20bf85aa-1582-4935-89f2-d092f8b3f2d8

📥 Commits

Reviewing files that changed from the base of the PR and between 9050086 and 90edb78.


📒 Files selected for processing (3)
  • quest/m1/test-flakes-2/README.md
  • quest/m1/test-flakes-2/ts-passthrough-jump.md
  • rs/moq-cli/src/publish.rs

  • 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

Comment @coderabbitai help to get the list of available commands.

Merged via the queue into main with commit 7f8f259 Oct 12, 2026
6 of 7 checks passed
@kixelated
kixelated deleted the quest/m1/test-flakes-2/ts-passthrough-jump branch October 12, 2026 15:39
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