Repository navigation
fix(moq-net): a resumed read ends with the track and keeps its range's end across a backfill - #8859
Conversation
…s end across a backfill Bounding a replaced copy at the serving copy's first group or the track's end no longer reopens a copy that already ran out, so a reader whose local bounds leave nothing in its range ends with the track instead of parking forever. A capped copy's resolution of a range's end no longer sets the reader's window end, so a backfill's cap cannot drop groups the reader's range still covers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This review covers both fixes to the resume reader in rs/moq-net/src/model/resume.rs and the two regression cases added for them.
Copy::boundno longer reopens a drained copy:observeandbound_at_endnow setuntilandsinceand send the narrowed wire without callingreopen(). As a result, the replaced copy keeps itsdone, andlet_gono longer waits on a copy that has nothing left to send.updatestill reopens when ranges, budget, or bounds change, which is the case where reopening is needed.- A capped copy's resolved end no longer sets the window end: In
Reader::window, a resolved end at or past a copy's failover cap is now dropped.resolvethen uses the reader's own anchor instead. I checked that this fallback is exact:Window::new(.., &Placed)turns a rawAnchor::Time(t)end intot + 1throughwindow.rs'send(), and group keys are times. The start filter, which ignores a copy whose cap empties the range, is unchanged. - Regression cases:
regressions()gets one shrunk case per defect.
claude-opus-5-5 | 𝕏
|
No actionable comments were generated in the recent review. WalkthroughReplaced-copy bounding now updates the copy's subscription using the reader's ranges. Reader.window adjusts resolved range metadata when a failover cap applies. Two regression cases cover track-end bounding and capped backfill behavior. Merge Risk:
|
|
quest land watch: the merge queue removed this pull request at 45b38a0 because A person's removal ends the pick: the watcher leaves this pull request alone until a maintainer enqueues it again. (written by quest land watch) |

Problem
The scheduled Nightly's
test resume-modeljob failed onmain(run 43724172821,MOQ_RESUME_SEED=1648062584). The seed hits two separate defects inrs/moq-net/src/model/resume.rs. The model and the TLA+ spec are right in both cases.3..4, bounds0..1) never ended once the track finished after a route switch.bound_at_endbounded the replaced copy throughCopy::update, which since feat(moq-net)!: address groups by their start #8638 callsreopen(). That cleared thedonethe same poll had just recorded,let_gothen judged the copyWait(its unread group 3 sits past the local cap), and the read parked with nothing left to wake it.ResumeReader.tla'sBoundAtEndnever resetsdone, so the code had drifted from the spec.6..9never got group 8. The backfill copy, capped at 7, resolved the range's time end against its own capped wire, andReader::windowtook that capped end (7) as the reader's window end. The serving copy's group 8 was then skipped as outside the window.Approach
Copy::bound(until, reader)sets the bound andsinceand sends the narrowed wire withoutreopen().observeandbound_at_enduse it. A bound only narrows what a copy may deliver, so a copy that ran out stays out.update(ranges, budget, bounds changes) still reopens.Reader::window, a capped copy's resolved end at or past its cap is dropped. The end then comes from the reader's own anchor, or from an uncapped copy, matching how the existing filter already ignores a cap that empties the start.regressions()case per defect, each as the sweep shrank it.The JS reader needs no change: its
#boundnever resetsdone, and it has no per-reader window resolved from capped copies.Impact
None on the public API or wire. Behavior change inside the relay's resume reader only.
Caused by
reopen()toCopy::update, which bounding also calls, and resolved time-addressed ranges through copies whose cap shortens the resolved end. Found by the Nightly resume-model check. Both cases pass at its parent466f2f6c81and fail at7d1bee79cb.Validation
regressions()cases failed before the fix (the first:track end None, the second:missing groups [8]) and pass after it.just test resume-model(Rust sweep plus the JS model) with the Nightly seed1648062584(4096 cases) passes. Fresh seeds826245900and1601925091also pass.model::resume*tests pass.quest gate just checkpasses (12810 tests).ResumeReader.tlaalready describes bounding without reopening, and range resolution is outside what it models.Alternatives
has_unread_groupinCopy::retainsrespect the local cap. Rejected because the copy had already drained, and reopening it was the actual mistake. The cap is ignored there on purpose, so a rising cap finds the group again.Reader::windowentirely. Rejected because a capped copy's start resolution is still sound, and it can be the only ready copy.Follow-ups
849441640, fails on an independent defect. It predates feat(moq-net)!: address groups by their start #8638 (it also fails at466f2f6c81). An ordered reader on a fresh copy of a route that gave up group 8 (drop_groups) parks at 8 and never reads 9 to 11, but only when an earlier reader subscribed before the drop. Case:Join{0, unordered}, Write{i0 s0 g8 1}, Up{i0 s2}, Write{i0 s2 None 1}, GiveUp{i0 s2 g8}, Join{1, ordered},finish: false. This PR leaves it alone: it lives in the ordered cursor or in drop propagation to a later subscriber, not in the code changed here.Models
Size: S
Implementer: Claude, claude-opus-5-5, unknown effort
(Written by Claude Opus 5.5)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.Head: 45b38a0
Base: origin/main at 698ce5a
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1e046-ae46-7000-9f5c-ff12f6496406, round 1Score: 9/10,
The changes preserve exhausted-copy state when narrowing bounds and prevent a backfill cap from truncating the reader’s range; source review found no actionable defects, with builds and tests intentionally not run.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none