sketch_robust_hll_test.nx
buildroot/runtime/sketch_robust_hll_test.nx
about
sketch_robust_hll_test.nx -- adversarial-safety smoke for the
median-of-k HLL wrapper.
Two cases:
1. Honest input: stream N distinct keys, verify median estimate
within +-15% of N (same tolerance as basic HLL). Verifies
the wrapper doesn't regress accuracy.
2. Adversarial input: stream the same N keys, then explicitly
saturate one inner sketch's registers (simulates an attacker
who found a hash collision against that seed). Verify the
median estimate STILL within 25% of N -- one poisoned sketch
out of 5 doesn't move the median.
3. Typed envelope: query returns adv_safety = NX_ADV_ADVERSARIAL
(distinguishes from basic HLL which is Honest).
dependencies 3 imports · 0 importers
imports: syscalls.nxsketch_robust_hll.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
| 20 | func write_i64_le(buf: *u8, value: i64) -> i64 {
called by 1: main |
| 31 | func iabs(x: i64) -> i64 { |
| 36 | func main() -> i64 { |