Skip to content

fix(net): skip delivered resume copies without consuming groups - #6292

Merged
kixelated merged 4 commits into
mainfrom
quest/m1/release-perf/resume-duplicates
Oct 22, 2026
Merged

kixelated merged 4 commits into
mainfrom
quest/m1/release-perf/resume-duplicates

Conversation

@kixelated

@kixelated kixelated commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Resume selection repeatedly polled superseded copies whose entire eligible range was already delivered. Ordered replay also consumed duplicate groups through delivery accounting, expiry construction, and cache refresh.

Approach

  • Skip covered, bounded copies before peeking or watching their expiry. Keep their recovery leases and existing retention rules.
  • Advance ordered cursors past the delivered prefix without constructing or handing out duplicate consumers. Discard duplicate stale convictions without counting them.
  • Reuse a nested subscriber's existing past-prefix ledger, so a fresh nested reader also releases groups its containing reader already passed. No parallel floor state.
  • Preserve the reader × publisher-copy × group benchmark sweep. Add cases where an extra serving copy awaits its first group and older copies still overlap.
  • Retire the finished quest/m1/release-perf/resume-duplicates.md and point its release-perf table row at this PR.

The consumer of the private seek is resume copy selection. The changes leave Ledger, forget_past_budget, cache.rs, and track_gc untouched.

Impact

  • Public API: none. Helpers remain private to the model.
  • Wire format and subscription preferences: unchanged.

Measurements

Measured after merging current main (#6251, #6111). Callgrind instructions for one drain, main's model versus this branch, with the same bench harness:

Fixture (1 reader, 64 groups) main This PR Reduction
arrival, 32 copies 5,091,236 1,256,006 75.3%
sequence, 32 copies 4,880,306 1,242,181 74.5%
sequence, 2 copies + waiting 1,519,149 1,032,972 32.0%
sequence, 8 copies + waiting 6,257,504 2,869,917 54.1%
sequence, 32 copies + waiting 25,620,402 10,352,104 59.6%
arrival, 2 / 8 / 32 copies + waiting 1.46M / 6.06M / 24.90M 1.44M / 5.96M / 24.47M 1.3-1.7%

"Waiting" adds a serving copy that answered but has not produced a group, so the older copies stay unbounded. The covered-copy guard cannot help there; the ordered seek is what removes the replay. Arrival mode has no seek and is unchanged in that case, as expected.

Rust 1.98.1, Valgrind 3.27.1, bench profile with strip=none and debug=line-tables-only, criterion --test (one iteration), collection toggled on *ResumeOverlap*drain* so fixture construction and teardown are excluded.

Validation

  • After the merge, all 3,006 moq-net tests pass (11 skipped). Coverage includes nested pending routes, a fresh-nested-reader end/retention corner, existing recovery/error/eviction cases, maximum sequence, arrival-cursor independence, and exactly-once stale accounting.
  • All resume-overlap fixtures pass their "every group once" assertion before and after.
  • just check: Rust fmt, docs, clippy (native, wasm, io-uring), quest, and drill pass. The flake check fails building the unchanged Nix runner image (unshare: write failed /proc/self/uid_map: Operation not permitted), a host namespace restriction unrelated to this change.
  • quest check --base origin/main --branch quest/m1/release-perf/resume-duplicates passes.
  • Sparse gaps #6287 touches nearby code; this PR does not depend on it.

Alternatives

The covered-copy guard alone leaves substantial ordered replay work while a replacement awaits its first group, so retain the measured private seek. General peek caching adds invalidation requirements for arrivals, budgets, and range changes; current proofs of completed ranges remove the measured hot polling without caching live candidates. A separate single-copy shortcut was unnecessary for this goal.

Follow-ups

None.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

@kixelated kixelated changed the title Resume duplicates fix(net): skip delivered resume copies without consuming groups Oct 22, 2026
@kixelated

Copy link
Copy Markdown
Collaborator Author

Checkpointed the measured duplicate-copy fix in d38decb0b5. The corrected nested-reader path reuses the existing past-prefix ledger; all 2,917 active moq-net tests pass. The affected closure has only the known stats failure tracked by #6290, and the full gate still needs a host that permits the runner-image namespace operation.

Recommended remaining decision: approve retirement of the completed quest and its links. Automatic approval review rejected that removal as abandonment, so the accurate quest is retained and this PR stays draft. No API or wire decision remains, and no new follow-up quest is proposed.

(Written by GPT-6)

@kixelated
kixelated marked this pull request as ready for review October 22, 2026 21:40
@kixelated

Copy link
Copy Markdown
Collaborator Author

@codex review

(Written by Claude Opus 5.5)

@coderabbitai

coderabbitai Bot commented Oct 22, 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 38 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: 56d95623-c6d3-4134-ab16-fc98c56e488c
📥 Commits

Reviewing files that changed from the base of the PR and between b8bb673 and 9ad7f8f.

📒 Files selected for processing: 6
  • quest/m1/release-perf/README.md
  • quest/m1/release-perf/resume-duplicates.md
  • rs/moq-net/benches/origin.rs
  • rs/moq-net/src/model/delivered.rs
  • rs/moq-net/src/model/resume.rs
  • rs/moq-net/src/model/track.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 22, 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-22T21:44:31.937987Z 9ad7f8f Manual request
ℹ️ 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. 🎉

Reviewed commit: 9ad7f8f7de

ℹ️ 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 added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit bfbaa0b Oct 22, 2026
12 checks passed
@kixelated
kixelated deleted the quest/m1/release-perf/resume-duplicates branch October 22, 2026 23:03
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