nx_bench_hll_vs_datasketches.nx
buildroot/runtime/nx_bench_hll_vs_datasketches.nx
about
nx_bench_hll_vs_datasketches.nx -- honest head-to-head.
Drives nx_sketch_hll over 100k xorshift64 keys, then emits per-axis
verdicts via nx_perf_verdict against Apache DataSketches' published
HLL_4 baseline from specs/nx_perf_baselines.txt.
Per the honest-perf-verdict cardinal: every LOSE row names a
specific fix. Per the stop-and-build-upward cardinal: when the fix
lives in nxc2 (no native target), the verdict stays UNMEASURABLE
rather than projecting native equivalents.
Baselines hardcoded for now (this is the FIRST head-to-head; future
drivers should read specs/nx_perf_baselines.txt).
genealogy_id: substrate_perf_bench_2026_05_14
lineage_id: honest_hard_feedback
dependencies 6 imports · 0 importers
imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_clock.nxnx_sketch_hll.nxnx_perf_verdict.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
| 30 | const NX_MAGIC_1000000000: i64 = 1000000000 |
| 31 | const NX_MAGIC_1000000: i64 = 1000000 |
| 33 | const NX_HLL_VD_N: nx_int = 100000 |
| 39 | const NX_HLL_VD_LGK: nx_int = 10 |
| 40 | const NX_HLL_VD_SEED: nx_int = 1442695040888963407 |
| 46 | const NX_HLL_DS_THROUGHPUT_IPS: nx_int = 75000000 // ~50-100M typical |
| 47 | const NX_HLL_DS_MEMORY_BYTES_K10: nx_int = 1024 // 4 bits * 2^10 = 4096 bits = 512 B regs + ~512 B header |
| 48 | const NX_HLL_DS_RSD_PCT_Q4_K10: nx_int = 325 // 1.04/sqrt(2^10)*100*100 = 3.25% in pct_q4 |
| 49 | const NX_HLL_DS_MAX_LGK: nx_int = 21 |
| 50 | const NX_HLL_VD_MAX_LGK: nx_int = 10 // ours |
functions
| 53 | func nx_hll_vd_xorshift64(state_p: *nx_int) -> nx_int called by 1: main |
| 62 | func nx_hll_vd_i64_to_bytes(v: nx_int, out: *u8) called by 1: main |
| 73 | func main() -> nx_exit |