nx_regalloc_soundness_test.nx
buildroot/runtime/nx_regalloc_soundness_test.nx
about
nx_regalloc_soundness_test.nx -- BITS-UP soundness proof for the allocator
running on compute_liveness' (correct) intervals. Builds a loop where K
values are all live across the body (defined in entry, used in the header
each iteration -> live across the back-edge), runs the FULL allocator flow
WITH compute_liveness enabled, then checks the interference invariant:
for every pair of values that are BOTH register-homed and whose
(post-liveness) intervals OVERLAP, their registers MUST differ.
A violation = linear-scan handed two simultaneously-live values the same
register = a real miscompile source. Zero blast radius (executes the
allocator, not the built IR).
exit 0 = sound. 50 = an interference violation (prints the pair). other =
setup divergence.
license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_types.nxnx_ir.nxnx_regalloc.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
| 20 | const K: i64 = 24 // values live across the loop body (>16 GPRs -> forces spills) |
functions
| 22 | func main() -> i64 |