Skip to content

Bisection

André Borchert edited this page Aug 23, 2026 · 2 revisions

Bisection

Design stage. Nothing here is implemented.

The problem with a crash

Booting 300 mods and being told "it crashed" is useless — it names no culprit. Booting every subset to find one is impossible: 2³⁰⁰ combinations, minutes each.

The way through is delta debugging against a known-good baseline. It stays cheap for one reason: you rarely change 300 mods at once. You change six.

The method

The last validated modset is the baseline B. What you actually changed is the delta D.

Since B is proven good, the fault lies in D, or in an interaction between D and B. So bisect D — which is small — instead of the whole set.

round 1   B + {1,2,3,4,5,6}    FAIL     the change is bad
round 2   B + {1,2,3}          PASS     first half is fine
          B + {4,5,6}          FAIL     culprit is in here
round 3   B + {4}              PASS
          B + {5}              FAIL     ← mod 5

Then: quarantine mod 5, record the conflict edge, repropose the set without it.

Run the branches in parallel

Because this host runs several servers at once, both halves of a split can be tested simultaneously rather than one after the other. That turns a sequential binary search into a parallel k-ary one.

Testing both halves together is never wasted work, even though a single result would sometimes be enough to infer the other. It costs nothing extra in wall-clock, and it distinguishes "the culprit is in the second half" from "there are culprits in both halves" in the same round — which sequential search only discovers later, after it has already gone down one branch.

Delta size Sequential boots Parallel rounds (3-way) Wall clock
6, one culprit ~5 ~2 ~6 min
20, one culprit ~7 ~3 ~9 min
20, two independent culprits ~12 ~4 ~12 min
New mod conflicts with a baseline mod ~5 + 9 ~2 + 3 ~15 min
Cold build, 300 mods, nothing known 1 if clean 1 ~3 min

Concurrency should be capped at a configured number of simultaneous sessions — enough to keep bisection fast, bounded so a large campaign cannot spawn sessions without limit.

Deferring the expensive search

The fourth row deserves attention. When a newly added mod fights something already in the baseline, isolating the newcomer takes the usual couple of rounds — but finding which baseline mod it fights means bisecting B itself.

Usually you do not care. Knowing the new mod cannot come in is enough to unblock the release.

So the design defers that search: quarantine the newcomer immediately and report it, and only hunt down the counterpart when explicitly asked. When you do ask, the resulting edge is worth recording permanently — it is knowledge that never has to be paid for again.

Interaction with the conflict graph

Before proposing any set, known-bad pairs are excluded by lookup. Bisection is therefore only ever run on genuinely novel combinations, and the search space shrinks as the graph grows.

The relationship is worth stating plainly: bisection is expensive and produces knowledge; the graph is free and consumes it. Every hour spent bisecting buys permanent reductions in future bisection.

Non-determinism

Mod load order in NeoForge is not guaranteed identical between runs, so a marginal conflict can pass once and fail the next.

This matters most during bisection, where a single false PASS sends the search down the wrong branch and produces a confidently wrong answer. Two protections:

  • Any digest whose verdict flips between runs is marked flaky and never treated as validated.
  • A bisection that terminates without reproducing the original failure is discarded, not reported. If removing the identified "culprit" does not actually fix the set, the search was wrong and must restart.

Clone this wiki locally