nx_dwline_stmt_gate.nx
buildroot/runtime/nx_dwline_stmt_gate.nx
about
nx_dwline_stmt_gate.nx -- DOES STATEMENT GRANULARITY ACTUALLY BEAT FUNCTION GRANULARITY?
DDR-006 rung 2. Rung 1 emitted ONE .loc per function. This gate does not merely assert that the
new compiler emits line info -- rung 1 did that too, and a gate that both versions pass measures
nothing. It runs the SAME probe through BOTH compilers and measures the DIFFERENCE:
OLD _offc/nx_cc_sovereign.elf (blessed 3bd47652, function granularity) -> lines {5, 9}
NEW ../nx_compile_x86.elf (statement granularity) -> must ALSO carry 6 and 10
runtime/nx_probe_dbgtiny.nx:
L5 func dbgtiny_a() -> i64 { L6 return 1 L7 }
L9 func main() -> i64 { L10 return dbgtiny_a() L11 }
so lines 6 and 10 are STATEMENT lines that function granularity CANNOT produce, and lines 5 and 9
are the function lines it already produced. THE OLD COMPILER IS THE NEGATIVE CONTROL, and it is
what makes this a measurement of the improvement rather than a restatement of the feature.
Deliberately reads the ".s" rather than the ELF: the claim under test is what the COMPILER emits.
nx_dwline_e2e_gate already proves the assembler and decoder carry it through to a real ELF, so
duplicating that here would test the wrong subject.
license_tier: ORIGINAL expect_exit: 0
dependencies 4 imports · 0 importers
imports: syscalls.nxnx_elf_read.nxnx_addr2line_lib.nxnx_gate_verdict.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
| 27 | const SG_CAP: i64 = 4194304 |
| 28 | const SG_OLD: *u8 = "_offc/nx_cc_sovereign.elf" as *u8 |
| 29 | const SG_NEW: *u8 = "../nx_compile_x86.elf" as *u8 |
| 30 | const SG_SRC: *u8 = "runtime/nx_probe_dbgtiny.nx" as *u8 |
| 31 | const SG_S_OLD: *u8 = "/tmp/nx_dwstmt_old.s" as *u8 |
| 32 | const SG_S_NEW: *u8 = "/tmp/nx_dwstmt_new.s" as *u8 |
functions
| 34 | func sg_run_out(elf: *u8, args: *i64, nargs: i64, outfile: *u8) -> i64 called by 1: main |
| 55 | func sg_read(path: *u8, buf: *u8, cap: i64) -> i64 called by 1: main |
| 69 | func sg_count_loc(buf: *u8, n: i64, line: i64) -> i64 called by 1: main |
| 102 | func main() -> i64 |