code wiki / (root) / sketch_cms_test.nx

sketch_cms_test.nx

buildroot/runtime/sketch_cms_test.nx

4682 B137 linesdepth 7pulls 12 transitivereach 0 importersview sourcekind gate/prooftopic sketch
docsdependenciesstructsconstsfunctions

about

sketch_cms_test.nx -- Count-Min Sketch behavioral test. Tests: 1. Empty CMS returns 0 for any key 2. Single-key insert with count 7 -> estimate >= 7 (overestimate-only; may be inflated by collisions) 3. Overestimate-only invariant: stream N items, every query returns >= true count 4. Error bound: estimate <= true + eps*totalCount with very high probability across many keys 5. Merge: counter-wise sum, totalCount adds 6. Typed envelope: NX_ENV_ABS (NOT rel_stddev), conf reflects d

dependencies 3 imports · 0 importers

syscalls.nx sketch_cms.nx sketch_types.nx sketch_cms_test.nx

imports: syscalls.nxsketch_cms.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_cms_alloc write_i64_le nx_cms_estimate murmur3_32 mm_load_u32_le mm_rotl32 nx_cms_row_index nx_cms_add murmur3_32 ↻ nx_cms_row_index ↻ nx_cms_merge nx_cms_alloc ↻ nx_cms_query nx_cms_estimate ↻ nx_approx_new nx_cms_abs_bound nx_cms_conf_ppb

structs

none

consts

none

functions

18func write_i64_le(buf: *u8, value: i64) -> i64 {
called by 1: main
25func main() -> i64 {