code wiki / (root) / sketch_reqsketch_vs_kll_bench.nx

sketch_reqsketch_vs_kll_bench.nx

buildroot/runtime/sketch_reqsketch_vs_kll_bench.nx

5292 B134 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind benchtopic sketch
docsdependenciesstructsconstsfunctions

about

sketch_reqsketch_vs_kll_bench.nx -- MATCHED-MEMORY paired measurement. HONESTY UPDATE (matched-memory rerun): Original bench used same k=64 for both; that gave ReqSketch ~3x memory (24 levels × 2*k = 3072 slots vs KLL 16 × k = 1024). This rerun MATCHES TOTAL SLOT COUNT: ReqSketch k=64 (3072 slots) vs KLL k=192 (16 × 192 = 3072 slots). Loser scaled UP, not winner nerfed down -- per substrate-honesty discipline. SHARED WORKLOAD: - Stream: integers 1..1000 in order - Slot budget: 3072 (matched) - Seed: deterministic, identical for both - Query: p99 -- the tail quantile where ReqSketch hra=1 should structurally beat KLL's uniform-eps bound EVEN AT MATCHED MEMORY (the structural-tail-preservation claim of Cormode et al. 2021). GROUND TRUTH: p99 of 1..1000 = 990 VERDICT REQUIREMENTS (honest, matched memory): ACCURACY p99 -> BEATS or EQUIVALENT (structural claim survives) ACCURACY p999 -> BEATS (gap should widen at deeper tail) ACCURACY p50 -> NOT BEATS (KLL's uniform bound holds at median) MEMORY -> EQUIVALENT by construction (matched slot count)

dependencies 5 imports · 0 importers

syscalls.nx sketch_reqsketch.nx sketch_kll.nx sketch_comparator.nx sketch_types.nx sketch_reqsketch_vs_kll_bench.

imports: syscalls.nxsketch_reqsketch.nxsketch_kll.nxsketch_comparator.nxsketch_types.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_req_alloc nx_kll_alloc nx_req_add nx_req_level_addr nx_req_compact nx_req_sort_level nx_req_level_addr ↻ nx_req_level_addr ↻ nx_req_preserve_count nx_req_rng_next nx_req_compact ↻ nx_kll_add nx_kll_level_addr nx_kll_compact nx_kll_sort_level nx_kll_level_addr ↻ nx_kll_level_addr ↻ nx_kll_rng_next nx_kll_compact ↻ nx_req_quantile nx_req_total_weight nx_req_level_addr ↻ nx_kll_quantile nx_kll_total_weight nx_kll_level_addr ↻ nx_cmp_accuracy nx_cmp_iabs nx_req_memory_bytes nx_kll_memory_bytes nx_cmp_memory nx_cmp_composite

structs

none

consts

none

functions

33func iabs_b(x: i64) -> i64
38func main() -> i64