Skip to content

Speed up cargo-mutants runs - #17

Merged
wfchandler merged 6 commits into
mainfrom
wc/mutants-speed
Oct 8, 2026
Merged

wfchandler merged 6 commits into
mainfrom
wc/mutants-speed

Conversation

@wfchandler

Copy link
Copy Markdown
Collaborator

Misc changes to make running cargo-mutants a bit faster

wfchandler and others added 6 commits October 8, 2026 15:12
A sweep builds the fixtures at the primary pin, tokio 1.52.4, which
selects the v1_49 family, so nothing a sweep runs reaches
tokio_v1_52_0.rs. Every mutant in it reads as missed, and a missed
mutant costs a full suite run. Exclude it with the other non-primary
families, whose judge is the version matrix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mutant's test run stops at its first failure, but nextest starts
tests in binary-name order, so the verdict waits behind every suite
that sorts before the one that catches it. hansei-runtime's unit
tests take milliseconds yet finish around 1,500th of ~2,000: a
mutant one of them catches takes 7.8 s to report on an idle 32-core
host, and most of a full run under a sweep's load.

Add a nextest profile for cargo-mutants that orders the suite: the
minute-long seeded-fault tests first, so they do not add their whole
length to a missed mutant's run; then the in-process unit tests and
hansei's; then acceptance. The same mutant reports in 1.1 s.

The config's test arguments are joined with any given after `--` on
the command line, and nextest refuses a flag given twice; say so
beside them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mutant builds with the dev profile, which carries full debug info
for every workspace crate. Only exegesis's and hansei's suites read
any, from their own binaries, and CI's profile keeps it for exactly
those two. Build with it: a mutant in hansei-runtime rebuilds in
2.95 s instead of 3.35 s, and the optimized exegesis and
hansei-bundle re-extract faster for a mutant in either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_package judges every mutant with all eight crates' suites, but
only the mutated crate's suite and those of the crates depending on
it can see a mutant: nothing else links it or runs a binary built
from it. Say so beside the list, which `--test-package` on the
command line replaces; a hansei-runtime sweep judged that way runs
999 tests per mutant instead of 1,957.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mutation run goes on the Linux host under a systemd-run scope, with
the host's own C library. The Linux goldens are the test image's
rendering, and the cores show the C library's frames, so 22 offline
command goldens differ there and the unmutated baseline fails before
any mutant runs.

Run cargo mutants through in-image.sh instead. The image already
carries cargo-mutants, and the script sets the caps the scope did:
16 GiB of address space per process and 48 GiB for the container.
The container sees only the checkout, so the diff an --in-diff run
reads moves there, as the ignored mutants.diff.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mutation sweep over the tokio, toolchain and reqwest review work
leaves six survivors. Two are behavior no test reads.
Releases::range_for names a version in a minor no span reads, between
spans of other minors, against the span below it; no test places such
a version, so naming the topmost span instead goes unnoticed. An
EndOfAny walk root carries the note of the parent that bound; no test
reads it, so dropping it, or attaching an empty note where there is
none, goes unnoticed. Test both.

The other four change nothing observable: Releases::select and
range_for compare against a floor or a ceiling only for a version no
span holds, which can never equal one, and absent_here already
returns an empty Vec. Exclude them, with the reasons beside them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wfchandler
wfchandler merged commit 216448f into main Oct 8, 2026
5 checks passed
@wfchandler
wfchandler deleted the wc/mutants-speed branch October 8, 2026 21:43
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