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

4683 B147 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic ale
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_ale_aggregate_tamper_stub.n

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

main sys_exit sys_mmap ts_read sys_openat_rd sys_read sys_close ts_len ts_is_bol ts_pfx_eq ts_line_end ts_milli_start ts_parse_int ts_clamp sys_openat_wr sys_write ts_wd sys_mmap ↻ sys_write ↻ sys_close ↻

structs

none

consts

12const K_MAGIC_262144: i64 = 262144

functions

14func ts_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
28func ts_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
30func ts_is_bol(buf: *u8, pos: i64) -> i64
called by 1: main
36func ts_line_end(buf: *u8, n: i64, start: i64) -> i64
called by 1: main
45func ts_pfx_eq(pfx: *u8, plen: i64, buf: *u8, pos: i64) -> i64
called by 1: main
54func ts_milli_start(buf: *u8, start: i64, end: i64) -> i64
called by 1: main
64func ts_parse_int(buf: *u8, from: i64, end: i64) -> i64
called by 1: main
77func ts_clamp(v: i64) -> i64
called by 1: main
84func ts_wd(fd: i64, v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
98func main(argc: i64, argv: *i64) -> i64