Skip to content

Use coverage-driven mutation tests and shared CI baselines - #216

Merged
tob-scott-a merged 10 commits into
mainfrom
codex/parallel-mutation-baselines
Nov 24, 2026
Merged

tob-scott-a merged 10 commits into
mainfrom
codex/parallel-mutation-baselines

Conversation

@tob-scott-a

@tob-scott-a tob-scott-a commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Mutation campaigns exceeded the six-hour runner limit because the adapter disabled coverage filtering and repeatedly ran broad test suites. The gate also accepted inconclusive results outside its 12-file reviewed scope. This restores coverage-driven selection, uses one shared instrumented coverage baseline followed by 32 mutation jobs, and rejects inconclusive results throughout a campaign.

  • Attribute fixture setup and teardown to every consumer, including cached and dynamically requested fixtures. Retain tests with opaque child processes or tracing, and use the full suite for import-time or unmapped code. Fingerprint native tools and recognize only the fixed native git -C ROOT rev-parse HEAD query; other Git commands and Python/script wrappers remain opaque.
  • Share the baseline and coverage plan only when repository inputs, packages, native binaries, relevant environment, test collection, and runner configuration match. Skip the outer pytest test loop and the preparatory subset matrix.
  • Confirm ordinary kills using actual failing prefixes. Controls collect the identical selected tests, execute through the failing test, and include fixture teardown. Reuse the longest successful prefix for each collection and matching validated full-suite orders. Confirmations use four workers after the mutant pool closes; survivors trigger no extra tests. Require an actual failed report so a harness exit cannot produce a kill. Preserve source-attributed collection-exit confirmation and exact plan-bound selections in the gate.
  • Reject errors, timeouts, pardons, and missing tests even outside the reviewed survivor scope. Add focused contracts for scanner offsets and AST helpers, plus deterministic work bounds for cyclic traversals and fixed-point analysis. These regressions turn all 17 timeouts found in the full campaign into ordinary test failures. Prefer the corresponding helper and language tests before broad integration tests, retaining every selected test as fallback.
  • Use deterministic Hypothesis inputs during mutation campaigns. Share a repository parse across three read-only checks and replace a huge Dafny fixture with exact native scanner depth/work checks plus a smaller parser case. Retain deterministic regressions for the previously inconclusive Rust, YAML, Java, Rocq, and diagram mutations. No production source, mutation exceptions, or reviewed survivor policy changes.

One job prepares the shared coverage baseline; 32 mutation jobs each run four workers. Harness and dependency changes run the complete 213-file, 12,092-mutant campaign before merging. The adapter remains pinned to pytest-gremlins 1.14.3 and rejects reports from older adapter versions.

Measured wall time: a controlled local comparison used the same frozen production/test inputs, all 786 mutants in the 12 reviewed files, all 5,779 selected tests, Python 3.15, four workers, and disabled result caching. Both measurements were unsharded and included preparation, mutation execution, and confirmation.

Configuration Wall time Killed Survived Timeouts Errors
Plain pytest-gremlins 17m 09.8s 778 6 2 0
Single-baseline flow 11m 13.0s 780 6 0 0

This is a 34.7% elapsed reduction (1.53× speedup) on that frozen workload. Every native kill was retained, the exact same six reviewed equivalents survived, and the two Rust timeouts became ordinary test failures. An independent audit checked all mutant IDs, source hashes, selections, execution records, progress rows, and equivalent-mutant fingerprints. These measurements establish savings for the reviewed workload; current full-repository timing remains pending.

Validation: all 5,955 local tests pass with native binary tools required (142 seconds). Ruff, formatting, ty, and whitespace checks pass. A real pytest subprocess mutation run reproduced the exact 17 previously inconclusive mutations and killed all 17, with actual failed-report evidence and passing neutral controls. Independent collection confirms 5,797 application tests and 158 mutation-infrastructure tests. Full-source CI and its final artifact audit are pending on the current revision.

Follow-up #217 tracks a smaller dedicated mutation-test group. This PR retains the complete application test pool.

@tob-scott-a tob-scott-a changed the title Share mutation baselines across smaller CI shards Fix full mutation CI runtime and inconclusive results Nov 24, 2026
@tob-scott-a tob-scott-a changed the title Fix full mutation CI runtime and inconclusive results Use coverage-driven mutation tests and shared CI baselines Nov 24, 2026
@tob-scott-a
tob-scott-a merged commit 442a901 into main Nov 24, 2026
52 of 55 checks passed
@tob-scott-a
tob-scott-a deleted the codex/parallel-mutation-baselines branch November 24, 2026 23:14
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