sketch_hllmap_merge_capability_bench.nx
buildroot/runtime/sketch_hllmap_merge_capability_bench.nx
about
sketch_hllmap_merge_capability_bench.nx -- capability-EXCEED bench.
CLAIM TO VALIDATE:
Apache DataSketches HllMap supports add() and estimate() but
NOT merge() of two HllMaps. Substrate ships merge via per-key
HLL register-max + key-union. This bench DEMONSTRATES the
merge operation produces results equivalent to the ground-truth
"stream both into one map" workflow that DS users must do
manually. Capability EXCEED, not a perf claim.
WORKLOAD:
Map A: 3 keys with 100/50/20 distinct values each.
Map B: 3 keys with 75/30/40 distinct values; one key overlaps A.
Merged := nx_hllmap_merge(A, B)
Truth := add A's flat stream + B's flat stream into a single
fresh map
Per-key estimates of Merged vs Truth must agree within HLL's
3-sigma band.
MEASUREMENT:
For each key in the merged keyspace, compare merged estimate vs
truth estimate via nx_cmp_accuracy. All comparisons must produce
EQUIVALENT or BEATS (NEVER LOSES = the merge is mis-implemented).
dependencies 5 imports · 0 importers
imports: syscalls.nxsketch_hll.nxsketch_hllmap.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
structs
| none |
consts
| none |
functions
| 31 | func iabs_m(x: i64) -> i64 called by 1: main |
| 36 | func write_key8(buf: *u8, value: i64) -> i64 called by 1: main |
| 47 | func main() -> i64 |