mutate: refuse oans.c and run_dedupe.c instead of reporting 0% killed on them - #240
Merged
Merged
Conversation
Re-copied from unordered_dense, where the change was made and where the hermetic suite covers it. This is the repository the bug was found in and the only one of the three that can hit it: src/tests.c #includes most of src/*.c into one translation unit but deliberately not oans.c or run_dedupe.c, and `make test-build` compiles only tests.c. Sweeping src/oans.c planned 1,394 mutants and would have scored every one `survived` - a 0% kill rate over 2,177 lines, reported as "whatever covers them is decoration". That reads as an indictment of the tests when nothing was ever measured, which is the flattering direction. Both files are now refused with a message that names the consequence rather than the condition. Verified here end to end: src/oans.c and src/run_dedupe.c refuse, src/util.c still sweeps and still returns real verdicts, and make mutation-replay is unchanged at 65 across eight files with nothing surviving. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GeJoYWWvf2ewg87ih8DpGJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vendored sync of martinus/unordered_dense#205, where the change was made and where the hermetic suite covers it. This is the repository the bug was found in, and the only one of the three that can hit it.
The problem
src/tests.c#includes most ofsrc/*.cinto a single translation unit, but deliberately notoans.corrun_dedupe.c— those belong to the shipped binary alone, andmake test-buildcompiles onlytests.c.So a mutant in either file never reaches
./test, and the tool scored itsurvived:A dry-run over the whole file planned 1,394 mutants, and every one of them would have come back the same way — a 0% kill rate over 2,177 lines, reported as a fact about the tests rather than about the invocation. That is the flattering direction, and CLAUDE.md's standing rule for this tool is that every way it has been wrong so far flattered the tests.
After
The message names the consequence rather than the condition, so the reader is not left to work out why "not compiled in" matters.
How it works
An
#erroris appended to the target and the build is run. If it still succeeds, nothing the test binary is made of ever included the file. Backend-agnostic on purpose: a compilation database can say which files are compiled, but not which are#included into something that is — and this repository's case is exactly the latter.Verified here, end to end
src/oans.candsrc/run_dedupe.c— refused.src/util.c— still sweeps, still returns real verdicts (delete: clock_gettime(...)survived, as it did before).make mutation-replay— unchanged at 65 across eight files, nothing surviving.make lint—lint-mutate-core: vendored at c71e0f7a106d, adapter fits.This is also the make backend, which is one of the two the upstream PR verified end to end (the other being cmake via nanobench; the meson leg is covered by the hermetic suite only, as meson is not installed on this machine).
Note
make lintwill fail until martinus/unordered_dense#205 lands, if it is checking the hash against upstream — themutate_core.sha256here is updated to match the new copy, which is the convention CLAUDE.md describes (change it there, run that suite, re-copy into all three, update each hash).🤖 Generated with Claude Code
https://claude.ai/code/session_01GeJoYWWvf2ewg87ih8DpGJ
Generated by Claude Code