Skip to content

feat(mutation): split the full sweep across runners - #68

Merged
sinemacula-ben merged 3 commits into
masterfrom
feature/sharded-full-mutation
Oct 8, 2026
Merged

sinemacula-ben merged 3 commits into
masterfrom
feature/sharded-full-mutation

Conversation

@sinemacula-ben

@sinemacula-ben sinemacula-ben commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Draft until a maintainer reviews it; proven live from a consumer.

A large repository's full sweep exceeds the 6-hour job limit. This splits the scheduled or manual full sweep across heavy runners, keeping one global verdict.

Change Detail
Input mutation-full-shards, default 1. At 1 the sweep runs unsplit as before (no --mutate, no new config contract)
Plan Reads mutate from stryker.config.json / .stryker.conf.json, or an optional mutation:scope:full script. Splits by whole files only, heaviest first, by the last sweep's timings (line count when untimed)
Shard timeout-minutes: 345, --incremental --force --incrementalFile <fresh> --mutate. Passes on exit 1 only with Stryker's exact "under breaking threshold" line and a fresh report; a shard with no mutants is valid; always uploads
Verdict Mutation (full) Fails on a missing, stale, tampered or unfinished report, a file outside its shard, or a shard that instrumented fewer files or reported fewer mutants than planned. Merges, scores with Stryker's own mutation-testing-metrics, applies thresholds.break once, publishes the merged HTML/JSON and saves timings under a run/attempt key
Warnings A shard over half its 345 minutes, or a plan predicting more than 120 minutes per shard at the configured count. Static timeouts are listed per shard
Shared code .github/scripts/mutation-reports.mjs, checked out at job.workflow_sha, holds freshness, merge and scoring for both paths. The scoped cache merge now stops instead of saving a partial merge after a run whose shards all passed
Removed The full sweep's incremental cache restore, which did nothing under --force

Offline: actionlint with shellcheck, qlty, node --test for the library, and the plan, shard and verdict scripts run against a real 23,963-mutant report (merge is key-for-key identical, same score) and fault fixtures. The scoped score and cache merge were diffed against the current inline versions and match.

Live proof from a consumer whose unsplit sweep has passed 6 hours:

Run Result
6 shards, against two unsplit sweeps of the same commit Same 23,963 mutant keys and 6,572 static mutants. Score 98.93 against 98.95; the only detected-to-undetected flips are 3 static kills of the same flaky shape the two unsplit runs already disagree on. No static Survived-to-Timeout flip. One shard's runner slowed and timed out 217 extra kills (score-neutral), which the early warning flagged
Break above the score Every shard passed, two by deferral; Mutation (full) failed on the merged score
One shard cancelled Mutation (full) failed: shards ended cancelled, shard uploaded nothing
One report deleted Mutation (full) failed: shard uploaded nothing
12 shards on the current head 25,286 mutants, every shard under 345 minutes (slowest 204), 3h25m wall clock, timings saved. 12 heavy runners ran at once
Hosted-runner outage A plan job that was never picked up failed Mutation (full) rather than passing it

A large repository's full sweep can outgrow the 6-hour job limit. The new
mutation-full-shards input (default 1) splits it by whole files across
heavy runners, balanced by the last sweep's measured time per file.

Each shard reruns its files with --force and defers the break threshold.
The Mutation (full) verdict fails on any missing, stale or unfinished
report, merges the rest, scores the merge with Stryker's own metrics and
applies the threshold once. At one shard the sweep runs unsplit as before,
without the dead incremental cache restore.

Freshness, merging and scoring move into .github/scripts, shared by the
scoped and full paths. The scoped cache merge no longer saves a partial
merge after a run whose shards all passed.
Reject reports whose file map or mutant lists are malformed, trust a
shard record over the plan, and treat only folders as shard artifacts.
Merge files by their normalised path, match exclusions the same way,
weigh only each shard's own mutants when sharing out its time, and give
every shard a file when weights tie.
@sinemacula-ben
sinemacula-ben marked this pull request as ready for review October 8, 2026 14:02
@sinemacula-ben
sinemacula-ben merged commit da16784 into master Oct 8, 2026
6 checks passed
@sinemacula-ben
sinemacula-ben deleted the feature/sharded-full-mutation branch October 8, 2026 14:02
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