Skip to content

fix(net): keep a backup for a group read from a single route - #6485

Merged
kixelated merged 2 commits into
mainfrom
quest/m1/resume-handed-out
Oct 23, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m1/resume-handed-out

Conversation

@kixelated

@kixelated kixelated commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Completes quest/m1/resume-handed-out.md.

Problem

Reader::hand_out (rs/moq-net/src/model/resume.rs) recorded a handed-out group on the reader's out list only while copies.len() > 1. A group first read while only one copy existed was never recorded, so a later copy holding it was let go. Reproduction: read the first frame of group 0 from A; swap to B, which holds all of group 0; B's route fails, keeping its finished group; swap to C, which lacks group 0, and read group 1; A's partial group 0 fails. B was already dropped, so the read stalled until the reader's max_delay ended it with Error::Old.

Fix

Record every handed-out group, dropping the guard, matching JS (#6136). The existing sweep in hand_out keeps the list at the live group count.

  • Regression test a_group_read_from_a_single_route_keeps_its_backup (explicit polling, no wall clock); fails on main, passes here.
  • New bench origin/passthrough in rs/moq-net/benches/origin.rs: one-frame groups through a single-route front, swept over readers (1, 100) and groups each holds open (1, 64), so the per-group record shows up as a slope.

Bench, fixed vs. guard restored (--baseline), per group read:

shape fixed guard
1r_1g 2.48 µs 2.52 µs
1r_64g 2.47 µs 2.47 µs
100r_1g 1.23 µs 1.21 µs
100r_64g 1.14 µs 1.13 µs

All within noise; no slope over open groups. (The guard run still allocated the Arc, so it slightly understates the old path's saving.)

JS

js/net/src/resume.ts already records every group (Recover constructor adds to reader.out unconditionally), and the existing test "a clean end keeps the serving copy while a group handed out before the swap may continue from it" fails if the guard is reintroduced. No JS change.

Impact

  • Public API: none (behavior only).
  • Wire: none.

Checks

  • just check: passed (2 pre-existing SLOW flags in unrelated moq-mux TS import tests).
  • just rs test -p moq-net: 3058 passed.
  • cargo bench -p moq-net --bench origin -- origin/passthrough: ran, numbers above.
  • Not run: just test interop --all (no wire or FFI change).

🤖 Generated with Claude Code

https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU

kixelated and others added 2 commits October 22, 2026 21:00
A resumed reader recorded a handed-out group only while copies overlapped,
so a group first read from one route was never backed: a later copy that
held it was dropped, and a failure of the original copy stalled the read
until the reader's budget ended it with Error::Old. Record every handed-out
group, as JS already does; the existing sweep keeps the list at the live
group count.

Adds origin/passthrough, reading one-frame groups through a single-route
front over readers and groups held open, so the per-group record shows up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU
@kixelated kixelated changed the title Rust resume keeps a backup for a group read from a single route fix(net): keep a backup for a group read from a single route Oct 23, 2026
@kixelated
kixelated marked this pull request as ready for review October 23, 2026 05:05
@kixelated

Copy link
Copy Markdown
Collaborator Author

Outcome: quest complete. Reproduced on main with a polling regression test, fixed at the source by recording every handed-out group in Reader::hand_out, and added origin/passthrough (per-group cost unchanged within noise). JS already had no gap, so no JS change. No open decisions; marked ready.

Suggested follow-up: two moq-mux TS import tests (a_shared_forward_boundary_resets_once_per_rendition, a_signalled_reset_reaches_the_exported_clock) flagged SLOW (>30s) under just check, unrelated to this change.

(Written by Claude Opus 5.5)

@coderabbitai

coderabbitai Bot commented Oct 23, 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 34 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
  • 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: eea4a8a5-336d-4162-9891-9b27b1875593
📥 Commits

Reviewing files that changed from the base of the PR and between 648df59 and afd723f.

📒 Files selected for processing: 4
  • quest/m1/README.md
  • quest/m1/resume-handed-out.md
  • rs/moq-net/benches/origin.rs
  • rs/moq-net/src/model/resume.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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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-23T05:07:21.864374Z afd723f 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.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merging. The maintainer chose /quest-merge. CI is green, the current head has a non-Grok review, and quest check passes against main.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 5e6c452 Oct 23, 2026
11 checks passed
@kixelated
kixelated deleted the quest/m1/resume-handed-out branch October 23, 2026 18:20
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