code wiki / (root) / nx_dwline_stmt_gate.nx

nx_dwline_stmt_gate.nx

buildroot/runtime/nx_dwline_stmt_gate.nx

10955 B232 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic dwline
docsdependenciesstructsconstsfunctions

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

syscalls.nx nx_elf_read.nx nx_addr2line_lib.nx nx_gate_verdict.nx nx_dwline_stmt_gate.nx

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ sg_run_out gv_check gv_puts ↻ sg_read sg_count_loc nx_elf_parse_header nx_elf_get_u16_le nx_elf_get_u64_le nx_elf_get_u32_le nx_elf_read_shdr nx_elf_get_u32_le ↻ nx_elf_get_u64_le ↻ nx_elf_strtab_at nx_a2l_run_section nx_a2l_prog_off nx_a2l_u32 nx_a2l_run nx_a2l_uleb nx_a2l_sleb gv_puts ↻

structs

none

consts

27const SG_CAP: i64 = 4194304
28const SG_OLD: *u8 = "_offc/nx_cc_sovereign.elf" as *u8
29const SG_NEW: *u8 = "../nx_compile_x86.elf" as *u8
30const SG_SRC: *u8 = "runtime/nx_probe_dbgtiny.nx" as *u8
31const SG_S_OLD: *u8 = "/tmp/nx_dwstmt_old.s" as *u8
32const SG_S_NEW: *u8 = "/tmp/nx_dwstmt_new.s" as *u8

functions

34func sg_run_out(elf: *u8, args: *i64, nargs: i64, outfile: *u8) -> i64
called by 1: main
55func sg_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main
69func sg_count_loc(buf: *u8, n: i64, line: i64) -> i64
called by 1: main
102func main() -> i64