code wiki / (root) / sketch_hll_test.nx

sketch_hll_test.nx

buildroot/runtime/sketch_hll_test.nx

3079 B96 linesdepth 6pulls 11 transitivereach 0 importersview sourcekind gate/prooftopic sketch
docsdependenciesstructsconstsfunctions

about

sketch_hll_test.nx -- end-to-end test for the NishiLang HLL port. Streams N distinct keys through nx_hll_add and verifies the estimate is within 3-sigma of the true cardinality, where sigma is 1.04 / sqrt(m). Caller invokes via nxc2 -> qemu-riscv64-static (analogous to bench/fp64_smoke.sh). Per the lossless-language discipline (nishi-engine doc 20): the test ALSO verifies the typed envelope is correct -- the returned ApproxI64 declares NX_ENV_REL_STDDEV with the right stddev_rel_ppb and NX_MATURITY_REFERENCE_IMPL.

dependencies 3 imports · 0 importers

syscalls.nx sketch_hll.nx sketch_types.nx sketch_hll_test.nx

imports: syscalls.nxsketch_hll.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_hll_alloc write_i64_le nx_hll_add murmur3_32 mm_load_u32_le mm_rotl32 nx_clz32 nx_bits_clz32 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 nx_i128_shl nx_i128_div_i64 nx_i128_is_neg nx_i128_neg ↻ nx_i128_udiv_u64 nx_hll_query nx_hll_estimate ↻ nx_hll_stddev_rel_ppb nx_approx_new

structs

none

consts

none

functions

20func write_i64_le(buf: *u8, value: i64) -> i64 {
called by 1: main
32func iabs(x: i64) -> i64 {
37func main() -> i64 {