code wiki / _hdl_build / nx_codegen_improve_loop.nx
nx_codegen_improve_loop.nx
buildroot/runtime/_hdl_build/nx_codegen_improve_loop.nx
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
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
structs
| none |
consts
| none |
functions
| 23 | func cil_is_digit(c: i64) -> i64 { if c < 48 { return 0 } if c > 57 { return 0 } return 1 } called by 1: cil_parse_two |
| 26 | func cil_read_file(path: *u8, buf: *u8, cap: i64) -> i64 |
| 40 | func cil_parse_two(buf: *u8, len: i64, out: *i64) -> i64 |
| 65 | func cil_race(compiler: *u8, sout: *u8, eout: *u8, capf: *u8, out: *i64) -> i64 |
| 76 | func main() -> i64 |