sketch_robust_hll_vs_hll_adv_bench.nx
buildroot/runtime/sketch_robust_hll_vs_hll_adv_bench.nx
about
sketch_robust_hll_vs_hll_adv_bench.nx -- adversarial paired bench.
CAPABILITY EXCEED: RobustHll's median-of-k defense rejects
register-poisoning attacks that destroy a plain HLL. No DS-
family incumbent ships this defense natively (see sketch_robust_hll
header comment for survey). This bench DEMONSTRATES the capability
gap with sealed measurement.
SHARED WORKLOAD:
1. Insert N=1000 legitimate distinct keys into both HLL and
RobustHll(k=5).
2. Capture baseline estimates -- both should be ~1000 (within
HLL's 15% 3-sigma band).
3. ATTACK: an attacker fills every register of one HLL state.
For plain HLL: all 256 registers set to rho=30.
For RobustHll: only ONE of the 5 inner sketches gets poisoned
(mimics the attacker compromising one seed, not all k).
4. Query both estimates after attack.
MEASUREMENT:
ACCURACY axis: closer to true N=1000 wins.
Expected: plain HLL inflates to ~2e11 (alpha·m·2^30);
RobustHll's median stays at ~1000 (4 of 5 inners clean).
delta_ppm >> 1e8 expected (orders of magnitude gap).
dependencies 5 imports · 0 importers
imports: syscalls.nxsketch_hll.nxsketch_robust_hll.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
| none |
functions
| 32 | func iabs_a(x: i64) -> i64 called by 1: main |
| 37 | func write_key_le(buf: *u8, value: i64) -> i64 called by 1: main |
| 48 | func main() -> i64 |