code wiki / _hdl_build / nx_alias_layout_gate.nx

nx_alias_layout_gate.nx

buildroot/runtime/_hdl_build/nx_alias_layout_gate.nx

4537 B100 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_alias_layout_gate.nx -- MONITOR for the type-alias struct-layout parity class (seq521). THE CLASS: the C anchor (parse.c) resolves `type NAME = BASE` aliases; for a long time the self-hosted parser did not, so a struct field typed with an alias fell through parse_type to the TY_VOID size-0 placeholder. Every field of an aliased type then had size 0, later field offsets collapsed onto each other, a pointer field landed at offset 0 and was overwritten by an int field, and dereferencing that tiny integer segfaulted. It was found bits-up (NxMesh.verts read back as the literal 4) and cost a SIGSEGV in nx_landmark_anatomy. WHY THIS FILE EXISTS: the artifact that proved seq521 -- nx_segfield_repro.nx -- only PRINTS. It has no verdict, so no judge and no build driver can fail on it, and nothing guarded the class afterwards. seq521 and seq715 were the SAME class (self-host parity gaps against the C anchor) and one had been fixed while the other had not; nobody swept for siblings. This turns the probe into a gate that the driver can reach, with the fn-pointer half deliberately left to nx_fnptr_call_gate rather than duplicated here. DISCRIMINATING BY CONSTRUCTION: every tooth reads RAW i64 offsets off the struct base. That is precisely what collapses under the defect, so a regressed compiler cannot make these pass. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_alias_layout_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 ↻ ret_alias 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

29struct AllA { a: gi, b: gi, c: gi }
30struct AthenP { n: gi, p: *AllA, w: gi }
31struct PthenA { p: *AllA, n: gi, w: gi }
32struct Chain { x: gi2, y: gi2 }

consts

34const SBYTES: i64 = 64
35const GUARD_A: i64 = 11
36const GUARD_B: i64 = 22
37const GUARD_C: i64 = 33
38const GUARD_N: i64 = 7
39const CHAIN_X: i64 = 5
40const CHAIN_Y: i64 = 6

functions

42func ret_alias() -> gi { return 77 }
called by 1: main
44func main() -> i64