April 1, 2026
When bugs roll dice, bring Bayes
Show HN: Git bayesect – Bayesian Git bisection for non-deterministic bugs
Math-powered bug bloodhound hunts flaky tests; devs split between “wow” and “wait, what”
TLDR: New tool “git bayesect” uses Bayesian odds to find the code change behind flaky bugs. Commenters are split between excitement over math-powered debugging, demands for richer metrics and repeated runs, and newcomers asking what problem it solves—while others see immediate use for noisy benchmarks and AI-driven tests.
Flaky bugs—the ones that fail on Mondays and pass on Tuesdays—just met their match. A new tool called git bayesect promises to sniff out the exact code change where “kinda flaky” turned “super flaky,” using Bayes’ rule (think: updating odds as you collect evidence). The author even dropped a mathy explainer here, and the comment section exploded into a nerdy soap opera.
The hype squad is loud: one fan called it “really fun and mathematically satisfying,” picturing fewer hours yelling at tests that only fail when the moon is full. Pragmatists piled in with questions: can it run tests multiple times per commit to get better odds? Can it handle performance slowdowns where benchmark numbers bounce around like a pogo stick? Another user said this is “useful for tests with LLM interactions,” a.k.a. AI features that change their mind mid-run.
Then came the confused-but-curious crowd. One commenter asked what any of this even proves—and confessed they weren’t familiar with Git’s built-in bisect command (the usual “find-the-bad-commit” tool). Cue friendly explainers and a few memes about Schrödinger’s bug and rolling a D20 to reproduce an error. Verdict: it’s stats meets debugging, with fans cheering, skeptics squinting, and everyone agreeing flaky tests are chaos—so bring on the math.
Key Points
- •git bayesect identifies the commit where an event’s likelihood changes, useful for non-deterministic failures like flaky tests.
- •It uses Bayesian inference with greedy expected-entropy minimization and Beta–Bernoulli conjugacy for posterior updates.
- •Installation is supported via pip and uv, and the tool provides a suite of CLI commands for bisection and observation logging.
- •Users can set priors per commit or globally based on filenames or commit text through callbacks.
- •A demo repository and scripts are included to practice detecting a controlled change in flakiness.