code wiki / (root) / nx_cc_splice_bisect.nx

nx_cc_splice_bisect.nx

buildroot/runtime/nx_cc_splice_bisect.nx

10794 B305 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic cc
docsdependenciesstructsconstsfunctions

about

nx_cc_splice_bisect.nx -- PER-FUNCTION COMPILER-CODEGEN BISECTOR. Team organ (Doctor's localizer, sibling of nx_cc_equiv_gate): when a challenger compiler's output misbehaves, this finds WHICH function's codegen carries the defect -- no awk, no shell loops, pure NishiLang file IO + fork/execve/wait4 (sovereign judging law). Method (asm splice): for every function whose body DIFFERS between the two asm files, build a FRANKEN image = base.s with only that one function's body replaced by the donor's, assemble+link it, and run the franken compiler on a probe source. A function is a BREAKER iff its splice alone flips the probe verdict. Functions are self-contained ABI units, so single-function splices are valid experiment isolation. Born 2026-06-10 bisecting the awakened-LICM self-host breakage (ledger T#opt-dom-licm-dormant-paths): corpus rows all GREEN, self-host RED -- the defect lives in specific big-function hoists, and this organ names them. Usage: nx_cc_splice_bisect <base.s> <donor.s> [probe.nx] base.s asm of the BLESSED compiler compiling some source donor.s asm of the CHALLENGER compiling the SAME source probe.nx source the franken compiler must still compile (default runtime/_derefcast_minrepro.nx; compile rc 0 + non-empty asm = behaves) Exit 0 iff NO breaker found (prints/logs the per-function table to knowledge/status/cc_splice_bisect.log either way). license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_cc_splice_bisect.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sb_puts2 sys_write sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sb_scan sb_label_len sys_openat_wr sys_openat_append sb_putn2 sys_mmap ↻ sys_write ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sb_names_eq sb_bodies_eq sb_write_franken sys_openat_wr ↻ sys_write ↻ sys_close ↻ sb_try_franken sys_mmap ↻ sb_run sys_fork sys_dup3 sys_execve sys_exit sys_mmap ↻ sys_wait4 sys_openat_wr ↻ sys_close ↻ sys_openat_rd ↻ sys_lseek ↻ sb_putsn2

structs

none

consts

34const SB_MAX_FNS: i64 = 4096

functions

36func sb_puts2(logfd: i64, s: *u8) -> i64
called by 1: main calls 1: sys_write
44func sb_putn2(logfd: i64, v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
62func sb_putsn2(logfd: i64, s: *u8, n: i64) -> i64
called by 1: main calls 1: sys_write
72func sb_label_len(buf: *u8, off: i64, end: i64) -> i64
called by 1: sb_scan
105func sb_scan(buf: *u8, n: i64, tab: *i64) -> i64
called by 1: main calls 1: sb_label_len
132func sb_names_eq(a: *u8, ao: i64, al: i64, b: *u8, bo: i64, bl: i64) -> i64
called by 1: main
142func sb_bodies_eq(a: *u8, as_: i64, ae: i64, b: *u8, bs: i64, be: i64) -> i64
called by 1: main
154func sb_run(path: *u8, argv: *i64, envp: *i64, redir_out: i64, redir_err: i64) -> i64
168func sb_write_franken(base: *u8, base_n: i64, bs: i64, be: i64,
182func sb_try_franken(probe: *u8, envp: *i64, devnull: i64) -> i64
219func main(argc: i64, argv: *i64) -> i64