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)

structs

none

consts

none

functions

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