Skip to content

test(moq-net): kill the resume and route node mutants Nightly missed - #9217

Merged
kixelated merged 3 commits into
mainfrom
quest/m0/nightly/resume-node-mutants
Nov 20, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m0/nightly/resume-node-mutants

Conversation

@kixelated

@kixelated kixelated commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m0/nightly/resume-node-mutants.md, from the triage of Nightly run 44562804083.

Summary

Tests kill every mutant cargo-mutants generates in the functions holding Nightly's survivors (Reader::sync, Reader::resumed, Producer::follow/asked/readers/subscribe, Consumer::subscribe, Node::release_orphans), and it no longer generates the ones that were equivalent.

First I ran current main's tests: they killed none of the survivors that still exist, including those after moq-dev/moq#9115. The Producer::subscription match guards (resume.rs:193, :198) no longer exist: that code became Producer::asked without the failed guard. The run's artifacts listed more Reader::sync survivors than the quest named, and a sweep of the 73 mutants in these functions found 23 survivors on main.

New tests (in model/resume.rs unless noted):

  • replaced_ranges_below_the_resume_point_place_where_the_cache_holds_them, an_added_range_below_the_resume_point_backfills_from_the_route: an edit or replacement below the serving copy's resume point (Reader::sync !added.is_empty(), !matches!(change, Scalars), !concluded && copy_failed)
  • replacing_an_oldest_end_lifts_its_refusal: oldest_ends resets on a wholesale replace
  • an_ended_copy_leaves_replaced_ranges_to_the_serving_copy (extended): a failed copy holding the new start still places nothing
  • a_switch_off_a_failed_copy_asks_for_ranges_as_the_reader_placed_them: the failed guard at a route switch (Nightly's resume.rs:1443)
  • a_returning_route_resumes_past_the_reader_now: a returning route with a new resume is asked whole
  • a_new_copy_places_an_unmirrored_live_join_by_its_delay, a_new_copy_takes_no_placement_of_an_unmirrored_range_from_a_failed_copy: Reader::resumed for a reader whose update hasn't been mirrored yet
  • a_held_subscription_follows_its_readers_terms_edit_by_edit: Producer::follow's resume, order, the feed guard, and the rekey
  • route/node/tests.rs releasing_orphans_keeps_the_open_sessions_claims: no test called release_orphans before

Decisions

Taken without the maintainer; a later review can undo each:

  • Scope. I swept every mutant in the survivors' functions, not all ~900 in the two files (about 22 hours locally). The Nightly rotation covers the rest, and a new survivor gets its own quest from triage. So the quest is deleted as done.
  • Consumer::subscribe drops its scalar stores instead of excluding them. The reader started with its preferences' priority, delay, order, and feed, but the first sync mirrors them before it asks any copy, and every read (budget, send, wire) comes after a sync. An exclude_re entry can't drop them: cargo-mutants 27.1.0 doesn't apply exclude_re or --re to struct-field deletions (sourcefrog/cargo-mutants#632, fixed on its main, not released).
  • One exclusion: replace match guard ranges == self.mirrored.ranges with false in Reader::sync. That arm is reached only once more than 2n+64 edits land between two syncs. Asking the unchanged ranges whole places and backfills as before, and each copy's replace of equal ranges is a no-op. A staged churn of 80 edits read the same, ordered and not, with and without the guard.
  • Two tests stage the unmirrored window by updating the reader's preferences channel directly, the cross-thread gap between an update and its mirror sync. They reach into routes.readers as copies() already does.

Validation

  • Applied each surviving mutant by hand to confirm the new tests fail on it and pass on the original.
  • sh/rs/mutants.sh --re 'in (Reader::(sync|resumed)|Producer::(asked|follow|readers|subscribe)|Consumer::subscribe|Node::release_orphans)$': on main, 73 mutants, 23 missed. On this head, 68 mutants, 68 caught.
  • cargo nextest run -p moq-net --all-features --lib --test integration: 4057 passed. cargo test -p moq-net --lib --no-default-features --no-run builds. just check passes.

Caused by

  • moq-dev/moq#9127 - added the failed-copy placement guards in Reader::sync and Reader::resumed without tests that tell them apart (found by check: Nightly mutants)
  • moq-dev/moq#9134 - added edit-based range mirroring and Producer::follow without tests for its resume, order, feed, and rekey (found by check: Nightly mutants)
  • moq-dev/moq#9106 - added Node::release_orphans without a node test (found by check: Nightly mutants)

These follow the quest's triage; I didn't re-blame each line.

Impact

Public API: none. Wire: none. Consumer::subscribe behaves the same; it stores fewer fields up front.

Follow-ups

None. When a cargo-mutants release ships the #632 fix, field-deletion mutants become excludable like the rest; nothing here waits on it.

Models

Size: S
Implementer: Claude, claude-opus-5-5, medium effort

🤖 Generated with Claude Code

(Written by Claude Opus 5.5 with medium)

Review

Rewritten by quest review after each round.

  • Head: bc7f64f

  • Base: origin/main at 7b89fd6

  • Risk: medium, Changing initial subscription preference mirroring could alter group delivery for moq-net readers, while preserving public APIs and wire formats, and a revert fully undoes the change.

  • Classified: medium by Codex, gpt-6.1-sol, low effort, session 01a1f7b0-fb59-7403-ad4e-d3dfe24a75c4

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

  • Session: 01a1f7b1-258d-74d1-8007-d0ff524fecda, round 1

  • Score: 9/10, No actionable defects were found, and the behavior-preserving initialization change and focused regression tests look ready, though builds and tests were not run as instructed.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

kixelated and others added 3 commits November 19, 2026 18:56
Tests for each survivor in Reader::sync, Reader::resumed, Producer::follow, and Node::release_orphans. Consumer::subscribe no longer stores scalars the first sync overwrites before any copy reads them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers a switch off a failed copy and a returning route's resume, and excludes the equal-ranges guard in Reader::sync, which only saves work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Mutants in resume and route node code are killed test(moq-net): kill the resume and route node mutants Nightly missed Nov 20, 2026
@kixelated
kixelated marked this pull request as ready for review November 20, 2026 06:44
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge pick (maintainer away, granted the coordinator merges it confidently recommends): ✅ /quest-merge at bc7f64f.

(Written by Claude Opus 5.5 with high)

@kixelated
kixelated enabled auto-merge November 20, 2026 06:44

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Approach: sound. The PR kills the survivors with targeted tests, drops initial stores in Consumer::subscribe that the first sync overwrites before anything reads them, and excludes one mutant of a guard that only saves work.

Reviewed changes

All four files at bc7f64f.

  • Consumer::subscribe starts Mirrored with ranges only. This is safe. Before subscribe returns, the first sync finds the scalars differ from the defaults and sets them while copies is still empty, so every copy is subscribed with the reader's real priority, delay, order, and feed. Another thread can lock the reader between readers.push and that first sync, but those paths don't read the scalars from mirrored:
    • Producer::asked and Producer::follow reach Reader::resumed and fold_locked, which take delay from subscription.read().
    • serve_from calls sync itself.
    • Copy::retains returns before mirrored.budget() unless groups_read is set.
  • One mutants exclusion. The ranges == self.mirrored.ranges guard in Reader::sync only matters once the edit log no longer reaches back. Without it, the code falls through to Change::All, which rebuilds the window and re-resolves from the copies, so the guard saves work rather than changing results.
  • New resume.rs tests. They cover:
    • edits and replacements below the serving copy's resume point
    • lifting the oldest_ends refusal
    • switching off a failed copy, and a failed copy that holds the new start
    • a returning route that resumes past what the reader now holds
    • Reader::resumed for a reader whose update hasn't been mirrored yet, staged by updating the preferences channel directly
    • Producer::follow's resume, order, feed guard, and rekey
  • New node test. releasing_orphans_keeps_the_open_sessions_claims checks that release_orphans releases the orphan as lost and that another open session's lane still forwards.
  • Quest file deleted. The quest is marked done.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 20, 2026
@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Mirrored now starts with default scalar preferences and copies subscription ranges. New tests cover copy placement, route resumption, range edits, and backfill behavior. The changes also add a node test for orphan claim release, exclude a Reader::sync mutation, and remove a nightly-mutant task document.

Merge Risk: Minimal · up to bc7f6

The changes primarily strengthen resume and orphan-release tests, with a small subscription-initialization simplification. No actionable merge-blocking issue is established; merge after normal checks pass.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: adding tests that kill the mutants Nightly reported as missed in the resume and route node code (moq-net). The changeset adds tests in model/resume.rs and route/node/tests.…
Description check Passed The description is detailed and relevant. It explains the Nightly mutant quest, the new tests, the mutant sweep results, the exclusion of one mutant, the scalar store removal in Consumer::subscribe, a…
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 change: adding tests that kill the mutants Nightly reported as missed in the resume and route node code (moq-net). The changeset adds tests in model/resume.rs and route/node/tests.rs, deletes the quest doc, and adds an exclude_re entry, so the title matches the main change.

Full details: Description check

Explanation

The description is detailed and relevant. It explains the Nightly mutant quest, the new tests, the mutant sweep results, the exclusion of one mutant, the scalar store removal in Consumer::subscribe, and the validation commands. This matches the raw summary's changes to the mutants config, deleted quest doc, resume.rs, and node tests.

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: d375948f-b24c-4976-ac9a-9b17d8e497d3
Commits

Reviewing files that changed from the base of the PR and between b3de94d and bc7f64f.

Files selected for processing: 4

  • .cargo/mutants.toml
  • quest/m0/nightly/resume-node-mutants.md
  • rs/moq-net/src/model/resume.rs
  • rs/moq-net/src/route/node/tests.rs
Files with no reviewable changes: 1

  • quest/m0/nightly/resume-node-mutants.md

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

Merged via the queue into main with commit 614272e Nov 20, 2026
10 checks passed
@kixelated
kixelated deleted the quest/m0/nightly/resume-node-mutants branch November 20, 2026 06:59
kixelated added a commit that referenced this pull request Nov 20, 2026
#9202, #9217 and #9130 change no covered behavior the model represents:
announce scope, subscriber scalars the first sync mirrors, and ordered reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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