nx_cc_equiv_gate.nx
buildroot/runtime/nx_cc_equiv_gate.nx
about
nx_cc_equiv_gate.nx -- COMPILER DIFFERENTIAL-BEHAVIOR ORACLE: miscompile-detection for the sovereign toolchain (EMI-style baseline-vs-challenger build + stdout byte-equal + self-host stage).
Team organ (Engineer-owned) born from the dom/licm dormant-paths
discovery (ledger T#opt-dom-licm-dormant-paths, 2026-06-10): the
deref-cast precedence bug had silently disabled 4 optimizer reads
since they were written, and AWAKENING them broke the self-host at
generation 3 -- a class of defect no single-binary test catches.
This gate judges ANY compiler mutation by BEHAVIOR, not by asm:
For each corpus row (deterministic, network-free modules):
build with BASELINE cc -> run -> raw wait4 status + stdout bytes
build with CHALLENGER cc -> run -> same
row PASS iff both build, statuses EQUAL, stdout BYTE-EQUAL.
(Different codegen/hoisting is fine; different BEHAVIOR is not.)
SELF-HOST stage (the gen3-class catch):
challenger compiles runtime/nx_compile_x86.nx -> gen2 binary;
gen2 must then compile a probe module whose binary runs exit 0.
This is exactly where the awakened-LICM breakage surfaced
(gen3: "unknown type name 'nx_size'").
Usage: nx_cc_equiv_gate [challenger_elf]
challenger default: /tmp/cc_challenger.elf
baseline (always): _offc/nx_compile_x86_native.elf
Run with CWD=nxc2/. Exit 0 iff all rows + self-host PASS.
Verdicts stream to stdout AND append to the durable log
knowledge/status/cc_equiv_gate.log (Archivist rule).
ORCHESTRATION is pure NishiLang fork/dup3/execve/wait4 -- the
sovereign exit-judging law (no shell, no $?).
license_tier: ORIGINAL
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
| none |
consts
| 37 | const EQ_ROWS: i64 = 10 |
functions
| 39 | func eq_puts2(logfd: i64, s: *u8) -> i64 |
| 47 | func eq_putn2(logfd: i64, v: i64) -> i64 |
| 65 | func eq_cat(dst: *u8, off: i64, s: *u8) -> i64 |
| 72 | func eq_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 91 | func eq_uniq(pre: *u8, nonce: i64, suf: *u8) -> *u8 |
| 102 | func eq_nonce() -> i64 |
| 118 | func eq_run(path: *u8, argv: *i64, envp: *i64, redir_out: i64, redir_err: i64) -> i64 |
| 134 | func eq_fsize(path: *u8) -> i64 |
| 151 | func eq_build(cc_path: *u8, src_path: *u8, s_tmp: *u8, o_tmp: *u8, |
| 188 | func eq_run_capture(elf: *u8, out_path: *u8, envp: *i64, devnull: i64) -> i64 |
| 198 | func eq_files_equal(pa: *u8, pb: *u8) -> i64 |
| 231 | func eq_probe(logfd: i64, tag: *u8, path: *u8) -> i64 |
| 240 | func eq_anchor_root() -> i64 |
| 247 | func main(argc: i64, argv: *i64) -> i64 |