with one click
minimise
// Prune a bug fix or new tests down to the smallest correct diff through multiple elimination passes. Use before committing any fix or test addition.
// Prune a bug fix or new tests down to the smallest correct diff through multiple elimination passes. Use before committing any fix or test addition.
Scrutinise newly added or changed code on the current branch against main. Checks new types, methods, changed signatures, overloads, and helpers for necessity, correctness, clarity, consistency, robustness, and minimality. Reviews new tests for gap coverage, overlap with existing tests, minimality, and use of established testing patterns. Invoke with /scrutinise.
Inspect the AD pipeline IR for a Julia function at each Mooncake compilation stage.
| name | minimise |
| description | Prune a bug fix or new tests down to the smallest correct diff through multiple elimination passes. Use before committing any fix or test addition. |
The goal is to remove every line that is not strictly required for correctness, then verify the result still passes the relevant tests.
Repeat the following until no further reductions are possible:
Read the diff. Run git diff HEAD (or git diff --cached if staged) and
read every changed file in full.
Challenge each change. For every changed line ask:
Remove non-essential changes. Delete anything that does not answer "yes" to the first question above. Prefer shrinking an existing case over adding a new one.
Run the minimal test group. Use the smallest focused test group that
exercises the changed code (see test/runtests.jl for group names).
Confirm all tests pass before continuing.
Repeat from step 1 until a full pass produces no further removals.
@testset is better than a new @testset.src/test_resources.jl should be the minimum needed
to instantiate the type under test; no extra fields or variants.Stop when every remaining line answers "yes" to: if I remove this, the targeted bug reappears or the targeted test fails. At that point report the final diff and suggest committing.