Skip to content

perf(l5): compile only the program per mutant, time in-process proofs from the unmutated port (Part of #8599) - #8637

Merged
squid-protocol merged 2 commits into
mainfrom
perf/8599-l5-fixed-cost
Nov 19, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
perf/8599-l5-fixed-cost

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #8599 (L5 speed). Two cuts to the per-case and per-mutant cost of det_mutation.py / mutation.py runs.

Summary

  • The javac check compiles the program, not the runtime (mutation.mutant_sources). Each mutant used to compile every .java file of the port, the 51-file cobolrt copy too (UPDCUST: 13,776 lines for a 752-line program). Mutants are cut from service/*.java, the runtime never refers to the program, and the baseline's compiled runtime is on the classpath, so only the program's files are compiled. All of them, not only the mutated one, because javac inlines a mutated static final constant into its callers. The overlay manifest now lists only what was compiled. Overlay adoption drops the baseline classes of every source the manifest lists, and the fallback's single-file compile used to list them all, which would have dropped the runtime's classes.
  • The in-process proof limit comes from the unmutated port (mutation.calibrate, direct_limit). Each in-process worker first runs the unmutated port with an empty overlay. That run must survive; otherwise the worker falls back to separate runs, which also makes it a tripwire for the in-process runner. The limit is 5 × the slowest worker's run, at least 30 s, at most the old max(300, 3 × baseline). A looping mutant used to hold a worker for 300 s or more, and the committed ledgers contain 201 such timeouts. Timeout and killed are both "caught", so a verdict can change only for a mutant that would survive but runs past 5 × T0.
  • docs/language_status/mutation_testing.md: phase timings and the validation.

Measured

nyx (load ~2), fast+one-jvm, --jobs 2, GITGALAXY_LICENSE_KEY=COMMUNITY_FREE_TIER (as in CI):

run translate baseline javac prove total
cbsa-updcust --sample 60 --seed 1, main 20 s 39 s 41 s 40 s 141 s
the same, this PR 5 s* 30 s 14 s 44 s 94 s
carddemo-readcust --sample 80 --seed 3, main 34 s 77 s 53 s 436 s 600 s
the same, this PR 6 s* 63 s 15 s 200 s 312 s

* The translate drop is equivalence_cache being warm, not this PR. It also means #8599's "skip re-translating" item is mostly covered already: a warm translate costs about 5 s.

On a dev box without the license env var, each tool start sleeps 5 s, three times per case (UPDCUST: 175 s instead of 141 s). CI already sets the variable.

Verification

  • Same-mode A/B against origin/main's mutation.py, same seed: 140 of 140 per-mutant verdicts identical (UPDCUST 60, CICS; readcust 80, batch, with faults, 5 stillborn and 1 timeout).
  • Not compared against --full: neither change alters how a mutant is judged.
  • pytest tests/tools/test_l5_speedups.py tests/tools/test_det_mutation.py tests/tools/test_mutation_bytes.py tests/tools/test_survivor_attack.py tests/cobol_mainframe/test_mutation_one_jvm_scope_4047.py tests/cobol_mainframe/test_mutation_scores.py tests/cobol_mainframe/test_mutation_tooling.py tests/cobol_mainframe/test_carddemo_cardlist_mutation_survivors_5401.py: 253 passed, 1 skipped.
  • New tests: source selection, a real javac compile against prebuilt runtime classes (session and fallback paths, constant inlining, stillborn still caught, manifest contents), the limit bounds, and the calibration tripwire.
  • test_compiles_only_file_passes_single_source_and_sourcepath became ..._program_sources_.... The old test pinned a single-file compile that missed constant inlining.
  • No new ruff findings in mutation.py (9 before, 9 after).

Type of change

  • Docs, tooling, or CI only

🤖 Generated with Claude Code

…oofs from the unmutated port (Part of #8599)

- mutation.mutant_sources: a mutant's javac check compiles the port's program files
  (every one: a mutated constant is inlined into its callers) against the baseline's
  compiled runtime, not the 51-file cobolrt copy as well. The overlay manifest lists
  only what was compiled (overlay adoption drops the baseline classes of every listed
  source; the fallback's single-file compile listed all of them).
- mutation.calibrate / direct_limit: each in-process worker first runs the unmutated
  port, which must survive (else the worker falls back to separate runs); 5 x the
  slowest such run, at least 30 s, at most the old limit, bounds an in-process proof.
  A looping mutant held its worker for 300 s or more (201 timeouts in the ledgers).

nyx, fast+one-jvm, --jobs 2: cbsa-updcust --sample 60 141 s -> 94 s (javac 41 -> 14 s);
carddemo-readcust --sample 80 600 s -> 312 s (javac 53 -> 15 s, the timeout 300 -> 61 s).
140 of 140 verdicts identical to origin/main in the same mode and seed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…TF-8 (test_java_subprocess_utf8 guard)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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