code wiki / (root) / gen_hll_bias_nx.nx

gen_hll_bias_nx.nx

buildroot/runtime/gen_hll_bias_nx.nx

6247 B199 linesdepth 6pulls 11 transitivereach 0 importersview sourcekind tooltopic gen
docsdependenciesstructsconstsfunctions

about

gen_hll_bias_nx.nx -- generate HLL bias table by running OUR HLL. SOVEREIGN-SUBSTRATE DISCIPLINE: prior generator used Python's getrandbits(64) and Python's idealized HLL math. That calibrated the bias table to PYTHON, not to our actual murmur3-based HLL. This generator runs OUR HLL on synthetic streams, collecting the raw alpha*m^2/sum_q32 directly from our register array. Output: writes hll_bias_table.nx-compatible const block to stdout. Caller redirects to runtime/hll_bias_table.nx. Caller args (compile-time consts here -- substrate has no argv yet): lg_k_min, lg_k_max -- range of lg_k to generate tables for n_samples -- sample points per lg_k across (threshold, 5m] n_seeds -- HLL trials per sample point

dependencies 2 imports · 0 importers

syscalls.nx sketch_hll.nx gen_hll_bias_nx.nx

imports: syscalls.nxsketch_hll.nx

imported by: nobody (leaf or entry point)

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

main gn_str gn_nl gn_putc nx_hll_heule_threshold

structs

none

consts

20const NX_GEN_LG_K_MIN: i64 = 4
21const NX_GEN_LG_K_MAX: i64 = 10
25const NX_GEN_N_SAMPLES: i64 = 192
29const NX_GEN_N_SEEDS: i64 = 500
33const NX_GEN_UPPER_MULT: i64 = 10

functions

37func gn_putc(c: i64) -> i64 {
called by 2: gn_i64gn_nl
44func gn_str(s: *u8, len: i64) -> i64 {
called by 1: main
49func gn_i64(n: i64) -> i64 {
called by 1: gn_i64 calls 2: gn_putcgn_i64
73func gn_nl() -> i64 {
called by 1: main calls 1: gn_putc
83func nx_hll_raw_estimate(h: *Hll) -> i64 {
100func main() -> i64 {