Skip to content

fix(net): a time start under the resume point reads the group holding it - #9278

Draft
kixelated wants to merge 4 commits into
mainfrom
quest/m1/resume-time-below-floor
Draft

kixelated wants to merge 4 commits into
mainfrom
quest/m1/resume-time-below-floor

Conversation

@kixelated

@kixelated kixelated commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m1/resume-time-below-floor.md and deletes it.

A resumed reader whose range starts at a time below the serving copy's resume point now starts at the group holding that time, in Rust (rs/moq-net/src/model/resume.rs) and JS (js/net/src/resume.ts) alike. Before, it started at a group key equal to the time.

Changes

  • The raised start stays unplaced. A copy whose floor raised a range's time start no longer places that range: unraised is replaced by raised. The window keeps waiting, so it reads groups at or above the time meanwhile and hands out nothing below where the range will resolve.
  • A backfill places the start. backfill_gaps asks a backfill from the raised time, below the resume point, and the backfill resolves the start at the group holding it, as the route would for a plain reader.
    • When the reader already delivered everything from that time up to the resume point, nothing is owed, so the start is placed at the time itself.
    • That range's end comes from its time end, or else from where the serving copy placed it.
  • A backfill's local floor. A backfill copy (the new backfill flag) takes what the reader's window hands out rather than raising its local range to its own floor.
  • Exhaustion checks the whole window. exhausted checked for a gap kept out by the local floor or cap only under the resume point. It now checks the whole window, so a read stays open when an earlier copy placed the window lower than the serving copy's own ranges start. The sweep found this, and it reproduces on main.
  • JS 0 floor. #wire passed copy.floor ? copy.floor : undefined to clamping, which treated a copy resumed at group 0 as having no floor. It now passes the floor as is. This was JS-only, found by the sweep, and reproduces on main.
  • Both oracles (resume_model.rs, resume.model.test.ts) learn the group holding a time start: once an arrival reader's range first resolves, it owes from the newest group at or below the start that every live route holds. Each oracle gains the raised case and the exhaustion case as regressions, and JS also gains the 0 floor case.

Public API: none. Wire: none.

Choices made without asking

  • ResumeReader.tla is unchanged. It models no time anchors and no local range, so neither the raised start nor a backfill's local floor exists in it, and its copies already admit from their own floors.
  • When a raised range is owed, the backfill is asked from the time itself, and its own resolution finds the holding group, instead of the reader guessing it from what its copies happen to hold.

Validation

  • New unit tests, each failing on main and passing here:
    • Rust: a_time_start_under_the_resume_point_reads_the_group_holding_it and a_backfill_places_a_time_start_its_serving_copy_raised.
    • JS: a backfill places a time start its serving copy raised, at the group holding it.
  • Model regressions:
    • The raised case fails the Rust model on main with missing groups [6]. JS passes it on main, because its cache path already resolves that case.
    • The exhaustion case fails on main in both languages with missing groups [0].
    • The JS 0 floor case fails on main with missing groups 1; handed out 0,2.
  • After merging main (including fix(moq-net): a waiting time start reads its owed group first, and a fill past the live edge reaches subscriptions #9172):
    • just rs test -p moq-net --features async --lib: 4130 passed.
    • bun test ./js/net/src/: 3438 passed.
  • Model sweeps at 4096 cases:
    • Rust passes on seeds 1, 3, 5, 6, 7, 10, 12, 13, 15, 17, 18, 19 and 20.
    • JS passes on seeds 2 to 9, 11 and 12.
    • The failing seeds hit only the two pre-existing bugs below, which reproduce on main.
  • just fix produced no diff, and just check passed.

Pre-existing on main (b4496b1), so not this PR's, each with a follow-up:

  • Rust, MOQ_RESUME_SEED 2, 8, 9, 11, 14 or 16 with MOQ_RESUME_CASES=4096 just test resume-model: panics with range start is greater than range end in BTreeMap in DropCursor::next.
  • JS, MOQ_RESUME_SEED=10: an ordered reader misses group 0 after a range edit.

Caused by

Follow-ups

Models

Size: L
Implementer: Claude, claude-opus-5-5, high effort

(Written by Claude Opus 5.5 with high effort)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: de04137, named in full once no reviewer reports a finding

  • Base: origin/main at cb9cb51

  • Risk: medium, Changes to Rust and JS resume behavior could cause consumers to miss groups or stall during failover and range updates, while preserving public APIs and wire formats; a revert fully undoes the change.

  • Classified: medium by Codex, gpt-6.1-sol, low effort, session 01a1fc72-4193-7ba2-9469-2b03ce0f32de

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

  • Session: 01a1fc72-57cb-7621-8a98-83bb6ea7f436, round 1

  • Score: 5/10, The head needs rework because relative-end resolution, delayed backfill retention, and skipped-range completion can leave bounded reads pending indefinitely.

  • Rounds: 1; first round 3 (medium 3); findings 3 (medium 3): fixed 0, refuted 0, open 3

  • Findings, open until the next round settles them:

    • Medium, rs/moq-net/src/model/resume.rs:1883: Preserve the serving copy's relative end when backfilling a start
    • Medium, rs/moq-net/src/model/resume.rs:939: Apply the below-floor exception to backfill retention
    • Medium, rs/moq-net/src/model/resume.rs:2630: Exclude settled skips from the out-of-bounds gap check

kixelated and others added 4 commits November 20, 2026 17:28
A resumed reader whose range starts at a time below the serving copy's
resume point started at a group key equal to that time. The serving
copy's floor raised the start, and the window placed it there. Now the
raised start stays unplaced: a backfill asked from the time places it at
the group holding it, or, when the reader already has everything under
the resume point, the start places at the time itself.

A backfill takes what the reader's window hands out rather than its own
floor. Exhaustion checks a kept-out gap across the whole window, not only
under the resume point. JS passes a 0 floor to clamping instead of
treating it as none.

Both resume models learn the group holding a time start, with
regressions for each case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rust drop cursor panic and the JS ordered reader's missed group both
reproduce on main and fail Nightly's resume model sweep on some seeds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title A resumed reader's time start below its copy's resume point starts at the group containing it fix(net): a time start under the resume point reads the group holding it Nov 21, 2026

This branch has not been deployed

No deployments
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