def bloom_pick
import mylsm-lsm-store@0.6.0.1/src/Sstable.bend as Sstableimport Base
import mylsm-lsm-store@0.6.0.1/src/MemTable.bend as MemTable
343# Size-gated entry point: sequential on both sides of the gate.
344# MEASURED VERDICT (2026-09-26, 1M interleaved A/B, Darwin arm64, Bend 2.0.28):
345# sequential median 225105 ms (4442 ops/s) vs 4-chunk 249150 ms (4014 ops/s)
346# vs hybrid 261746 ms — the parallel builds cost ~10% (fork/join plus
347# allocation overhead dominates; invisible at 100k, compounds over 244
348# flushes). Confirmed under two machine states (all arms shifted +15k ms on
349# the slow day; relative order unchanged). The parallel builds stay as
350# law-covered spikes; the `!` variants stay opt-in behind the GPU recovery
351# crash documented below.
352def bloom_pick(small: Bool, +entries: List<&2, MemTable.Entry>, +nb: Nat) -> Bloom:
353 match small:
354 case True{}:
355 bloom_of(entries, bloom_new(nb))
356 case False{}:
357 bloom_of(entries, bloom_new(nb))