code wiki / (root) / nx_homefwd_adversary.nx

nx_homefwd_adversary.nx

buildroot/runtime/nx_homefwd_adversary.nx

3227 B104 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_homefwd_adversary.nx -- SELF-CHECKING adversary KAT for G10 home- forwarding + G11 chain fusion. Prints each answer AND returns the number of FAILED checks (0 = all pass), so the differential gauntlet catches wrong VALUES (baseline exit 0 vs candidate exit N), not just crashes. T1 G10 STORE-GUARD: a = x; x = x + 1; b += (x - a) -> b == n (3). (X86_NEGCTL_FWD_IGNORE_STORE forwards a's load past the store -> b=0.) T2 POSITIVE: s += arr[j] -> 600. T3 DOUBLE-USE: y += t + t, t = x2 (use_count 2, never forwarded) -> 36. T4 G11 MID-CHAIN READ: x3 = x3*3 + 1 + x3 -- the second read of x3 sits INSIDE the would-be chain window; the scan must ABORT the fusion. 2 iters from 2: 9 -> 37. (X86_NEGCTL_CHAIN_IGNORE_READ fuses anyway -> the second read sees the mutated home -> 14 -> 86 -> RED.) T5 G11 PURE CHAIN: x4 = x4*3 + 1 fuses in place; 3 iters from 2: 7 -> 22 -> 67. Seeds come from mmap'd memory so const-prop cannot fold them. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 0 importers

nx_syscalls_x86_64.nx nx_homefwd_adversary.nx

imports: nx_syscalls_x86_64.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main hf_emit_i64

structs

none

consts

none

functions

19func hf_emit_i64(fd: i64, n: i64) -> i64
called by 1: main
37func main() -> i64
calls 1: hf_emit_i64