code wiki / _hdl_build / nx_alias_layout_gate.nx
nx_alias_layout_gate.nx
buildroot/runtime/_hdl_build/nx_alias_layout_gate.nx
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
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
structs
| 29 | struct AllA { a: gi, b: gi, c: gi } |
| 30 | struct AthenP { n: gi, p: *AllA, w: gi } |
| 31 | struct PthenA { p: *AllA, n: gi, w: gi } |
| 32 | struct Chain { x: gi2, y: gi2 } |
consts
| 34 | const SBYTES: i64 = 64 |
| 35 | const GUARD_A: i64 = 11 |
| 36 | const GUARD_B: i64 = 22 |
| 37 | const GUARD_C: i64 = 33 |
| 38 | const GUARD_N: i64 = 7 |
| 39 | const CHAIN_X: i64 = 5 |
| 40 | const CHAIN_Y: i64 = 6 |
functions
| 42 | func ret_alias() -> gi { return 77 } called by 1: main |
| 44 | func main() -> i64 |