code wiki / (root) / sketch_hllmap_merge_capability_bench.nx

sketch_hllmap_merge_capability_bench.nx

buildroot/runtime/sketch_hllmap_merge_capability_bench.nx

6985 B200 linesdepth 7pulls 13 transitivereach 0 importersview sourcekind benchtopic sketch
docsdependenciesstructsconstsfunctions

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

syscalls.nx sketch_hll.nx sketch_hllmap.nx sketch_comparator.nx sketch_types.nx sketch_hllmap_merge_capability

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

main nx_hllmap_alloc nx_hmap_is_pow2 write_key8 nx_hllmap_add nx_hllmap_key_hash murmur3_32 mm_load_u32_le mm_rotl32 nx_hllmap_probe nx_hmap_entry_at nx_hmap_entry_at ↻ nx_hll_alloc nx_hll_add murmur3_32 ↻ nx_clz32 nx_bits_clz32 nx_hllmap_merge nx_hllmap_max2 nx_hllmap_alloc ↻ nx_hmap_entry_at ↻ nx_hllmap_probe ↻ nx_hllmap_clone_hll nx_hll_alloc ↻ nx_hllmap_n_entries nx_hllmap_estimate nx_hllmap_key_hash ↻ nx_hllmap_probe ↻ nx_hmap_entry_at ↻ nx_hll_estimate nx_hll_pow2_neg_q32 nx_hll_alpha_m_sq_q64 nx_hll_bias_table_n nx_hll_bias_table_get nx_hll_bias_lgk4 nx_hll_bias_lgk5 nx_hll_bias_lgk6 nx_hll_bias_lgk7 nx_hll_bias_lgk8 nx_hll_bias_lgk9

structs

none

consts

none

functions

31func iabs_m(x: i64) -> i64
called by 1: main
36func write_key8(buf: *u8, value: i64) -> i64
called by 1: main
47func main() -> i64