pub fn delta_to_chain_cap(delta: f64) -> u32Expand 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:
| delta | cap | covers |
|---|---|---|
| 0.00 | u32::MAX | exact (default) |
| 0.01 | 12 | p99.5+ |
| 0.05 | 7 | p99 |
| 0.10 | 5 | p95 |
| 0.20 | 3 | p85 |
| 0.50 | 2 | p70 |
| 1.00 | 1 | only 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.