code wiki / _hdl_build / nx_fnptr_call_gate.nx

nx_fnptr_call_gate.nx

buildroot/runtime/_hdl_build/nx_fnptr_call_gate.nx

6677 B155 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic fnptr
docsdependenciesstructsconstsfunctions

about

nx_fnptr_call_gate.nx -- THE MONITOR PILLAR for indirect (function-pointer) calls. WHY THIS FILE EXISTS, AND WHY IT LIVES HERE: seq715 was a SILENT MISCOMPILE: `obj.fn_field(args)` compiled cleanly, emitted the function's ADDRESS instead of an indirect call, and DISCARDED the argument list -- so every multi-method vtable in the tree (CLAUDE rule 6 OOP) was quietly broken and the caller received a code-segment pointer that reads as a plausible integer. It failed OPEN. A monitor for exactly this already existed -- bench/nx_fn_ptr_struct_call_smoke.nx, the MONITOR pillar of the 2026-05-19 four-pillar fix -- but it lived in bench/, and nx_sov_build_run only probes runtime/_hdl_build/, runtime/, nxasm/ and runtime/wiki/. It resolved to SOURCE-NOT-FOUND, so the watchdog was never once runnable and the regression sat undetected. A guard the build cannot reach is not a guard. This gate therefore lives in runtime/_hdl_build/ where the driver WILL find it. SELF-TESTING BY CONSTRUCTION: this gate is compiled by the compiler it tests. If the indirect-call path breaks again, the gate's own calls return garbage and it goes RED. There is no separate oracle to drift out of sync. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_fnptr_call_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap gv_head gv_puts sys_write sys_mmap ↻ gv_check gv_puts ↻ gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gv_cat sys_write ↻ sys_close sys_munmap ↻ sys_exit

structs

35struct Slots
62struct Arity

consts

44const SLOTS_BYTES: i64 = 56
45const GUARD_HEAD: i64 = 4369
46const GUARD_TAIL: i64 = 8738
68const ARITY_BYTES: i64 = 32
69const WANT_K3: i64 = 123
70const WANT_K6: i64 = 123456
71const WANT_K7: i64 = 1234567
72const WANT_K8: i64 = 12345678

functions

26func r11f() -> i64 { return 11 }
27func r22f() -> i64 { return 22 }
28func r33f() -> i64 { return 33 }
29func r44f() -> i64 { return 44 }
30func r55f() -> i64 { return 55 }
51func k3(a: i64, b: i64, c: i64) -> i64 { return a*100 + b*10 + c }
52func k6(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64) -> i64
55func k7(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64, g: i64) -> i64
58func k8(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64, g: i64, h: i64) -> i64
74func main() -> i64