Skip to main content

delta_to_chain_cap

Function delta_to_chain_cap 

Source
pub fn delta_to_chain_cap(delta: f64) -> u32
Expand description

Map a user-facing delta (max acceptable RO ratio loss, in absolute units) to a chain-walk depth cap for longest_in. Empirically calibrated against gestalt::instrument’s chain depth histogram on the mypy/sympy corpora:

deltacapcovers
0.00u32::MAXexact (default)
0.0112p99.5+
0.057p99
0.105p95
0.203p85
0.502p70
1.001only fstate, no walk

Formula: cap = ceil(1 / sqrt(delta)) clamped to ≥1 for delta > 0. Pure heuristic — the property test in tests/approx_ro.rs verifies the actual loss stays below delta on a representative corpus.