Git Bayesect extends git bisect with Bayesian inference to handle the real-world scenario where test failures are not deterministic. Standard git bisect assumes every commit is clearly good or bad, but flaky tests introduce uncertainty. A test might fail ten percent of the time after a particular commit, making it impossible to definitively mark any single run as indicating a good or bad commit. Git Bayesect models this uncertainty explicitly and converges on the most likely culprit commit through repeated observations.
The algorithm uses Beta-Bernoulli conjugacy to maintain probability distributions over which commit introduced the change, and selects commits to test via greedy minimization of expected entropy. This means each test run provides maximum information about where the regression occurred. Developers can optionally provide priors based on filenames or commit message content to speed convergence further, for example weighting commits that touch suspicious files more heavily.
Featured on Hacker News with 254 upvotes and active discussion, Git Bayesect addresses a pain point that every large engineering team faces: flaky tests that make standard bisection unreliable. The tool installs as a git subcommand via pip and integrates seamlessly with existing git workflows. For CI/CD teams maintaining test suites with intermittent failures, it provides a mathematically sound approach to regression detection.