code wiki / _hdl_build / nx_asm_selfheal_test.nx
nx_asm_selfheal_test.nx
buildroot/runtime/_hdl_build/nx_asm_selfheal_test.nx
about
nx_asm_selfheal_test.nx -- the WHOLE loop, from MACHINE CODE up, in one fast pass, clean
RACI. The bug is a real register-pressure miscompile living in emitted x86-64 assembly
(a value live across a call in a caller-saved register). No synthetic probe:
ENGINEER detect (eng_asm_scan) -> finds %rax live across the call, from the .s
DOCTOR fix (doc_asm_fix) -> wraps that call with pushq/popq, into a NEW .s
ENGINEER re-scan (eng_asm_scan) -> the patched .s is CLEAN (0 flags)
ENGINEER execute (eng_link/eng_run) -> broken returns 7 (wrong), fixed returns 42 (right)
COUNCIL admit (cc_council) -> ACTs on the Engineer's runtime verdict
Known answer: detected=1, clean=0, broken-runs=7, fixed-runs=42, council ACT -> exit 0.
All work is in asm_heal_run (fills memory arrays); main stays tiny so the gate that
proves it is not itself a victim of the register-pressure miscompile it heals.
dependencies 4 imports · 0 importers
imports: nx_eng_asm_scan.nxnx_doctor_asm_fix.nxnx_engineer_crash.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
| 18 | func ap_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 19 | func ap_num(v: i64) -> i64 |
| 28 | func tally(r: *i64, n: i64) -> i64 called by 1: main |
| 36 | func asm_heal_run(s: *i64, r: *i64) -> i64 |
| 69 | func asm_heal_report(s: *i64) -> i64 |
| 78 | func main() -> i64 |