code wiki / (root) / nx_bounds_perf.nx

nx_bounds_perf.nx

buildroot/runtime/nx_bounds_perf.nx

1230 B40 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic bounds
docsdependenciesstructsconstsfunctions

about

nx_bounds_perf.nx -- the COST side of the spatial-safety rung. A hot loop over a fixed array [1024]i64 with a RUNTIME index, which is exactly the shape emit_bounds_check instruments. Compiled by two compilers that differ ONLY in the NX_BOUNDS_CHECK_LIVE const, the delta between the two runs IS the overhead -- no modelling, no estimate. Prints microseconds and the checksum (the checksum also keeps the loop alive against dead-code elimination, and proves both builds computed the SAME answer).

dependencies 1 imports · 0 importers

nx_fmt.nx nx_bounds_perf.nx

imports: nx_fmt.nx

imported by: nobody (leaf or entry point)

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

main fmt_puts fmt_puts_fd sys_write fmt_putn fmt_putn_fd sys_write ↻

structs

none

consts

9const N_ELEM: i64 = 1024
10const N_ITER: i64 = 20000

functions

12func main() -> i64