code wiki / _hdl_build / nx_ale_aggregate_tamper_stub.nx
nx_ale_aggregate_tamper_stub.nx
buildroot/runtime/_hdl_build/nx_ale_aggregate_tamper_stub.nx
about
nx_ale_aggregate_tamper_stub.nx -- the TAMPER fixture for ALE-R1c: a BROKEN aggregator.
It DROPS a task from the denominator (divides the honest sum by N-1 instead of N) AND
SKIPS the final clamp, so on a fixture whose honest mean is in range it emits an INFLATED,
OUT-OF-[0,1000] mean (overshoot_set.txt: honest 2100/3=700 -> tamper 2100/2=1050). The
diff-lane gate _ale_aggregate_gate runs THIS and REJECTS the out-of-range / wrong aggregate,
proving the real organ's BOUNDED + MEAN-EXACT contracts are enforced, not assumed. This is
the negative control. NEVER on the runtime path; fixture only. Lives in runtime/_hdl_build/
so `import "nx_syscalls.nx"` resolves (the import walker reaches runtime/). Same I/O surface
as nx_ale_aggregate: argv[1]=fixture, argv[2]=scratch out (agg| line + breakdown).
license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 12 | const K_MAGIC_262144: i64 = 262144 |
functions
| 14 | func ts_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 28 | func ts_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: main |
| 30 | func ts_is_bol(buf: *u8, pos: i64) -> i64 called by 1: main |
| 36 | func ts_line_end(buf: *u8, n: i64, start: i64) -> i64 called by 1: main |
| 45 | func ts_pfx_eq(pfx: *u8, plen: i64, buf: *u8, pos: i64) -> i64 called by 1: main |
| 54 | func ts_milli_start(buf: *u8, start: i64, end: i64) -> i64 called by 1: main |
| 64 | func ts_parse_int(buf: *u8, from: i64, end: i64) -> i64 called by 1: main |
| 77 | func ts_clamp(v: i64) -> i64 called by 1: main |
| 84 | func ts_wd(fd: i64, v: i64) -> i64 |
| 98 | func main(argc: i64, argv: *i64) -> i64 |