def bloom_bits

mylsm-lsm-store@0.3.2.0 · src/Sstable.bend:75

import mylsm-lsm-store@0.3.2.0/src/Sstable.bend as Sstable
import Base

75# --- Bloom allocator (Monkey-style: smaller/upper levels get more bits) ---
76# Closed form pinned here; Dayan-exact coefficients are tuning follow-up.
77def bloom_bits(level: Nat, est_keys: Nat) -> Nat:
78  match level:
79    case 0n:
80      Nat.mul(est_keys, 20n)
81    case 1n+m:
82      match m:
83        case 0n:
84          Nat.mul(est_keys, 10n)
85        case 1n+p:
86          Nat.mul(est_keys, 5n)

Uses (2)

Used by (4)