nx_macro_axis_gate.nx
buildroot/runtime/nx_macro_axis_gate.nx
about
nx_macro_axis_gate.nx -- mechanically prove the BACKEND-OWNED TARGET AXIS of the self-host
preprocessor. Closes debt 1785516163, which asked for exactly this: a gate that FAILS if a compiled
corpus ever resolves TARGET_X86_64 as DEFINED, so the pin is held by a MECHANISM instead of a comment.
WHY THIS MATTERS MORE THAN IT LOOKS. The x86 self-host emits through x86ctx_rv64_to_x86_64_syscall,
which expects source to carry RV64 syscall numbers and translates them at emit time. So:
TARGET_X86_64 MUST be UNDEFINED -> the @ifndef branch (RV64 numbers) is the live one
TARGET_RV64 MUST be DEFINED -> the source axis, the exact complement
If someone fixes the preprocessor by predefining TARGET_X86_64 as an ordinary macro -- the natural
looking change when adding a macro table -- the raw-x86 branch of nx_syscalls / nx_hal / nx_dirent /
nx_poll / nx_probe / nx_fcntl / nx_self_build switches on, and EVERY syscall const is then translated
TWICE. Silent ecosystem-wide corruption, not a build error: the binaries still link and still run,
they just call the wrong kernel entry points. A comment cannot stop that. This gate can.
NON-VACUITY BY CONSTRUCTION. Every block that MUST be dropped contains a poison identifier that does
not exist anywhere in the corpus. If a drop path ever fails, the poison reaches the parser and THE
BUILD FAILS. So this gate cannot pass vacuously -- a preprocessor that ignored @ifdef entirely could
not compile this file at all.
expect_exit: 0 license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_kernel_v2.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
| none |
functions
| 28 | func axis_x86_state() -> nx_int { return BROKEN_X86_AXIS_LEAKED } called by 1: main |
| 32 | func axis_x86_state() -> nx_int { return 1 } |
| 37 | func axis_rv64_state() -> nx_int { return 1 } called by 1: main |
| 41 | func axis_rv64_state() -> nx_int { return BROKEN_RV64_AXIS_MISSING } |
| 46 | func axis_nxc_state() -> nx_int { return 1 } called by 1: main |
| 50 | func axis_nxc_state() -> nx_int { return BROKEN_NXC_VERSION_MISSING } |
| 57 | func axis_unknown_state() -> nx_int { return BROKEN_UNKNOWN_NAME_TREATED_AS_DEFINED } called by 1: main |
| 61 | func axis_unknown_state() -> nx_int { return 1 } |
| 68 | func axis_undef_before() -> nx_int { return 1 } called by 1: main |
| 74 | func axis_undef_after() -> nx_int { return BROKEN_UNDEF_DID_NOT_RETRACT } called by 1: main |
| 78 | func axis_undef_after() -> nx_int { return 1 } |
| 81 | func main() -> nx_exit |