nx_fieldfit_verified_r3_gate_t333.nx
buildroot/runtime/nx_fieldfit_verified_r3_gate_t333.nx
about
nx_fieldfit_gate.nx -- THE FIELD-FIT MACHINERY (nx_fieldfit_lib) ON A SYNTHETIC ORACLE WITH A KNOWN ANSWER
(anatomy AN17, 2026-09-19). The oracle is a point sphere of radius FG_R centred (FG_CX, FG_CY, FG_CZ), sampled on a
10-degree lattice; the field is a sphere whose centre and radius are stations 0..3 of a five-station vector, with
station 4 a DECOY the field never reads and the live mask retires. Started from a wrong vector, the descent must
recover the centre and the radius to FG_TOL mm, must leave the decoy untouched, and must not move from the true
vector (a move accepted at the optimum is a broken accept rule). The fit file's prefix contract and the spatial
hash are held to exact answers. NEG-CONTROL: the two-sided objective must charge a shrunken sphere MORE than the
true one (a one-sided objective is gamed by deleting geometry; this is the tooth that cannot pass on one side).
license_tier: ORIGINAL. No hw writes (Rule 26).
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_sdfprim_lib.nxnx_fieldfit_verified_r3_t333.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
| 15 | const FG_NP: i64 = 5 |
| 16 | const FG_NREG: i64 = 8 // the octants |
| 17 | const FG_CAP: i64 = 4096 |
| 18 | const FG_EXT: i64 = 60 // the sphere (centre 8, radius 40) fits in +/- 60 |
| 19 | const FG_DIM: i64 = 12 |
| 20 | const FG_LAT: i64 = 6 |
| 21 | const FG_R: i64 = 40 |
| 22 | const FG_CX: i64 = 5 |
| 23 | const FG_CY: i64 = 0-3 |
| 24 | const FG_CZ: i64 = 8 |
| 25 | const FG_DECOY: i64 = 777 |
| 26 | const FG_WRONG_DX: i64 = 12 // the wrong start: centre x shifted, radius shrunk |
| 27 | const FG_WRONG_R: i64 = 25 |
| 28 | const FG_SHRUNK_R: i64 = 20 // the neg-control's deleted geometry |
| 29 | const FG_PASSES: i64 = 6 |
| 30 | const FG_STEP0: i64 = 8 |
| 31 | const FG_TOL: i64 = 2 // mm: the reverse lattice at 6 mm bounds the placement |
| 32 | const FG_STEP_DEG: i64 = 10 |
| 33 | const FG_FILE: *u8 = "/tmp/nx_fieldfit_gate.fit" |
| 34 | const FG_FILE3: *u8 = "/tmp/nx_fieldfit_gate.fit3" |
| 35 | const FG_FILE2: *u8 = "/tmp/nx_fieldfit_gate.fit2" |
| 36 | const FG_ABSENT: *u8 = "/tmp/nx_fieldfit_gate.absent" |
| 37 | const FG_MODE644: i64 = 420 |
| 53 | const FG_EXTRA: i64 = 900 |
functions
| 39 | func fg_field(px: i64, py: i64, pz: i64, a: i64, b: i64, P: *i64) -> i64 calls 1: sp_isqrt |
| 45 | func fg_region(x: i64, y: i64, z: i64) -> i64 |
| 52 | func fg_live(k: i64) -> i64 { if k == 4 { return 0 } return 1 } |
| 54 | func fg_extra(P: *i64) -> i64 { return FG_EXTRA } |
| 55 | func fg_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v } called by 1: main |
| 57 | func fg_oracle(c: *FfCtx) -> i64 |
| 79 | func fg_write(path: *u8, s: *u8) -> i64 |
| 90 | func fg_valid(P: *i64, np: i64) -> i64 { if np != FG_NP { return 0 } if P[3] <= 0 { return 0 } return 1 } |
| 91 | func fg_contract() -> *FfFitContract |
| 101 | func fg_decoy_live(k: i64) -> i64 { if k == 4 { return 1 } return 0 } |
| 102 | func fg_bound_valid(P: *i64, np: i64) -> i64 { if P[4] < 0 { FG_BAD_TRIAL = FG_BAD_TRIAL + 1; return 0 } return fg_valid(P, np) } calls 1: fg_valid |
| 104 | func main(argc: i64, argv: *i64) -> i64 |