Skip to content

fix(net): prove the lite session driver Send within the default recursion limit - #8657

Merged
kixelated merged 1 commit into
mainfrom
fix/lite-send-depth
Nov 14, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/lite-send-depth

Conversation

@kixelated

@kixelated kixelated commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Every Fuzz job in the Nightly workflow fails to build moq-net (run 43447849289):
overflow evaluating the requirement driver::Driver: Send at assert_send::<Driver>(). sh/rs/fuzz.sh builds with nightly and -D recursion_depth_exceeding_limit, so a Send proof deeper than the default limit of 128 fails the build there. Stable only warns about it now, but it will become a hard error.

The overflowing path runs through the lite subscriber's TrackEntry. Its parked and paused registries hold group and frame writers (recv::Group, frame::Producer), and those writers reach the whole track model. Lite-07 YIELDED added paused and a partial frame writer per opened group, which pushed the driver's proof past the limit.

Approach

TrackEntry now keeps parked and paused in SendCell, the cell from #5682 that proves Send + Sync once when it is built. The driver's proof stops at the cell and no longer walks through the group model. SendCell gains a Default with the same bounds, so get_or_insert_with(Default::default) keeps working.

Impact

  • None. Internal types only; no public API or wire change.

Validation

  • Reproduced on nightly-2026-11-13 (rustc 8eb778d04, the same nightly as the failing run) and on nightly-2026-11-12: cargo check -p moq-net --lib --features fuzz with -D recursion_depth_exceeding_limit fails on main and passes on this branch.
  • Bisected the overflow to 9ece16d (moq-dev/moq#8545). Its parent 2039205 passes.
  • Measured headroom by nesting the driver in Options until its proof overflows at the default limit. Before feat(net)!: lite-07 YIELDED pauses a group a later stream continues, and FRAME leads with its length #8545 the driver had 8 levels to spare. Main has none (it overflows). This branch has 12. Raising the limit to 256 gives the same depth (116), so the measurement holds at either limit.
  • just rs fuzz varint -- -max_total_time=30 on nightly builds and runs (17.3M execs, rc 0).
  • just check and just ci pass.
  • Local review: quest review --harness codex (gpt-6.1-sol, high) found nothing.

Alternatives

  • Raising recursion_limit: fix(net): prove native futures Send at the default recursion limit #5682 removed that on purpose and pins the default limit in rs send-depth and the fuzz build.
  • Broader cuts at the model hubs (cache::Track's back-reference to TrackState, kio::Shared<BroadcastState>): I measured these with the same nesting check. They made the driver's proof deeper (174 at limit 256, against 131 on main), because the old solver's depth on this cyclic model graph depends on the order it searches, not just on which edges exist. I dropped them.

Follow-ups

  • A 12-level margin is thin. Only Nightly runs this check (fuzz and rs send-depth), so the next deep session state can land and break it again. Running the driver's Send proof on the pinned nightly in the merge gate would catch it before landing. I did not add that here.

Caused by

  • moq-dev/moq#8545: added the paused registry and partial frame writers to TrackEntry, which deepened the session driver's Send proof past the default recursion limit

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: 73e5ae5

  • Base: origin/main at 4486b7a

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1d638-9fc5-71b1-b4a3-81e3935fecdc, round 1

  • Score: 9/10, The wrappers preserve channel behavior and Default enforces the existing Send + Sync construction invariant, with no actionable defects found in source review, though builds and tests were not run as instructed.

  • Rounds: 2; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

…sion limit

Parked and paused groups hold group and frame writers that reach the whole
track model, which pushed the session driver's Send proof past the default
recursion limit on nightly. SendCell proves them once at the TrackEntry.

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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes: the full diff (2 files, 1 commit).

  • TrackEntry registries in SendCell: parked and paused in lite/subscriber.rs are now Option<SendCell<kio::Producer<_>>>. The session driver's Send proof stops at the cell instead of walking the group and frame writers. Existing call sites (.write(), .read(), .consume(), .clone()) go through Deref and Clone, so they are unchanged.
  • SendCell: Default: util/cell.rs adds impl<T: Default + Send + Sync> Default, which keeps the get_or_insert_with(Default::default) call sites working. The bounds match new, so the safety invariant of the unsafe impl Send/Sync still holds. The SAFETY comment is updated to say "both constructors".

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

SendCell now implements Default when its contained type implements Default, Send, and Sync. TrackEntry now stores its parked and paused producers in SendCell. Their optional types and roles remain unchanged.

Merge Risk: Minimal · up to 73e5a

This internal refactor changes how two registry fields are stored so the compiler can prove Send more cheaply. It does not change the public API or wire behavior. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: it proves the lite session driver Send within the default recursion limit. The changeset stores TrackEntry parked and paused registries in SendCell and adds a Default …
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.
Description check Passed The description is directly related to the changeset. It explains the Send-proof overflow in the lite subscriber's TrackEntry, the fix that wraps parked and paused in SendCell, the new Default impl fo…
Full details: Title check

Explanation

The title names the main change: it proves the lite session driver Send within the default recursion limit. The changeset stores TrackEntry parked and paused registries in SendCell and adds a Default impl for SendCell, which matches the title's goal of keeping the Send proof under the limit. The title is specific and concise, and it follows the fix(net) convention.

Full details: Description check

Explanation

The description is directly related to the changeset. It explains the Send-proof overflow in the lite subscriber's TrackEntry, the fix that wraps parked and paused in SendCell, the new Default impl for SendCell, and the validation steps. 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: 2b601f92-5fca-4ca8-b050-712fc9672e77
Commits

Reviewing files that changed from the base of the PR and between 4486b7a and 73e5ae5.

Files selected for processing: 2

  • rs/moq-net/src/lite/subscriber.rs
  • rs/moq-net/src/util/cell.rs

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

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