An incident dashboard keeps three summaries with different confidence and update rules. A Count Sketch estimates signed key frequencies from row medians. An exponential histogram approximates the number of recent failure bits under a fixed window width. A square-root range-mode index returns an exact most-frequent reading from a frozen array. The first two discard detail intentionally, while the range-mode index retains occurrence positions and precomputed block modes. The dashboard must label approximation and exactness at the field level, not bury those distinctions in one generic performance claim.
Project: audit signed sketches, recent windows, and exact range modes
Acceptance trace
A scanner count receives 47 observations and an adjustment of minus eight; the shown signed sketch estimate is 39 for this small trace. After twelve binary events with an eight-event window, the histogram estimates six failures with an additive allowance of two. A static readings index returns 29 over the first six positions and 61 over the last five. For release checks, compare signed counter changes against direct totals, window estimates against exact recent bits, and every range mode against a direct frequency count with smallest-value tie breaking.
Failure and cost review
Apply updates and their negations to the sketch and verify its counters return to the initial state; do not demand exactness under collisions. Generate binary streams and assert the exact recent count stays within the histogram's reported boundary allowance, including long stretches of zeros. Generate integer arrays and compare arbitrary half-open mode queries with direct counts; exercise empty windows, ties, and short ranges without complete blocks. Reject a negative or zero window width and edits to a frozen mode index. Distinguish an approximation's error budget from an exact query's tie policy.
Common Mistakes
- Do not present a Count Sketch estimate as one-sided or exact.
- Do not drop a boundary bucket whose newest event is still active.
- Do not ignore fringe candidates in a range-mode query.
- Do not mutate a frozen range index without rebuilding it.
