sketch_cusum_vs_threshold_bench.nx
buildroot/runtime/sketch_cusum_vs_threshold_bench.nx
about
sketch_cusum_vs_threshold_bench.nx -- change-point detection bench.
CLAIM TO VALIDATE:
CUSUM (Page 1954) detects a SHIFT in stream mean faster and with
fewer false alarms than a single-threshold rule. Threshold-only
alerts when ANY sample crosses the threshold -- prone to false
positives from natural noise. CUSUM accumulates evidence over
multiple samples, so it triggers only on persistent drift.
WORKLOAD:
- Phase 1 (steps 1..100): samples ~ N(100, 5) -- normal regime
- Phase 2 (steps 101..200): samples ~ N(120, 5) -- shifted mean
Threshold = 115 (between the two means).
MEASUREMENT:
CUSUM: count detections in Phase 1 (false alarms) vs Phase 2.
Threshold: same.
Score = (correct detections in Phase 2) - (false alarms in Phase 1).
Higher wins.
dependencies 4 imports · 0 importers
imports: syscalls.nxsketch_cusum.nxsketch_comparator.nxsketch_types.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 27 | const NX_CUB_LCG_A: i64 = 1103515245 |
| 28 | const NX_CUB_LCG_C: i64 = 12345 |
| 29 | const NX_CUB_LCG_MOD: i64 = 0x7FFFFFFF |
functions
| 31 | func main() -> i64 |