code wiki / (root) / nx_bench_multiseed.nx

nx_bench_multiseed.nx

buildroot/runtime/nx_bench_multiseed.nx

4196 B157 linesdepth 6pulls 12 transitivereach 0 importersview sourcekind benchtopic bench
docsdependenciesstructsconstsfunctions

about

bench_multiseed.nx -- 20-workload accuracy averaging for OUR HLL + CPC. Today's single-sample verdict (HLL: LOSES) was an artifact of variance, not algorithm. Both ours and DS got estimates within their declared rel-stddev bound; DS happened to land closer to truth on seed 42. This harness varies the WORKLOAD across 20 distinct streams (each of N unique keys), runs both primitives on every stream, and reports mean error. Combined with the same workloads run through DS Python (see bench_vs_ds_multiseed.py), we get a statistically fair accuracy verdict.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_sketch_hll.nx nx_sketch_cpc_dense.nx nx_bench_multiseed.nx

imports: nx_syscalls.nxnx_sketch_hll.nxnx_sketch_cpc_dense.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap nx_hll_alloc sys_mmap ↻ nx_cpcd_alloc sys_mmap ↻ nx_hll_add murmur3_32 mm_load_u32_le mm_rotl32 nx_clz32 nx_bits_clz32 nx_cpcd_add nx_cpcd_coupon_pos murmur3_32 ↻ nx_cpcd_clz32 nx_bits_clz32 ↻ nx_cpcd_bit_get nx_cpcd_bit_set 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 nx_hll_bias_lgk10 nx_hll_log2_ppm nx_hll_bias_correct nx_hll_bias_table_n ↻ nx_hll_bias_table_get ↻ nx_mulshl_div_i64 nx_i128_alloc nx_i128_mul_i64 nx_i128_mul_u64 nx_i128_neg

structs

none

consts

21const K_MAGIC_2000: i64 = 2000
22const K_MAGIC_100000: i64 = 100000

functions

24func ms_iabs(x: i64) -> i64
called by 1: main
31func ms_putc(c: i64) -> i64
called by 2: ms_i64ms_nl calls 2: sys_mmapsys_write
38func ms_str(s: *u8, len: i64) -> i64
called by 1: main calls 1: sys_write
43func ms_i64(n: i64) -> i64
called by 2: ms_i64main calls 3: ms_putcms_i64sys_mmap
67func ms_nl() -> i64
called by 1: main calls 1: ms_putc
77func main() -> i64