nx_srcfmt_gate.nx
buildroot/runtime/nx_srcfmt_gate.nx
about
nx_srcfmt_gate.nx -- GATE for LN9, the canonical source formatter (lang.plan rung LN9, symbol
srcfmt_emit). The done-rule: idempotent over the tokenizer stream, fmt(fmt(x)) == fmt(x); comments
and string literals preserved; the formatted corpus builds byte-identical. This gate proves the
deterministic half in-process (it IMPORTS nx_srcfmt, so nx_gate_bite mutating nx_srcfmt.nx and
rebuilding the gate exercises the real subject) and the build-neutrality half on a hermetic fixture
by forking the live compiler; the WHOLE-CORPUS build-neutrality is the lane's sweep (nx_srcfmt runs
it over every .nx as a sibling in the tree so imports resolve; a /tmp copy fails expand_imports for
a reason unrelated to the formatter -- measured 2026-08-23) and its count is published, not sampled
here. The load-bearing non-vacuity tooth is T9: it proves the ORACLE inside the formatter actually
distinguishes two different token streams -- the oracle is what makes "a formatter that changes a
program is impossible" true, so a vacuous oracle would make every other tooth meaningless.
Data captures in /tmp/nxsf/, the one runnable under _build/ (NAS /tmp is noexec).
Usage: nx_srcfmt_gate [compiler_elf] (CWD = the tree root, like nx_cc_equiv_gate)
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_srcfmt.nxnx_ccgate_lib.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
| 20 | func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 23 | func g_fmt(src: *u8, op: *i64) -> i64 |
| 31 | func g_has(a: *u8, m: i64, needle: *u8) -> i64 |
| 45 | func g_write_file(path: *u8, buf: *u8, n: i64) -> i64 |
| 54 | func g_files_eq(a: *u8, b: *u8) -> i64 |
| 67 | func main(argc: i64, argv: *i64) -> i64 |