Skip to main content

Module bisect

Module bisect 

Source
Expand description

Bisect.

Stores state in .mkit/bisect (a single file, NOT a directory). The on-disk format is a plain-text manifest:

<orig_head_hex>
<orig_branch_or_empty>
<bad_hash_or_empty>
<good_hash_1>
<good_hash_2>
...
skip:<skipped_hash_1>
skip:<skipped_hash_2>
...

The skip: prefix lines are additive — old state files without them deserialize with an empty skipped set. pick_midpoint_skip skips over any candidate whose hash is in skipped, searching neighbors.

Trailing whitespace on any line is tolerated on read.

enumerate_range and pick_midpoint form the search core; the caller drives the loop, calling pick_midpoint on the candidates returned by enumerate_range and updating bad/good based on the tester’s verdict. BisectStep is a convenience response type.

Structs§

BisectState
Persisted bisect state.

Enums§

BisectError
Errors raised by this module.
BisectStep
Outcome of a single bisect iteration.

Constants§

BISECT_FILE
Single-file state path under <mkit_dir>.

Functions§

bisect_file_path
Convenience: full path to the bisect state file under mkit_dir.
cleanup_bisect
Remove <mkit_dir>/bisect. Idempotent.
enumerate_range
Walk ancestors of bad, stopping at any commit that is good or an ancestor of good. Returns the candidate set in BFS order from bad.
is_bisect_in_progress
Returns true when <mkit_dir>/bisect exists.
next_step
Drive a single bisect iteration: enumerate the range, then pick the midpoint or report completion.
pick_midpoint
Pick the midpoint commit. Returns Hash::ZERO when candidates is empty.
pick_midpoint_skip
Pick the midpoint commit, skipping over any commit in skipped.
read_state
Read bisect state from <mkit_dir>/bisect.
write_state
Persist state to <mkit_dir>/bisect.

Type Aliases§

BisectResult
Result alias.