Skip to main content

derived_balance

Function derived_balance 

Source
pub fn derived_balance(weight: &[u64], parts: u32) -> (u64, u64)
Expand description

Balance allowed by one indivisible cell.

A weighted median gives the straddling cell to one part. That part may therefore exceed the ideal share total / parts by at most the heaviest cell w_max. The bound is (total + parts * w_max) / total, which is 1 + parts * w_max / total. No cell-aligned cut can promise a tighter bound. lc_partition selects it when balance <= 0, which is the same per-frame rule the d-SEAMS domain driver derives. The same formula is used for every system. balance: None selects it.