Skip to content

ci: shard PR cargo-mutants next to coverage - #679

Merged
reardencode merged 1 commit into
masterfrom
ci/mutants-pr-shards
Sep 22, 2026
Merged

reardencode merged 1 commit into
masterfrom
ci/mutants-pr-shards

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Hero-Gamer on #668 watched mutants-pr find 313 mutants and get canceled at the 30-minute job cap. At -j 2 that diff is about 50 minutes of work, so the advisory result was partial. reardencode's note on that thread was to free concurrent runners for more mutants jobs. #678 did the first half (short gates share one runner). This is the second half.

PR mutation testing now lives in ci.yml as four --in-diff shards, in the same window as coverage:

  • needs: [fmt, clippy, test], so a red fmt/clippy/test does not start the shards
  • cargo mutants --workspace --in-diff git.diff --shard k/4 --sharding slice -j 2
  • continue-on-error: still not a merge gate (missed mutants are expected; the Sunday 8-shard sweep stays the full-tree run)
  • mutants.out uploaded per shard
  • skipped when the diff does not touch crates/, Cargo.toml, Cargo.lock, ci.yml, or mutants.yml

Why four shards, not two and not a count threshold: two shards of a 313-mutant diff land around 25 minutes, against the same 30-minute cap. Four lands around 12–15 minutes. Small diffs already finish in well under a minute per job, and these four start only after test, so they do not sit in the opening burst. A dynamic "shard if count > 150" matrix is more workflow than the concurrency problem we have.

Why the baseline stays, and why there is no --timeout 240: the baseline on this tree is a few seconds and is what auto-sets the 20-second per-mutant test timeout. Skipping it (the upstream sharded example) forces a manual timeout; 240 seconds would let one hang consume the shard. -j stays 2.

Weekly mutants.yml is unchanged apart from dropping the PR job so it is not run twice.

Test plan

  • Required checks stay green (fmt, deny, clippy, ast-grep, test, windows, macos, coverage, nixos-module-eval)
  • mutants-diff is success and the four mutants (k/4) jobs start after test, overlapping coverage
  • Each shard accepts --shard k/4 --sharding slice (this diff has no Rust mutants, so they should exit after listing none)
  • mutants.yml no longer starts mutants-pr on the pull request

A ~300-mutant in-diff at -j 2 needs about 50 minutes, and the single
mutants-pr job was canceled at 30. Four shards start after fmt, clippy,
and test, in parallel with coverage, and stay advisory. Weekly sweep
is unchanged.
@reardencode
reardencode merged commit fed0a07 into master Sep 22, 2026
24 checks passed
@rearden-grok
rearden-grok Bot deleted the ci/mutants-pr-shards branch September 22, 2026 15:59
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