Skip to content

Stop scoring rejected mutants as semantically identical - #44

Merged
seanwevans merged 1 commit into
claude/compiler-fence-wasm-ll1hkmfrom
claude/semantics-metric-holes
Sep 3, 2026
Merged

seanwevans merged 1 commit into
claude/compiler-fence-wasm-ll1hkmfrom
claude/semantics-metric-holes

Conversation

@seanwevans

Copy link
Copy Markdown
Owner

Stacked on #43. Base is claude/compiler-fence-wasm-ll1hkm, so the diff shown here is just this commit. Merge #43 first and this retargets to main cleanly.

Problem

continuous_semantics_profile caught the ValueError from structural_decompress and recorded a distance of zero. A mutation the front end refuses to compile was therefore indistinguishable from a mutation that changed nothing — the measurement had holes exactly where the interesting boundary cases live.

Before, on "{ad}":

'{' -> '|'  total=4
'a' -> 'b'  total=2
'd' -> 'e'  total=2
'}' -> '~'  total=0    <- unbalances the brace, scored as identical

Change

  • A rejected mutant scores the rejection distance: every instruction of the base program counted as deleted, floored at 1 so an empty base program cannot collapse the score back to zero.
  • Every profile entry now carries an explicit compiles flag, so callers can separate "identical" from "uncompilable" instead of inferring it from the presence of error.

After, on "(ad)" mutated toward a grade violation:

'(' -> 'c'  total=5  compiles=True
'a' -> 'c'  total=2  compiles=False
'd' -> 'c'  total=2  compiles=False
')' -> 'c'  total=2  compiles=False

#43 removes the fence-imbalance rejections, so the remaining rejection path is the grade-fence violation, which the new tests exercise directly.

Tests

Four added: rejected mutants are never distance zero, every entry carries compiles, the floor holds for an empty base program, and brace-unbalancing mutations now produce real distances.

The CLI reads only the distance keys, so its output is unaffected apart from the corrected numbers.

🤖 Generated with Claude Code

https://claude.ai/code/session_01K7BqQpyspK2owRy6g6SFxw


Generated by Claude Code

continuous_semantics_profile caught the ValueError raised by
structural_decompress and recorded a distance of zero, so a mutation the
front end refuses to compile was indistinguishable from a mutation that
changed nothing. The measurement had holes exactly where the interesting
boundary cases live.

A rejected mutant now scores the rejection distance: every instruction of
the base program counted as deleted, floored at 1 so an empty base program
cannot collapse the score back to zero. Every profile entry also carries an
explicit `compiles` flag, so callers can separate "identical" from
"uncompilable" instead of inferring it from the presence of `error`.

The preceding commit removed the fence-imbalance ValueErrors, so the
remaining rejection path is the grade-fence violation, which the added tests
exercise directly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7BqQpyspK2owRy6g6SFxw
@seanwevans
seanwevans merged commit 9310076 into claude/compiler-fence-wasm-ll1hkm Sep 3, 2026
2 checks passed
@seanwevans
seanwevans deleted the claude/semantics-metric-holes branch September 3, 2026 17:58
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.

2 participants