Repository navigation
fix(net): a stale run below a reader's floor never panics its drop cursor - #9318
Conversation
Quest-Claim: 7f72bf197a144e9b
…rop cursor A drop cursor folding in what a wider coverage newly settles took every drop overlapping the settling run, so one wholly below the span came out read backwards from the floor, and the cache lookup over it panicked. Only drops reaching into both the span and the settling run are candidates now, clipped to the span. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. It fixes the cause where the reversed run is produced in DropCursor::grown, rather than clamping it at the state.lookup.range call that panicked.
Reviewed changes I reviewed the full diff: the grown fix, its unit test, the model regression, and the quest file changes. I also ran both new tests locally, and they pass.
DropCursor::grownbounds settling drops to the span: It intersects the settling run with the span, skips an empty result (needed, since an inverted range into the drop map would panic too), and clips each candidate's end tospan.end. For every valid run, the set is the same as before: a run whose clipped start lies insettlingmust overlapsettling ∩ span. So the only output that changes is the reversed or out‑of‑span runs that used to break the lookup.- Unit test
a_stale_run_below_the_floor_settles_nothing: A reader floored at 9 widens to every group while a received stale run sits at1..2. It covers the exact failure shape. regressions()case: Adds the quest's minimal model case.- Quests: Deletes the fixed quest and adds
resume-model-route-close.mdfor the seed 8 and 19 divergences, which are separate from this fix.
claude-opus-5-5 | 𝕏
|
Maintainer decision (2026-11-21):
(Written by Claude Opus 5.5) |
|
Answers the maintainer decision: landing as decided. (Written by Claude Opus 5.5) |

Summary
The Nightly resume model sweep panicked in
DropCursor::nextwithrange start is greater than range end in BTreeMap, on about one seed in four at 4096 cases.Root cause: in
DropCursor::grown(rs/moq-net/src/model/track.rs), when the reader's coverage widens (for example, its ranges drop from bounded to everything), the cursor adds each drop that a wider coverage newly settles. It askedstate.drops.overlapping(&settling), where the settling run can reach below the cursor's span (its floor). A drop entirely below the floor, such as a give-up at1..2with a floor of 9, producedspan.start..run.end=9..2. The cache lookupstate.lookup.range(9..2)then panicked.Fix: only drops reaching into both the span and the settling run are candidates, and each run is clipped to the span. That is exactly the set a full rescan judges, which already clipped every changed run to the span. The reversed run is no longer produced, rather than being clamped at the lookup.
Quest: deletes
quest/m0/nightly/resume-model-cursor-panic.md.Validation
a_stale_run_below_the_floor_settles_nothingintrack.rs: a reader floored at 9, whose open range starts at 12, widens to every group while a received stale run sits at1..2. It panics onmainand passes with the fix.regressions()inresume_model.rs. It panics onmainand passes with the fix.readers_match_the_logical_trackatMOQ_RESUME_CASES=4096, seeds 1 to 21: no drop cursor panic on any seed. Seeds 2, 3, 9, 11, 14 and 16 panicked before and pass now.main, with this PR'strack.rsreverted. Onmain, seed 8 panicked before reaching its divergence. Both are planned in the follow-up below.cargo test -p moq-net --features async --lib model::passes (1603 tests), and so doesjust check.Caused by
Follow-ups
closed_atcheck is likely too strict.Overlap
This changes only
DropCursor::grownand a test intrack.rs, plus one case appended toregressions()inresume_model.rs. It does not touchresume.rs. The live-join work (Start::Live(min_age)) andresume-ordered-lower-groupmay also append toregressions(), which would be a trivial textual conflict.Impact
Public API: none. Wire: none.
Models
Size: M
Implementer: Claude Code, claude-opus-5-5, medium effort (arm A)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.Head: a82a453
Base: origin/main at 4709906
Risk: medium,
The drop-cursor fix changes which stale drops Rust track readers receive and could misreport or omit drops for consumers, but preserves the public API and wire format and is fully undone by a revert.Classified: medium by Codex, gpt-6.1-sol, low effort, session
01a2006c-86e5-72b2-91ad-6426056d6f0cReviewer: Codex, gpt-6.1-sol, high effort
Session:
01a2006c-9de7-77e0-b0f7-5553bbcfba7b, round 1Score: 9/10,
Source review found no actionable defects and focused regression coverage, but builds and tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none