2 test runs tell crux whether a flip exists. 8 more find it in a 100 commit range. Start in a repository where something regressed, with a command that checks the behavior & a range that contains the break.

$crux who -c "cargo test --quiet" -f HEAD~20..HEADcopied

what happens

crux reads the commit list, checks out the newest commit, runs your command, and records the result. Same at the oldest commit. If both ends agree, there's nothing to find and it says so immediately, having spent exactly 2 runs. If they disagree, it checks out the middle, runs again, and throws away the half that can't contain the flip. Repeat until 1 commit remains.

the search window narrowing over a 200 commit history, red bar marking each probe, converging in 8 probes

The flip isn't the end of it. crux collects suspects: every file changed anywhere in the range. Then it minimizes the flip commit down to the lines that matter, which is the part worth waiting for. Small repository, small diff: the whole thing finishes in a few seconds.

example output

cmd:   e651ba8cf65a
commit: 7f31ac rework feeder pipeline
suspects: src/config.py, src/feeder.py
essential: 1 of 3 hunks (4 probes)
  -chunks = ids + tail
  +ids = chunks.split()

your working tree

Every path that mutates the working tree restores your original HEAD afterwards. Minimization probes apply patches onto throwaway parent checkouts and clean up. Interrupted a run with ctrl+c mid-probe. A git checkout of your branch fixes any residue.

edit this page