Skip to content

refactor(checker): remove five unused is_non_arg overrides; exclude the decided mutants - #1899

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

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

Conversation

@dekobon

@dekobon dekobon commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Third wave of work on #1736. It applies the decisions recorded there for the 21 mutants wave 2 (#1895) left open.

Refs #1736. This does not close it: 8 mutants wait on #1885, #1886, #1887, #1889 and #1890, and the close condition is a clean mutation-test.yml run on main.

Commits

Commit What it does
refactor(checker) Removes the is_non_arg overrides of Bash, Go, iRules, Lua and Tcl. count_args in nargs.rs is the one caller, and none of the five reaches it: four count their parameters themselves, and Bash has no parameters field for the default NArgs::compute to find. Each override now reads as a comment, as checker/csharp.rs has since its own was removed
ci(mutation) Thirteen exclusions, and the config header and the guide now name the five kinds of entry

The thirteen exclusions

Kind Mutants
Unreachable the is_non_arg trait default, now that no language inheriting it reaches count_args
Same output, different work, with the work named the Python loc parenthesis guard and the Go cognitive callable guard (one memo probe fewer); Rust has_doc_marker_child with >= and the two && in PHP's Npa::compute (one child scan more)
Separated only by source the language rejects, where the code says the branch is unpinned on purpose the C# ++ peel guard; the guard and the arm for a Groovy super outside a wildcard
Equivalent on stated evidence, not proved the Perl ParenthesizedArgument arm; the two parent guards in rust_count_assoc_const; rust_attribute_run_member's second `

The last one shares its name and its column with a live mutant on the line above, so its pattern keeps the line (checker.rs:1105:9) and its comment says to check it whenever that line moves.

Evidence

  • cargo mutants --list --no-config -e '**/*_tests.rs' against cargo mutants --list over the workflow's selection differs by exactly 46 mutants: these thirteen and the 33 already on main. The mutants of the five removed overrides are gone from the list.
  • No behaviour can change in the refactor, since the removed code never ran. The root and ast suites pass, the corpus snapshots included.
  • make pre-commit: BCA_GATE: pass (gate=pre-commit) on this tree.

Not done

make bench-scaling, which the project asks for after a change to a Checker, has not been run to a meaningful result: the host's load average has been between 50 and 90 throughout. The change removes code that was never called.

`Checker::is_non_arg` has one caller, `count_args` in `nargs.rs`, and
five languages overrode it without ever reaching that caller:

- Go, Lua, Tcl and iRules implement `NArgs::compute` themselves and
  count their parameters by positive match (`compute_go_args` and its
  siblings); Lua's override said as much in a note.
- Bash takes the default `NArgs::compute`, which looks for a
  `parameters` field tree-sitter-bash 0.25.1 does not have.

Each override now reads as a comment, as `checker/csharp.rs` has done
since its own was removed, and the trait's default `false` stands. The
mutation run is what showed them: replacing any of the bodies with a
constant passed both suites, because nothing ran them.

No behaviour can change. The root and ast suites pass, the corpus
snapshots included.

Refs #1736
…1736

The config's header now names five kinds of entry, and the guide says
the same. Beside the three it had (equivalent, unreachable,
non-terminating):

- same output, different work, with the work named. Five mutants: the
  Python `loc` parenthesis guard and the Go `cognitive` callable guard
  skip a memo probe; Rust's `has_doc_marker_child` with `>=` and the two
  `&&` in PHP's `Npa::compute` add a child scan.
- separated only by source the language rejects, where the code says
  the branch is unpinned on purpose. Three mutants: the C# `++` peel
  guard, and the guard and arm for a Groovy `super` outside a wildcard.

Four more rest on evidence and say so: the Perl `ParenthesizedArgument`
arm (no difference across generated sources; parse table not read), the
two parent guards in `rust_count_assoc_const` (proved for the grammar's
productions, not for recovery trees), and `rust_attribute_run_member`'s
second `||`, equivalent while the two Rust comment rows list the same
kinds. That last one shares its name and its column with a live mutant
on the line above, so its pattern keeps the line and the comment says
when to check it again.

The thirteenth is the `is_non_arg` trait default, unreachable now that
no language which inherits it reaches `count_args`.

The configured list differs from the unconfigured one by exactly
forty-six mutants.

Refs #1736
@dekobon
dekobon merged commit 3fd38e5 into main Nov 13, 2026
54 checks passed

This branch was previously deployed

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