code wiki / _hdl_build / nx_dc_core.nx
nx_dc_core.nx
buildroot/runtime/_hdl_build/nx_dc_core.nx
about
nx_dc_core.nx -- DUAL-LANE COMPARE CORE (mainless; R1-T1-002). One corpus
program through BOTH toolchains, exit codes compared:
lane A = the CURRENT sovereign chain via the durable runner
(_offc/nx_sov_build_run.elf <name>; retry guard included)
lane B = the KNOWN-GOOD frozen compiler (_offc/nx_cc_known_good.elf,
benchmark/oracle use only per law) + the same nxasm + run
AGREE = same rc. DISAGREE = a finding (one lane computes wrong values --
the context-sensitive miscompile class this instrument exists to catch):
the source is COPIED to runtime/_hdl_build/_dgbug<idx>.nx (lane-buildable
by basename = ready-made T2 fix-corpus rows) + a DIFFBUG row. Lane rc
3/4 (compile/asm fail) compares like any rc: both-fail-alike = AGREE
(consistent refusal), one-fails = DISAGREE (a divergence finding).
Findings are SUCCESS (exit 0 + rows); only unwritable logs are infra RED.
Per-idx scratch paths (/tmp/_dcb<idx>.s/.elf): same program = same bytes,
so rewrites are stale-tail-safe by determinism (LM-022 discipline).
license_tier: ORIGINAL
dependencies 2 imports · 4 importers
imports: nx_syscalls.nxnx_itoa_lib.nx
imported by: _dcb_probe.nx_diff_seed_gate_authored.nx_nxasm_ctx_probe.nxnx_diff_cmp.nx
structs
| none |
consts
| 20 | const K_MAGIC_4096: i64 = 4096 |
| 21 | const K_MAGIC_8192: i64 = 8192 |
functions
| 23 | func dc_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 28 | func dc_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 30 | func dc_cat(dst: *u8, off: i64, s: *u8) -> i64 called by 1: dc_one |
| 37 | func dc_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 52 | func dc_spawn(elf: *u8, a1: *u8, a2: *u8, rout: i64) -> i64 called by 3: maindc_lane_adc_lane_b calls 7: sys_forksys_openat_wrsys_dup3sys_mmapsys_execvesys_exit+1 |
| 75 | func dc_filesize(path: *u8) -> i64 |
| 87 | func dc_lane_a(name: *u8) -> i64 |
| 93 | func dc_lane_b(src: *u8, spath: *u8, elfpath: *u8) -> i64 |
| 112 | func dc_copy(src: *u8, dst: *u8) -> i64 |
| 134 | func dc_one(prefix: *u8, idx: i64, lfd: i64) -> i64 |