code wiki / _hdl_build / nx_codegen_improve_loop.nx

nx_codegen_improve_loop.nx

buildroot/runtime/_hdl_build/nx_codegen_improve_loop.nx

6950 B150 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tooltopic codegen
docsdependenciesstructsconstsfunctions

about

nx_codegen_improve_loop.nx -- the TEAM's autonomous codegen-improvement loop: the one machine that drives a codegen change from source to a governed, MEASURED promotion decision, with no human at a shell. This is what "get the team there in partnership till they can do it themselves" means concretely. 1. SELF-HOST the candidate compiler from the compiler's own source. 2. VERIFY differentially vs known-good on a corpus (no miscompile). 3. MEASURE race the SAME kernel compiled by candidate vs known-good: checksum must stay byte-identical (correctness) and we read cycles for both (the win, or a regression). 4. GOVERN the crew council ACTs only if verified AND not slower; a miscompile or a regression is ESCALATEd (rolled back). Run here on the IDENTITY candidate (current source) it proves the loop end to end + measures the baseline; a real regalloc change plugs into step 1's source and the SAME loop decides. Non-destructive (candidate in /tmp; known-good pinned). Known answer: loop runs, candidate verified + not slower -> council ACT, exit 0.

dependencies 2 imports · 0 importers

nx_codegen_exec.nx nx_crew_council.nx nx_codegen_improve_loop.nx

imports: nx_codegen_exec.nxnx_crew_council.nx

imported by: nobody (leaf or entry point)

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

main gd_puts sys_write gd_build sys_mmap gd_exec sys_mmap ↻ sys_fork sys_openat_wr sys_dup3 sys_close sys_execve sys_exit sys_wait4 wait_exit_code gd_build_run gd_build ↻ gd_run sys_mmap ↻ gd_exec ↻ gd_emit gd_puts ↻ sys_mmap ↻ sys_write ↻ cil_race gd_build ↻ gd_exec ↻ cil_read_file sys_read cil_parse_two cil_is_digit cc_set cc_council cc_verdict_name

structs

none

consts

none

functions

23func cil_is_digit(c: i64) -> i64 { if c < 48 { return 0 } if c > 57 { return 0 } return 1 }
called by 1: cil_parse_two
26func cil_read_file(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: cil_race calls 1: sys_read
40func cil_parse_two(buf: *u8, len: i64, out: *i64) -> i64
called by 1: cil_race calls 1: cil_is_digit
65func cil_race(compiler: *u8, sout: *u8, eout: *u8, capf: *u8, out: *i64) -> i64
76func main() -> i64