code wiki / (root) / nx_bench_hll_vs_cpcd.nx

nx_bench_hll_vs_cpcd.nx

buildroot/runtime/nx_bench_hll_vs_cpcd.nx

2763 B80 linesdepth 6pulls 13 transitivereach 0 importersview sourcekind benchtopic bench
docsdependenciesstructsconstsfunctions

about

bench_hll_vs_cpcd.nx -- HLL_8 vs CPC DENSE at matched accuracy. Fixes the v1 memory loss by configuring CPC DENSE with matched-accuracy parameters instead of matched-m parameters. MATCHED-ACCURACY CONFIG: HLL_8: lg_k=7 -> m=128 registers (1 byte each), rel-stddev = 1.04/sqrt(128) = 9.2% CPC dense: lg_k=3, w=16 -> big_M = 128 coupons, rel-stddev = 1/sqrt(128) = 8.8% MEMORY: HLL_8: 24 header + 128 register bytes = 152 bytes CPC dense: 72 header + 16 bitmap bytes = 88 bytes EXPECTED VERDICT: MEMORY BEATS at matched accuracy.

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_sketch_hll.nx nx_sketch_cpc_dense.nx nx_sketch_comparator.nx nx_sketch_types.nx nx_bench_hll_vs_cpcd.nx

imports: nx_syscalls.nxnx_sketch_hll.nxnx_sketch_cpc_dense.nxnx_sketch_comparator.nxnx_sketch_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_hll_alloc sys_mmap nx_cpcd_alloc sys_mmap ↻ 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

27const K_MAGIC_10000: i64 = 10000

functions

29func main() -> i64