code wiki / (root) / nx_cc_equiv_gate.nx

nx_cc_equiv_gate.nx

buildroot/runtime/nx_cc_equiv_gate.nx

21703 B463 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic cc
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_gate_verdict.nx nx_cc_equiv_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 sys_ignore_sigpipe sys_mmap eq_anchor_root sys_openat_rd sys_close sys_chdir sys_mmap ↻ sys_mmap ↻ sys_openat_wr sys_openat_append eq_puts2 sys_write eq_putn2 sys_mmap ↻ sys_write ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real eq_probe sys_openat_rd ↻ eq_puts2 ↻ sys_close ↻ sys_openat_rd ↻ sys_exit sys_close ↻ eq_nonce sys_openat_rd ↻ sys_now_realtime_sec ↻ sys_mmap ↻ sys_read sys_close ↻ eq_uniq sys_mmap ↻ eq_cat eq_catn sys_mmap ↻ eq_cat ↻ eq_build sys_mmap ↻

structs

none

consts

37const EQ_ROWS: i64 = 10

functions

39func eq_puts2(logfd: i64, s: *u8) -> i64
called by 2: eq_probemain calls 1: sys_write
47func eq_putn2(logfd: i64, v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
65func eq_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 2: eq_uniqmain
72func eq_catn(dst: *u8, off: i64, v: i64) -> i64
called by 1: eq_uniq calls 1: sys_mmap
91func eq_uniq(pre: *u8, nonce: i64, suf: *u8) -> *u8
called by 1: main calls 3: sys_mmapeq_cateq_catn
102func eq_nonce() -> i64
118func eq_run(path: *u8, argv: *i64, envp: *i64, redir_out: i64, redir_err: i64) -> i64
134func eq_fsize(path: *u8) -> i64
151func eq_build(cc_path: *u8, src_path: *u8, s_tmp: *u8, o_tmp: *u8,
188func eq_run_capture(elf: *u8, out_path: *u8, envp: *i64, devnull: i64) -> i64
198func eq_files_equal(pa: *u8, pb: *u8) -> i64
231func eq_probe(logfd: i64, tag: *u8, path: *u8) -> i64
called by 1: main calls 3: sys_openat_rdeq_puts2sys_close
240func eq_anchor_root() -> i64
247func main(argc: i64, argv: *i64) -> i64