code wiki / (root) / sketch_space_saving_test.nx

sketch_space_saving_test.nx

buildroot/runtime/sketch_space_saving_test.nx

4784 B120 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic sketch
docsdependenciesstructsconstsfunctions

about

sketch_space_saving_test.nx -- SpaceSaving behavioral test. Tests: 1. Empty sketch returns 0 2. Insert <= k unique keys: every estimate is exact (error=0) 3. Evict-when-full: insert k+1th key; smallest-count entry gets replaced; new entry has count = min_count + 1, error = min_count 4. Heavy hitters (frequency > N/k) are NEVER evicted 5. top_k returns descending-count order 6. Lower bound: count - error <= true count 7. Typed envelope: NX_ENV_ABS / conf 1.0 / max_overcount

dependencies 3 imports · 0 importers

syscalls.nx sketch_space_saving.nx sketch_types.nx sketch_space_saving_test.nx

imports: syscalls.nxsketch_space_saving.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_ss_alloc nx_ss_estimate nx_ss_find_key nx_ss_add nx_ss_find_key ↻ nx_ss_find_min nx_ss_error nx_ss_find_key ↻ nx_ss_lower_bound nx_ss_find_key ↻ nx_ss_top_k if_min nx_ss_query nx_ss_estimate ↻ nx_approx_new nx_ss_max_overcount

structs

none

consts

none

functions

18func main() -> i64 {