Repository navigation
test(moq-net): kill the resume and route node mutants Nightly missed - #9217
Conversation
Quest-Claim: b9a84a40276fa626
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>
|
Merge pick (maintainer away, granted the coordinator merges it confidently recommends): ✅ /quest-merge at bc7f64f. (Written by Claude Opus 5.5 with high) |
There was a problem hiding this comment.
✅ 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::subscribestartsMirroredwith ranges only. This is safe. Beforesubscribereturns, the firstsyncfinds the scalars differ from the defaults and sets them whilecopiesis still empty, so every copy is subscribed with the reader's real priority, delay, order, and feed. Another thread can lock the reader betweenreaders.pushand that firstsync, but those paths don't read the scalars frommirrored:Producer::askedandProducer::followreachReader::resumedandfold_locked, which takedelayfromsubscription.read().serve_fromcallssyncitself.Copy::retainsreturns beforemirrored.budget()unlessgroups_readis set.
- One mutants exclusion. The
ranges == self.mirrored.rangesguard inReader::synconly matters once the edit log no longer reaches back. Without it, the code falls through toChange::All, which rebuilds the window and re-resolves from the copies, so the guard saves work rather than changing results. - New
resume.rstests. They cover:- edits and replacements below the serving copy's resume point
- lifting the
oldest_endsrefusal - 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::resumedfor a reader whose update hasn't been mirrored yet, staged by updating the preferences channel directlyProducer::follow's resume, order, feed guard, and rekey
- New node test.
releasing_orphans_keeps_the_open_sessions_claimschecks thatrelease_orphansreleases the orphan as lost and that another open session's lane still forwards. - Quest file deleted. The quest is marked done.
claude-opus-5-5 | 𝕏
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|

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. TheProducer::subscriptionmatch guards (resume.rs:193,:198) no longer exist: that code becameProducer::askedwithout thefailedguard. The run's artifacts listed moreReader::syncsurvivors than the quest named, and a sweep of the 73 mutants in these functions found 23 survivors onmain.New tests (in
model/resume.rsunless 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_endsresets on a wholesale replacean_ended_copy_leaves_replaced_ranges_to_the_serving_copy(extended): a failed copy holding the new start still places nothinga_switch_off_a_failed_copy_asks_for_ranges_as_the_reader_placed_them: thefailedguard at a route switch (Nightly'sresume.rs:1443)a_returning_route_resumes_past_the_reader_now: a returning route with a new resume is asked wholea_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::resumedfor a reader whose update hasn't been mirrored yeta_held_subscription_follows_its_readers_terms_edit_by_edit:Producer::follow's resume, order, the feed guard, and the rekeyroute/node/tests.rsreleasing_orphans_keeps_the_open_sessions_claims: no test calledrelease_orphansbeforeDecisions
Taken without the maintainer; a later review can undo each:
Consumer::subscribedrops its scalar stores instead of excluding them. The reader started with its preferences' priority, delay, order, and feed, but the firstsyncmirrors them before it asks any copy, and every read (budget,send,wire) comes after a sync. Anexclude_reentry can't drop them: cargo-mutants 27.1.0 doesn't applyexclude_reor--reto struct-field deletions (sourcefrog/cargo-mutants#632, fixed on its main, not released).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.routes.readersascopies()already does.Validation
sh/rs/mutants.sh --re 'in (Reader::(sync|resumed)|Producer::(asked|follow|readers|subscribe)|Consumer::subscribe|Node::release_orphans)$': onmain, 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-runbuilds.just checkpasses.Caused by
Reader::syncandReader::resumedwithout tests that tell them apart (found by check: Nightly mutants)Producer::followwithout tests for its resume, order, feed, and rekey (found by check: Nightly mutants)Node::release_orphanswithout 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::subscribebehaves 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 reviewafter 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-d3dfe24a75c4Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1f7b1-258d-74d1-8007-d0ff524fecda, round 1Score: 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