Skip to content

test: kill the second wave of escaped mutants; exclude the equivalent ones - #1895

Merged
dekobon merged 42 commits into
mainfrom
fix/issue-1736-wave-2
Nov 13, 2026
Merged

dekobon merged 42 commits into
mainfrom
fix/issue-1736-wave-2

Conversation

@dekobon

@dekobon dekobon commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Second wave of work on #1736. It works through every mutant still open after #1881, from the fresh inventory of run 43278927651 (68b70b08: 213 missed, 3 timed out).

Refs #1736. This does not close it: 8 mutants wait on filed bugs and 21 on decisions that land in the next wave, and the close condition is a clean mutation-test.yml run on main.

What it does

Count
Mutants killed by new tests 82
Mutants excluded with the proof beside the entry 31 (29 equivalent or unreachable, 2 non-terminating)
Test-module mutants taken out of the selection 161
  • Tests in npm, npa, loc, abc, cognitive, halstead, nexits, nargs, dloc, spaces, ops, and in the ast crate's find, getter, checker, comment_rm and roles. Each was replayed against its mutants and the failing assertion read from the per-mutant log. Expected values are derived beside each fixture; where an interpreter was at hand they were checked against it (ruby 3.0.2, perl, bash, tclsh, rustc, javac, CPython's ast.parse, g++).
  • exclude_globs = ["**/*_tests.rs"]. cargo-mutants skips a module under a bare #[cfg(test)] and mutates one under #[cfg(all(test, …))]; the two derived_parity_tests.rs suites were 37 of the run's 213 missed.
  • One production change: refactor(abc) drops the init_declarator guard from the C and Objective-C impls. tree-sitter-c 0.24.2 and tree-sitter-objc 3.0.2 define the rule only with an =, so the guard was always true and cost a child scan. The root and ast suites pass with the corpus snapshots unchanged.
  • Shard count 16 to 18. Two shards of the run passed 200 minutes.
  • The guide says how to replay chosen mutants, how to write an exclude_re entry, and two traps met on the way (a ' in a name needs a '''…''' string; a config that does not parse prints an empty list).

Evidence

  • cargo mutants --list --no-config -e '**/*_tests.rs' against cargo mutants --list over the workflow's selection differs by exactly the 33 excluded mutants (31 from this wave, 2 from test(metrics): kill the first wave of escaped mutants and fix two Display lines #1881).
  • A fresh-context review tried to break every exclusion group and re-derived a sample of the tests. It found two PHP exclusions unsound (their mutants scan extra children) and two Rust ones unproved for recovery trees; all four were withdrawn in this branch.
  • make pre-commit: BCA_GATE: pass (gate=pre-commit) on the wave before those review fixes. After them: cargo fmt --check, clippy on both crates, the one changed test, and the Markdown, TOML and workflow lints (make actionlint, make mutation-workflow-test, make mutation-report-test).

Not done

  • make bench-scaling has not passed. It is owed for the guard removal. Its one attempt ran at a host load average near 50 and put 23 probes over bound, none in the C or Objective-C ABC family; the load has since risen. The change removes one child scan per initialised declarator and adds no work.
  • Eleven kills use sources their language rejects (Kotlin 2, Lua 1, Python 3, C# 3, Elixir 1, Perl 1). Each test says so and asserts the recovered tree shape before the value. They sit in commits of their own.

Left open

The full per-mutant record is in this gist.

…C impls

Both impls counted an `init_declarator` only when
`node.first_child(|id| id == EQ as u16)` found an `=`. tree-sitter-c
0.24.2 defines the rule as `declarator = value` and tree-sitter-objc
3.0.2 as `declarator [attribute] = value`, with no alias onto the kind,
so the guard was true for every such node and cost one heap-allocating
child scan each. The C++ grammar also spells `int x(5);` and `int x{5};`
as an `init_declarator`; its guard is live and stays.

The mutation run is what showed it: replacing the guard with `true`, or
its `==` with `!=`, passed the suite, and neither can be killed by a
metric value. Excluding the first would not be honest, since it skips
the scan `child_scan_cursors` counts. With the guard gone the two
`==` exclusions go too, and the config excludes two mutants.

No output moves: the root and ast suites pass, the corpus snapshots
included, and the merged arm's three mutants in each impl are caught.

Refs #1736
The selection's `roles/**/*.rs` and `src/metrics/**/*.rs` globs reach
two `derived_parity_tests.rs` files. cargo-mutants skips a module under
a bare `#[cfg(test)]`, and both are declared under
`#[cfg(all(test, any(feature = …)))]`, which it reads as ordinary code.
Run 43278927651 therefore mutated their helpers (`Census::record`,
`ChainProbe::probe`, `owner_positives`) and reported the survivors as
escapes in the classifier code: 20 of the 112 missed mutants in the
first eight shards to finish.

`exclude_globs = ["**/*_tests.rs"]` takes the 161 mutants of the two
files out of the list and nothing else: `--list` reads 5280 with the
config and 5443 without, the other two being the `exclude_re` entries.

Refs #1736
…eyword

`is_statement_of` decides which child of a wrapper the class-body walk
reads as a statement, and the walk reads a bare `public` / `private`
statement as the visibility marker. No fixture put a word spelled like
a marker anywhere a statement is not, so deleting the `if`, `case`,
`when` / `in`, loop or modifier arm, returning `true` outright, or
dropping the assignment guard all passed: eight of the function's
mutants, and one more on the frame test in `read_body`.

Three tests put the word in such a place: the target of a setter call
and of a `for`, a `case … in` pattern that binds a local, and a local
read in an `if` condition, a `case` value and a modifier's condition.
`public_class_method` gets a fixture where it moves a singleton back to
public; where it only restated the default, a walk that did not know
the word counted the same.

Every expected count was measured on ruby 3.0.2 and is derived beside
its fixture.

Refs #1736
…stant

- Ruby: an attribute whose name the walk cannot resolve takes the
  visibility of the keyword that wraps its declaration, not the flag in
  force. With resolvable names the keyword re-files the attribute
  afterwards and hides which one was read, so `governs` returning false
  and the inverted comparison in `ruby_wrapped_is_public` passed.
- Rust: `type Opaque;` in an `extern` block is the same node under the
  same `declaration_list` kind as a trait's associated type, and is not
  one. `rust_count_assoc_type` with `||` counted it.
- Kotlin: a destructuring `property_declaration` counts one attribute
  per binding. kotlinc rejects the form at class scope; the grammar
  accepts it and `kotlin_count_property_attrs` has an arm for it, which
  is what the test pins, and its comment says so.

Refs #1736
Each entry carries its proof. Two rest on the code alone: the
`RescueModifier` arm of `is_statement_of` answers what the fallthrough
answers, and `read_body`'s frame test with `&&` reaches the same
`child.is_named()` through `is_statement_of`. Five rest on a pinned
grammar: Kotlin's `property_declaration` holds exactly one declaration
node, PHP's `Member` row admits only kinds that hold no element of the
other bucket, and a Rust `const_item` or `static_item` under an `impl`
or `trait` can only sit in its `declaration_list`.

`cargo mutants --list --no-config -e '**/*_tests.rs'` against
`cargo mutants --list` over the workflow's selection differs by exactly
these seven and the two earlier entries.

The guide gains two notes from writing them: a name holding a `'` needs
a `'''…'''` string, and a config that does not parse prints an empty
list, which reads as everything excluded.

Refs #1736
…tant

Four mutants in the bare-row code survived the suite:

- `credit_bare_continuation_rows` skips a node with no children or too
  few rows. With `&&` for the `||` it scans a childless node that spans
  three rows, reading the node's own bytes as one gap. No fixture held a
  `\` row inside such a node that an arm did not already make code. A
  Ruby `=begin` … `=end` block does: the `\` row is comment text, and
  the mutant reports it as code.
- `RowShape::step` reads a byte before the `\` as padding only when it
  is horizontal space. With the guard `true`, a row holding code before
  its `\` reads as bare. Through `loc` this shows only on a lone CR
  before the `\` and on text an error recovery leaves in no node, both
  of which read blank today, so the test steps the shape directly on
  rows whose reading is not in doubt.
- `BareRowIndex::build` closes a last row that has no newline. With
  `==` or `>` for the `<` the row is never closed and `class` answers
  `None` for a bare `\` ending the file. No `loc` value shows it: the
  C-family grammars hold that `\` in an `ERROR` token, and for `\` + CR,
  which they leave in padding, the scan's fallback answers code as the
  index does. The test reads the index itself.

Refs #1736
`only_comments_after` decides whether the row a bare `\` row joins is
comment text to its end. Six of its mutants survived: returning `true`
outright, the three comparisons of the comment's end row against its
start row, and the sibling guard read as `true` or with `||`.

Every comment in the grammars that reach it runs to its row's end, so
the answer was `true` for every fixture. The one input on which it is
not is a comment token the lexer ends at a NUL byte, which the tree
follows with an `ERROR`. Two fixtures use it, and four of the six no
longer survive:

- Python, `\` / `# c` NUL: the joined row holds a token that is no
  comment, so the bare row is code. Returning `true`, and the end row
  read as `>=` or `==` the start row, read it as a comment. CPython
  rejects a NUL byte, so this pins the recovery reading only, as the
  table's `\` + NUL row does.
- Ruby, `\` / `=begin` / `=end` NUL: the comment runs past the row the
  bare row joins, so the bare row is a comment whatever follows `=end`.
  The end row read as `<` or `==` the start row goes on to the `ERROR`
  and reads code. Only `sloc` and `cloc` are asserted: `ruby` agrees
  with both, and reads the NUL as comment text where `ploc` counts its
  row as code.

The two guard mutants are left alive. Only a sibling after a NUL-cut
`#` comment tells them from the original, which the Bash, Ruby and
Elixir trees hold. bash 5.1 and ruby 3.0 read the NUL as comment text
(no Elixir was at hand), so the fixture would pin a value the
interpreter contradicts.

Refs #1736
Eight are equivalent and two never terminate; each entry carries its
reason.

Two of the equivalents rest on the code alone: `BareRowIndex::build`
with `<=` differs only for an empty last row, and the `>=` in
`add_cloc_lines` sits behind a test that already makes `diff` positive.
The other six rest on one fact about the grammars whose bare rows reach
the gap scan: a `comment` is a childless terminal that ends only before
a newline, a NUL or the end of the file. It was read from each pinned
lexer and backed by a differential run over generated sources, malformed
ones included.

The two timeouts from run 43278927651 are loops that stop making
progress: `comment_spans` re-reads the same node, and
`past_line_padding` is sent back to the start of the source.

`opens_comment_only_line` has a live `==` beside the equivalent one, so
that entry keeps the column. The list differs from the unconfigured one
by exactly these ten and the nine earlier entries.

Refs #1736
…ring

`python_backslash_after_bare_string` records the deepest level, on the
descent from the run's previous sibling to the bare string statement,
that has a token before its node, and `python_code_before_string` reads
that token. Three mutants of its `child_count() > 1` test survived the
full mutation run at 68b70b0: `>` replaced by `<`, by `==` and by `>=`
(src/metrics/loc/python.rs:561:34).

No fixture put code on a level of that descent. Each one had the code
beside the statement or the run (`x=1; """doc""" \`), or left the
compound statement's header on a row of its own, where the answer is
"no code" whether or not the level is read.

The new fixtures put the docstring on its header's row
(`if x: """doc""" \`) and after `pass;` inside the block. The first has
a one-child `block`, so it sits exactly on the `>` / `>=` boundary.

Refs #1736
Deleting the string arm survived the full mutation run at 68b70b0 in
five `Loc` impls: Java and Groovy (`string_literal`), Rust
(`string_literal | raw_string_literal`), TypeScript and TSX
(`template_string`).

`multiline_string_ploc_consistent_across_languages` has no row for any
of them, and their other fixtures hold literals of one or two rows,
which the opening and closing tokens credit without the arm.

Each new test mirrors that table's shape: a three-row literal whose
interior row is empty, so only the arm credits it. A Java text block
opens with a line terminator and is one row longer. Rust and Groovy
assert both spellings their arm routes.

Refs #1736
Two mutants survived the full mutation run at 68b70b0.

src/metrics/loc/mozcpp.rs:58:43 replaces `==` with `!=` in the stop
predicate of the for-header gate. Mozcpp owns no file extension, so no
C++ fixture routes to its copy of the gate, and no test named
`MozcppParser` with a declaration in a `for` header.

src/metrics/loc/groovy.rs:61:36 replaces the bare-`Closure` guard with
`false`. The grammar now parses an `else { … }` branch as a `block`, so
`groovy_general_loc`, which was written for that shape, no longer
reaches the carve-out. A labelled block still parses as
`expression_statement (closure)` and is the new fixture.

Refs #1736
`compute_go_args` counts the `identifier` children of each
`parameter_declaration`. Replacing `==` with `!=` in that filter
(src/metrics/nargs.rs:479:41) survived the full mutation run at
68b70b0.

No fixture told the two counts apart: a declaration holds as many
names as other children (`a, b int` is two names, one comma and one
type), and an unnamed parameter reads 1 through `.max(1)` either way.
A comment inside the declaration is a child that is neither a name nor
a parameter, so the new fixture holds two.

Refs #1736
Three mutants survived the full mutation run at 68b70b0.

src/metrics/loc/lua.rs:46:20 replaces the comment-parent guard of the
`[[` / `]]` arm with `true`. No valid Lua shows that guard: in a
well-formed `string` both bracket rows are credited by the string's arm
or its parent, whatever the bracket arm does.

src/metrics/loc/python.rs:475:17 replaces `&&` with `||` in
`python_past_string_parentheses`, and python.rs:675:17 does the same in
`python_code_among`. Both tell a bare string's own parenthesis from any
other, and in source that parses cleanly every parenthesis around a
bare string is its own.

The fixtures are recovery shapes: a stray `]]` that tree-sitter-lua
leaves as a child of an `ERROR`, and Python parentheses that hold an
`ERROR` before the string and so are not the string's. Each test
asserts the recovered shape first, so a grammar bump that recovers
differently fails as "fixture drift" rather than as a wrong number.
The expected rows follow the documented reading (a token outside a
comment is code; a parenthesis that is not the string's is code), not
a language rule.

Not pinned: python.rs:475:17 also differs where a lone CR sits between
the bare run and the string's `)`. CPython reads that CR as a line
break and the source as one docstring statement, and there the mutant
gives the comment rows and the original one code row.

Refs #1736
`FunctionPopulation::fold` and `merge` each compare a candidate with
the running minimum and maximum; `<=` and `>=` differ from `<` and `>`
only when the two are equal, and then pick the other of two equal
values. No population can hold the one distinguishable pair, a
negative and a positive zero.

`classify_python_run`'s guard reads a constant that is false, so
replacing it with `false` changes nothing.

The configured list differs from the unconfigured one by exactly these
five and the nineteen earlier entries.

Refs #1736
One mutant survived the full mutation run at 68b70b0.

src/metrics/abc/cpp.rs:69:36 replaces the `operator_is(&["="])` guard
of `cpp_wrapper_operand` with `true`, so a compound assignment is
peeled to its right-hand side as a plain `=` is. No fixture put a
compound assignment whose right-hand side scores itself in a condition
slot: `if (y += 1)` pays one condition peeled or not, and the rows of
`slot_pays_tests.rs` hold `y += 1` and `y = b > 1` but not their cross.

`if (y += x > 1)` is that cross. The slot tests the updated `y`, so it
pays beside the `>`; under the mutant only the `>` pays.

Refs #1736
Two mutants survived the full mutation run at 68b70b0.

src/metrics/abc/csharp.rs:101:35 replaces the `is_child(BANG)` guard of
the `postfix_unary_expression` arm with `false`, so `x!` is no longer
peeled. The existing null-forgiving fixtures wrap an operand that does
not score itself, which pays one condition whether the slot sees the
operand or the node around it. `(p ? a : b)!` and `(a == b)!` wrap
operands that score themselves, and the slot holding them must not pay
again.

csharp.rs:656:14 replaces the `ternary::owns_kind` guard of
`csharp_walk_for_conditions` with `true`, so every node that reaches
the arm has its `condition`, `consequence` and `alternative` fields
read as ternary slots. The only other kinds that declare those fields
and reach the arm are the preprocessor directives, and no fixture held
a directive whose condition does not score itself: `#if DEBUG` and
`#elif TRACE` gain a condition each under the mutant.

The C# fixtures were not compiled.

Refs #1736
Two mutants survived the full mutation run at 68b70b0.

src/metrics/abc/tcl.rs:153:18 and src/metrics/abc/irules.rs:48:18
replace the `!child.is_named()` guard of the two `*_ternary_slots`
functions with `false`, so the anonymous `(` and `)` the grammars
inline under `ternary_expr` are read as operands. The existing
fixtures parenthesise a bare `$a` condition, and a `)` in the condition
slot pays one condition exactly as `$a` does.

The new rows put an operand that scores differently from a token in
one slot at a time: a parenthesised comparison in the condition, and a
parenthesised negation in each branch. Both grammars were dumped.

Refs #1736
One mutant survived the full mutation run at 68b70b0.

src/metrics/abc/rust.rs:62:32 replaces the `!node.is_child(SEMI)` guard
of `rust_transparent_operand` with `true`, so an expression statement
that ends in `;` is peeled to its expression. No fixture ended a block
in a statement: `m({ !a; })` passes `()`, and the mutant scores the
discarded negation as the argument.

Refs #1736
Seven mutants survived the full mutation run at 68b70b0.

src/metrics/cognitive/lua.rs:75:18 and perl.rs:146:18 replace the
`closure::owns_kind` guard with `false`, and lua.rs:76:32 and
perl.rs:147:32 turn the `nesting.lambda += 1` beside it into `*=`. No
Lua or Perl fixture held control flow inside an anonymous function.
Each new fixture nests a closure in a closure, so the level is added
to a non-zero one.

elixir.rs:186:27 replaces the `target.is_method_macro()` guard with
`false` and with `true`. No fixture showed the reset a `def` applies,
which needs a `def` under a construct that raises the nesting, and none
put control flow in an ordinary call's arguments. A `def` under a
compile-time `if` shows the reset; an `if` in a call's argument shows
that a call is no boundary.

python.rs:227:13 deletes the arm that resets the boolean sequence at an
expression list, an expression statement or a tuple. The reset shows
only where a like operator encloses the container, which no fixture
wrote: `a and (b and c, d)` and `a and (yield b and c, d)`. An
expression statement cannot sit inside a boolean operator, so that
third of the arm stays without a fixture.

Refs #1736
One mutant survived the full mutation run at 68b70b0.

src/metrics/cognitive/bash.rs:57:38 replaces `&&` with `||` in the
filter of `bash_jump_with_level`, which then admits every child after
the word. A trailing comment is no child of the command, so the two
differ only for an argument the grammar spells as an anonymous token:
a bare `$`. The builtin rejects `break $` at run time; with `break`
defined as a function, as the neighbouring test does, the line is a
call Bash 5.1 runs. It writes no level and scores nothing.

Refs #1736
Three mutants survived the full mutation run at 68b70b0.

src/metrics/abc/csharp.rs:530:16 replaces the parent guard of the bare
`?` arm with `false`, and csharp.rs:540:30 turns the arm's
`stats.conditions += 1.` into `*=` and into `-=`. tree-sitter-c-sharp
0.23.5 spells `?` in four productions, all on the arm's deny list, so
no valid C# reaches it.

The fixture is a recovery shape: `int z = a ? ;` leaves the `?` as the
only child of an `ERROR`. The test asserts that shape first, so a
grammar bump that recovers differently fails as fixture drift rather
than as a wrong number. Two comparisons precede the `?`, so the arm
fires on a running count of 2. The expected value is what the arm has
always paid, not a language rule.

Refs #1736
Replacing `ternary::owns_kind(…)` with `true` in the last arm of the
two ABC condition walks hands every remaining node to the ternary walk,
which reads three grammar fields and does nothing when none is present.
In both pinned grammars every other kind that carries those fields is a
branch, guard or loop kind an earlier arm of the same match takes, so
no node reaches the walk with a field to read.

The configured list differs from the unconfigured one by exactly these
two and the twenty-four earlier entries.

Refs #1736
Two mutants survived the full mutation run at 68b70b0.

big-code-analysis-ast/src/roles/go.rs:75:63 turns the `&&` of
`calls_panic` into `||`, so any call of a bare identifier is an exit.
Every Go fixture called `panic`, a selector, or nothing.

big-code-analysis-ast/src/roles/ruby.rs:67:53 turns the `&&` of
`kernel_raise_or_exit`'s receiver test into `||`, so any constant
receiver is read as `Kernel`. The fixtures spelled only lowercase
receivers and `self`.

Each new fixture holds two calls the gate must decline beside one it
admits, so the expected sum is 1 and the mutant's is 3.

Refs #1736
One mutant survived the full mutation run at 68b70b0 (there at
roles/java.rs:86:9): deleting the `Java::SpreadParameter` arm of
`java_parameter_type`, which makes a variable-arity parameter no
parameter at all.

Every variable-arity record of
`java_canonical_constructor_is_told_by_its_types` has it as its only
component, so the mutant compared an empty component list there and
gave the same verdicts. The new records differ from their constructors
by the variable-arity parameter alone: one constructor stops short of
it, one runs past the components with it, one spells another element
type. Each is an alternative, so the header opens beside it; under the
mutant each reads as canonical. javac 25 accepts the fixture.

Refs #1736
Four mutants in big-code-analysis-ast/src/getter/perl.rs survived the
full mutation run at 68b70b0.

315:39 (`+` to `*`, and to `-`) and 317:69 (`||` to `&&`) are in
`get_operand_id`'s file-test arm. Each makes the word after the sign
empty, so a `-bareword` key that parses as a file test is keyed as `-`
alone. `DASH_KEY_ROWS` pairs such a key only with itself or with a
plain word, and one distinct entry is one entry under any spelling.
The new rows hold two different keys: two word forms in one list, two
exact file tests in two lists.

348:13 deletes the `Perl::LBRACK` arm of `get_operator_id_as_str`, so
`[` lists as `[` and not as the `[]` pair. No `check_ops` fixture held
a square bracket, and the counts key the operator by kind.

Refs #1736
One mutant survived the full mutation run at 68b70b0:
big-code-analysis-ast/src/getter/php.rs:316:56 turns
`kind == HeredocBody && c.wraps_any(..)` into `||`, so a heredoc is
skipped as interpolating for merely having a body.

The suite held an interpolating heredoc and a nowdoc, and no heredoc
whose body is plain text. That one has a `heredoc_body` child too, and
is one operand.

Refs #1736
Two mutants survive, one from the full mutation run at 68b70b0 and one
that replaced a listed mutant when its function was rewritten.

big-code-analysis-ast/src/roles/kotlin.rs:42:71 turns the second `||`
of `modifier_was_written_as_one` into `&&`, so the climb to the host
stops at a `type_modifiers` list. The rows of
`kotlin_modifiers_are_operators_1558` strand the bare leaf or a
`*_modifier` wrapper under an `ERROR`, never that list. A function
named `suspend`, called or declared, does: both are valid Kotlin that
kotlin-ng fails to parse, and the mutant bills the name as a modifier.

big-code-analysis-ast/src/getter/kotlin.rs:82:60 turns the `&&` of
`kotlin_is_short_interp_name`'s previous-sibling test into `||`. The
run listed it at 73:56 as `||` to `&&`, before eeb69b7 rewrote the
early returns as one conjunction; it is the same change to the same
test. kotlin-ng splits `"\uCAFE"` into the `string_content`
tokens `\u` and `CAFE`, so the mutant reads the hex digits as a `$name`.

Refs #1736
Five mutants survived the full mutation run at 68b70b0, each in a
reading whose answer the walk composes with another that masks it. No
metric fixture can separate them, so each is asked directly, as the
control-keyword tests in this module already ask `get_paying_role` and
the byte-less `get_op_type`.

getter/elixir.rs:147:13 and 148:13 turn a `||` of `get_paying_role`
into `&&`, so the `Comparison` or the `ShortCircuit` row stops billing
its applied tokens. The byte-less arm lists the same tokens for the
spellings the rows' gate leaves out, and bills them when the rows
decline.

getter/java.rs:152:22 makes the byte-less arm call every `class` token
an operand, and getter/perl.rs:377:16 makes it call every `and` token
one. On the walk the `DeclKeyword` row and the `ShortCircuit` row
answer first for the declaration's `class` and the applied `and`, so
the arm only sees the tokens its guard admits.

getter.rs:1185:9 makes the trait's default `get_operator_id_as_str`
return "xyzzy". Only `ccomment` and `preproc` inherit it, and their
Halstead `compute` records no operator for `ops` to name.

Refs #1736
One mutant survived the full mutation run at 68b70b0:
big-code-analysis-ast/src/roles/rust.rs:57:5 makes `has_guard` answer
`true`, so every `match_pattern` owns a guard.

The one consumer that reads the owner, ABC's `rust_count_match_arm`,
reads the pattern's `condition` field again beside it and scores
nothing where the field is absent, so no metric fixture can separate
the two. The row is asked directly: of three patterns it owns the one
that carries a condition.

Refs #1736
Two mutants survived the full mutation run at 68b70b0, each on the
branch of a parent guard that the pinned grammar reaches only through
error recovery.

getter/elixir.rs:214:25 makes every `:` leaf a quoted atom's.
tree-sitter-elixir 0.3.5 emits a standalone `:` only inside a
`quoted_atom`; `b = [:"q]` strands one under an `ERROR`.

getter/perl.rs:50:20 makes every `/` a bare pattern's delimiter.
tree-sitter-perl 1.1.2 spells `/` only in `pattern_matcher`;
`$s =~ /abc` strands the opening one under an `ERROR`.

Each language rejects its fixture. The tests pin what the arms have
always done there, not a language contract, and assert the recovered
shape first, so a grammar bump that recovers differently fails as
fixture drift rather than as a wrong number. Kept apart from the other
tests of this issue so the commit can be dropped if these arms are
excluded instead.

The Groovy `super` arm has the same shape and is left alone: the
getter's comment and `groovy_wildcard_super_bound_stays_an_operator`
say it is deliberately untested.

Refs #1736
…erwise

- `get_space_kind_with_code` for Ccomment and Preproc forwards to a
  role table with no opener, so it answers `Unknown`, the default.
- `kinds_repeat`'s outer loop with `<=` makes one more pass that
  indexes nothing. Its inner loop has a live `<` too, so the entry
  keeps the column.
- `kotlin_short_interp_operand_bytes` is reached only where its
  caller has already found a leading identifier, so the length it
  compares with 0 is never 0.

The configured list differs from the unconfigured one by exactly these
four and the twenty-six earlier entries.

Refs #1736
Two mutants survived the full mutation run at 68b70b0. checker.rs:773:9
makes `Checker::is_error` answer `true`, and its twin makes it answer
`false`. No language overrides the method, and its one caller is the
`error` arm of `ParserTrait::filters`, which no test in either crate
asked.

The test asks `find` and `count` for `error` on a source that parses
cleanly, where nothing matches, and on one that does not, where the
matches are the `ERROR` and each of its ancestors, root first.

The second source is one rustc rejects, by necessity: a tree with no
parse error gives the filter nothing to match. The test asserts the
recovered shape first, so a grammar bump that recovers differently
fails as fixture drift rather than as a wrong count.

Refs #1736
checker.rs:345:58 turns the `<` of `SubtreeSkip::answers_for` into
`<=` and survived the full mutation run at 68b70b0. A verdict then
also answers for every node that starts on the byte it names, where
`covering_through_node` means to add one node only, the run's item.

No walk over a clean parse shows the difference. The other nodes on
that byte are the item's own leading descendants. The pinned grammar
puts no prunable item there, and an attribute only at the head of a
match arm or a field initializer, where it decorates nothing the prune
removes. The hook retains each of them whether it is asked or not.

So the reach is asked directly, on `#[inline]` above a `fn`: the
verdict answers for the attribute's descendants and for the
`function_item`, and not for the `fn` keyword on the same byte.

Refs #1736
The `exclude_tests` walk is the consumer of `SubtreeSkip::answers_for`,
and it shows the `<` that checker.rs:345:58 mutates only on a recovery
tree. `struct S` with no `;` above a `///` row and a module holding
`#![cfg(test)]` recovers as a `struct_item` that keeps the doc comment
and ends in an invented zero-width `;`. The doc comment's run ends at
that `;`, on the byte where the module starts. With `<=` the run's
`RETAIN` answered for the module as well, and its test code stayed.

rustc rejects the fixture. The test pins what the prune does there and
asserts the recovered shape first, so a grammar bump that recovers
differently fails as fixture drift rather than as a wrong count. Kept
apart from the direct test of the reach so this commit can be dropped
if recovery input is not to be pinned.

Refs #1736
checker/groovy.rs:93:9 makes `GroovyCode::is_primitive` answer `true`
for every node and survived the full mutation run at 68b70b0. The one
test that asked it,
`groovy_text_keyed_operators_are_the_primitives_1599`, asks it of the
names `list` and `String`, where `true` is the answer.

The method has no caller outside tests: Halstead reads Groovy's
`Primitive` row through `keys_operator_by_text`, which `GroovyCode`
overrides, and the trait's default of that method is the only caller
of `is_primitive`. So it is asked directly on every node of a small
class, as `byte_less_is_primitive_is_the_rows_kind_table` asks the
eight other languages that override it: `true` for the three names,
`false` for the ten other nodes.

Refs #1736
Two mutants survived the full mutation run at 68b70b0, both in
`PythonCode::is_useful_comment`: checker/python.rs:14:9 makes it answer
`false`, and 14:26 turns `start_row() <= 1` into `> 1`. No test
asserted that a `coding` comment on the first or second line survives
`rm_comments`.

The test strips two sources and compares the whole output. The
declaration stays on the first line of one and on the second line of
the other. A trailing comment, a shebang and the same `coding` words on
the third line go.

Refs #1736
Four mutants survived the full mutation run at 68b70b0, in three
readings the `dloc` tables did not reach.

checker/groovy.rs:53:17 turns `is_func_with_code || is_closure` into
`&&` in `holds_doc_comment_in_body`, so neither a callable nor a
closure holds a doc comment. Every in-body fixture sat in a `block`,
which the `DocBodyResidual` row holds by itself. The new rows put the
comment in a closure's body and in a parameter's default value, where
no `block` encloses it.

checker/lua.rs:30:60 and 30:63 change what `lua_block_text` counts as
text: any byte at all, or a whitespace byte. Every empty block in the
fixtures was a row of dashes, whose body is empty either way. The new
rows are a `---` row holding one space and a `---F.` row with no
whitespace.

checker/php.rs:38:47 makes `php_file_docblock` stop at the first node
after the DocBlock, a `declare` or a plain comment included. The
fixtures put a non-element or a second DocBlock after such a node,
where stopping there answers the same. The new rows put the file's
first class and its first function after one.

Refs #1736
…ches

The trait defaults of `is_comment`, `is_call` and `is_string` run for
no language: all twenty-five impls define them through the row macros,
and the only inheritors are two test probes that call no `Checker`
method. The Ccomment and Preproc `is_func_space_with_code` and
`is_func_with_code` read tables with no opener and no callable, so they
answer `false` before the mutant does.

The configured list differs from the unconfigured one by exactly these
seven and the thirty earlier entries.

The nine `is_non_arg` mutants (the trait default and the Bash, Go,
iRules, Lua and Tcl overrides) are unreachable too and are left out
here: C# removed its unused override rather than keep it, and whether
these follow is a decision for the code, not for this file. So is
`rust_attribute_run_member`'s second `||`, which is equivalent while
the two Rust comment rows list the same kinds but shares its line-free
name and its column with a live mutant one line above.

Refs #1736
Run 43278927651 put sixteen shards of 341 mutants through in 125 to
222 minutes, two of them past the 200 minutes the guide gives as the
point to raise the count; the step timeout is 270. Eighteen holds about
292 of the 5249 mutants the list has once the test modules and the
excluded mutants are out, roughly 190 minutes at that run's slowest
rate of 39 seconds per mutant.

The guide's sizing paragraph now states the current count and what it
rests on. The derivation of the earlier sixteen (5048 mutants at
7008fdb3, 316 per shard, 165 minutes, against 190 for fourteen) leaves
the page with it and stays in the history of this file.

`make actionlint`, `make mutation-workflow-test` and
`make mutation-report-test` pass.

Refs #1736
- The two `&&` to `||` mutants in PHP's `Npa::compute` change no count,
  but each admits more members into its filter and scans their
  children, which `child_scan_cursors` observes. That is not the
  identical behaviour this file asks for.
- The two guard mutants in `rust_count_assoc_const` were proved for
  the grammar's productions only. A `const_item` under an `ERROR` that
  is itself a direct child of an `impl_item` would separate them, and
  no one has shown recovery cannot build that.

All four are open again on the issue. The `read_body` entry's comment
named a `call` where the frame holds an argument list.

The configured list now differs from the unconfigured one by exactly
thirty-three mutants.

Refs #1736
`python_bare_row_joining_a_comment_a_nul_cuts_short_is_code` pins a
reading of a source CPython rejects. Like the other recovery fixtures
it now checks the tree first: the comment ends at the NUL and an
`ERROR` follows, so a grammar bump that recovers differently fails as
fixture drift and not as a wrong row count.

Refs #1736
`is_statement_of`'s comment said no fixture pins its exclusions, since
any that told the arms apart would be one the walk reads wrongly.
Three shapes do tell them apart with Ruby's own answer, and `npm.rs`
now pins them; the comment names them and keeps the gap it describes
for the rest.

The test for the default `get_operator_id_as_str` called Ccomment and
Preproc languages whose rows are all `absent`. Each declares a
`Comment` and a `StringLit` row; what they lack is an operator row.

Refs #1736
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.65714% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.52%. Comparing base (d42487b) to head (ab731b0).
⚠️ Report is 42 commits behind head on main.

Files with missing lines Patch % Lines
src/metrics/loc.rs 99.11% 1 Missing and 1 partial ⚠️
big-code-analysis-ast/src/find.rs 96.15% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1895      +/-   ##
==========================================
+ Coverage   98.49%   98.52%   +0.03%     
==========================================
  Files         405      405              
  Lines      124773   125640     +867     
  Branches   124338   125205     +867     
==========================================
+ Hits       122897   123790     +893     
+ Misses       1151     1128      -23     
+ Partials      725      722       -3     
Flag Coverage Δ
python 100.00% <ø> (ø)
rust 98.52% <99.65%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
big-code-analysis-ast/src/checker.rs 97.32% <100.00%> (+0.27%) ⬆️
big-code-analysis-ast/src/comment_rm.rs 95.86% <100.00%> (+0.37%) ⬆️
big-code-analysis-ast/src/getter.rs 95.08% <100.00%> (+0.86%) ⬆️
big-code-analysis-ast/src/roles/rust.rs 100.00% <100.00%> (ø)
src/metrics/abc.rs 99.88% <100.00%> (+<0.01%) ⬆️
src/metrics/abc/c.rs 98.11% <100.00%> (-0.11%) ⬇️
src/metrics/abc/objc.rs 98.27% <100.00%> (-0.09%) ⬇️
src/metrics/cognitive.rs 99.91% <100.00%> (+<0.01%) ⬆️
src/metrics/halstead.rs 99.37% <100.00%> (+<0.01%) ⬆️
src/metrics/loc/dloc.rs 99.72% <100.00%> (+<0.01%) ⬆️
... and 8 more

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch was previously deployed

1 inactive deployment
github-pages — ab731b0a Deployed Nov 13, 2026 by dekobon via deploy to GitHub Pages #1065
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