Repository navigation
test(diff): pin the shape detectors, the structural index lines and the GNU roots - #3923
Merged
Merged
Conversation
KuSh
force-pushed
the
test/diff-mutation-gaps
branch
from
September 8, 2026 00:53
5a77caf to
551e26f
Compare
KuSh
force-pushed
the
test/diff-mutation-gaps
branch
from
September 8, 2026 01:20
551e26f to
a542d65
Compare
…he GNU roots Every fixture in the diff corpus is a real capture, so the shape detectors only ever see well-formed lines and nothing asserted what they reject. Loosening `&&` to `||` in `is_mbox_from` makes any `From `-prefixed line over 40 characters open an mbox message region, which ordinary commit prose reaches; the same loosening accepts a non-hex revision in `is_hg_echo` and a short or non-hex side of a `Submodule` range. None of those failed a test. git's `index` and `similarity index` lines are structure, not prose. Counting one as a dropped line costs nothing on a git-only stream, because nothing consults the drop until a GNU echo has been seen -- but a stream carrying both producers then bails to raw on a section that parses. Collapsing that prefix chain to a single term left every test green. The roots GNU diff was given were collected by the same eight lines inlined in two arms, and mutating either copy changed no output because no unit reached them directly. Extracted as `record_gnu_roots`, which makes the dedup and the non-empty guard assertable; both are now pinned. No behaviour change: byte-identical to develop across the 81 diff fixtures, 400 `git show` streams and GNU directory diffs over names holding `: ` and `'`. Also rewrites `condense_stdin`'s doc comment, which named a rejected alternative, described `guard::never_worse`'s signature from a file that does not call it, and repeated the ANSI-view clause carried by `condense_unified_diff_strict`'s own doc. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
KuSh
force-pushed
the
test/diff-mutation-gaps
branch
from
September 8, 2026 01:25
a542d65 to
a7cc787
Compare
Contributor
|
LGTM. Verified behaviour-preserving rather than taking the claim on trust: built the head and its merge base from the same tree and compared
Zero divergences. The corpus has proven power over the code you touched, not just coverage of it: mutating the |
aeppling
approved these changes
Sep 11, 2026
Merged
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.
A fresh mutation run against
develop(85 compiling mutants, 70 killed — 82%) putthe surviving gaps in three places. This pins all three, and factors out the one
that could not be tested where it stood.
The shape detectors reject nothing
Every fixture in the diff corpus is a real capture, so the detectors only ever see
well-formed lines. Loosening
&&to||:is_mbox_from— anyFrom-prefixed line over 40 characters opens an mboxmessage region. Ordinary commit prose reaches that shape.
is_hg_echo— a non-hex revision (diff -r zzzzzzzzzzzz …) reads as an hg echo.is_submodule_range— a short or non-hex side of a<hex>..<hex>range passes.None failed a test.
detectors_reject_near_missesis the near-miss table.git's
indexlines are structure, not proseCollapsing the
index/similarity index/dissimilarity indexchain to asingle term left every test green, because
dropped_lineis only consulted once aGNU echo has been seen — and no fixture carries both producers. A stream that does:
Safe (the fallback is raw) but a silent savings regression on a section that parses.
The GNU roots were collected twice
The same eight lines were inlined in the header-pair arm and again in the
Binary filesarm. Mutating either copy changed no output, because nothing reachesthat logic directly — the
Only insplit resolves through paths that do not dependon it. Extracted as
record_gnu_roots, which is the point of the factorisation:the dedup and the non-empty guard become assertable, and both are now pinned. A
third arm growing a third copy is no longer the default.
No behaviour change
Byte-identical to
developacross the 81 diff fixtures, 300 realgit showstreams, and GNU directory diffs over names holding
:and'. Each new test wasverified to fail against the mutation it exists for, and against nothing else.
Also rewrites
condense_stdin's doc comment, which named a rejected alternative,described
guard::never_worse's signature from a file that does not call it, andrepeated the ANSI-view clause already carried by
condense_unified_diff_strict'sown doc — per CONTRIBUTING.md's "No obvious comments".