pub fn balance_slots(
max_slots: usize,
blocks_per_seq: usize,
kv_blocks_at: impl Fn(usize) -> Result<usize>,
) -> Result<Balance>Expand description
2026-10-01: The slot count in 1..=max_slots that admits the most sequences at
blocks_per_seq blocks each, kv_blocks_at(slots) giving the pool size for a count. On a tie
the smaller count wins, so the chosen count never exceeds what its pool holds at full length
(a count above it ties with the count one below, whose pool is at least as large) and the boot’s
overcommit check passes. An error when max_slots is 0, when kv_blocks_at fails for every
count, or when no count’s pool holds one full-length sequence.