Skip to content

test(net): keep the resume model's missing-group seed as a regression - #9602

Merged
kixelated merged 5 commits into
mainfrom
quest/m0/nightly/resume-model-missing-group
Nov 26, 2026
Merged

kixelated merged 5 commits into
mainfrom
quest/m0/nightly/resume-model-missing-group

Conversation

@kixelated

@kixelated kixelated commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Closes the quest quest/m0/nightly/resume-model-missing-group.md.

Problem

MOQ_RESUME_SEED=2 MOQ_RESUME_CASES=4096 fails model::resume_model::readers_match_the_logical_track: reader 1 never gets group 1. The model is right and the reader is wrong.

Root cause: a switch caps the copy it replaces, which narrows that copy's ranges. Record::retire then treats the narrowing like a reader moving its ranges: the gaps left between settled keys (here group 0 handed out, and drops 2 and 6 reported because the reader polls drops) exceed one per run, so the gap at 1 is settled as handed out. When the route fails back, Reader::sync reuses that copy and lifts its cap, but the copy's own record now skips group 1 as a replay. Only a drop-polling reader that still holds a group across the switch keeps the copy, which is why every op in the shrunk case is needed.

Approach

moq-dev/moq#9564 (Record::retire forgets a retired gap instead of settling it) already fixes this at the record, for every reader. On its head (3d6ec82), without any resume-side change, the shrunk case, the new unit test, and the seed-2 sweep all pass. So this PR carries only the regressions:

  • resume_model::regressions gets the shrunk case.
  • resume.rs gets a_returning_route_hands_out_a_group_its_capped_copy_retired, the same path in direct calls.
  • Deletes the quest and its link from resume-route-mutants.md.

#9564 has merged; on main with it, both tests pass.

Impact

None: tests and quests only. Public API: none. Wire: none.

Alternatives

Overlap

  • moq-dev/moq#9564 holds the fix; see Approach. Both PRs add tests in resume.rs's mod test, in different places, and applying this PR's diff onto its head was clean.
  • moq-dev/moq#9529 touches resume.rs and ResumeReader.tla, but not the code paths here; no logic overlap.
  • JS has no counterpart to Record::retire (only floor folding), so no JS change.

Caused by

  • moq-dev/moq#9422 - introduced Record::retire, which settles a retired gap as handed out, so lifting a resume copy's cap loses the group (found by check: Nightly's resume-model sweep)

Validation

Follow-ups

  • quest/m0/test-flakes-4/gst-sibling-finish-replay.md (new, S): moq-gst's a_reannounced_sibling_instance_does_not_replay_its_finish fails about 1 in 40-70 stress runs, also with this PR's changes disabled; the first instance's group replays on its pad after a reannounce. No open decisions.

Decisions

  • Fix location (decision): ✅ rely on moq-dev/moq#9564's fix at the record (rejected: landing the resume-side guard from 07f1556). One root fix covers every reader; the guard would be dead code after it. This PR's diff carries no resume-side guard.

Models

Size: M
Implementer: Claude Code, claude-opus-5-5, unknown
Implementer: Claude Code, claude-opus-5-5, low effort (iterate, XS)
Implementer: Claude Code, claude-opus-5-5, high effort (iterate)

🤖 Generated with Claude Code

(Written by Opus 5.5 with high)

Review

Rewritten by quest review after each round.

  • Head: dba6c46
  • Base: origin/main at 1322b2f
  • Risk: low, What could break: nothing a consumer or peer relies on. The change deletes two quest plan files, adds one quest plan file, and adds a unit test plus a regression case to test-only code in rs/moq-net (resume.rs test module, resume_model.rs regressions list). No source behavior, public API, wire format, or stored format changes, so no published consumer or deployed relay is exposed. A revert fully undoes it, and the only harm of a wrong test is a red or missed check in CI, which the repository's own checks catch first.
  • Classified: low by Claude Code, claude-haiku-5-5, low effort, session 709c485d-51ad-48fc-a382-bb82b6b6689e
  • Risk file: bb7b1c0de60b
  • Local review: none, since the head is low risk

kixelated and others added 4 commits November 25, 2026 04:33
A switch caps the copy it replaces, which narrows that copy's ranges, so its
record retires the gaps between what it handed out and the drops its reader
reported: past one per run, a gap counts as handed out. Lifting the cap,
whether by returning to the route or by widening the copy as a backfill, then
never offers a group landing in that gap, though the logical reader lacks it.

A copy whose record counts a group past its cap as handed out now stays
replaced: a returning route serves from a fresh copy, and a backfill asks
again rather than widening it.

Fixes the `MOQ_RESUME_SEED=2` sweep of `readers_match_the_logical_track` and
keeps its shrunk case as a regression.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#9564 makes `Record::retire` forget a retired gap rather than
settle it as handed out, which fixes this at the record for every reader:
the shrunk case, both unit tests, and the `MOQ_RESUME_SEED=2` sweep pass on
its head without the resume-side guard. Drop the guard, which would never
fire once that lands, and keep the tests as its regressions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Resume model misses a group after give-ups and a route flap test(net): keep the resume model's missing-group seed as a regression Nov 25, 2026
@kixelated

Copy link
Copy Markdown
Collaborator Author

Maintainer decision (/quest-run, 2026-11-25):

(Written by Opus 5.5 with high)

@kixelated

Copy link
Copy Markdown
Collaborator Author

Applied the decision: recorded under ## Decisions; the head (2eb5c54) carries only the regression tests, no resume-side guard. Still waiting on #9564 to merge.

(Written by Claude Opus 5.5 with low effort)

@kixelated
kixelated marked this pull request as ready for review November 26, 2026 03:51
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds two regression scenarios for route give-ups and group delivery after a route returns. It removes the related missing-group quest and link. It also adds a separate report about intermittent sibling finish replay test failures.

Estimated code review effort

Merge Risk: Minimal · up to dba6c

This change only adds regression tests and documentation for a resume-model bug and records a separate test flake. It does not alter runtime behavior, so the merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: it adds a regression test for the resume model's missing-group seed. It is type-prefixed, concise, and matches the changeset, which adds regression cases in resume_mod…
Description check Passed The description is detailed and on-topic. It covers the problem (a resume-model failure with a specific seed and case count), the root cause, the approach (regression cases plus a unit test, with the …
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.
Full details: Title check

Explanation

The title names the main change: it adds a regression test for the resume model's missing-group seed. It is type-prefixed, concise, and matches the changeset, which adds regression cases in resume_model.rs and resume.rs and deletes the quest file. It does not mention the dependency on the upstream #9564 fix, but that is not required for the title to pass.

Full details: Description check

Explanation

The description is detailed and on-topic. It covers the problem (a resume-model failure with a specific seed and case count), the root cause, the approach (regression cases plus a unit test, with the fix relying on upstream #9564), the removal of the quest and its link, overlap with other PRs, validation runs, and a follow-up quest. It matches the changeset, which adds the regression case and unit test and deletes the quest files.

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: 50c33d9f-9063-491d-b7f5-3e01400f54a9
Commits

Reviewing files that changed from the base of the PR and between 1322b2f and dba6c46.

Files selected for processing: 5

  • quest/m0/nightly/resume-model-missing-group.md
  • quest/m0/nightly/resume-route-mutants.md
  • quest/m0/test-flakes-4/gst-sibling-finish-replay.md
  • rs/moq-net/src/model/resume.rs
  • rs/moq-net/src/model/resume_model.rs
Files with no reviewable changes: 2

  • quest/m0/nightly/resume-model-missing-group.md
  • quest/m0/nightly/resume-route-mutants.md

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

@kixelated
kixelated added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 5948197 Nov 26, 2026
6 checks passed
@kixelated
kixelated deleted the quest/m0/nightly/resume-model-missing-group branch November 26, 2026 04:37
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