code wiki / (root) / nx_stubmain_gate.nx

nx_stubmain_gate.nx

buildroot/runtime/nx_stubmain_gate.nx

8002 B114 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_stubmain_gate.nx -- proves the stub-main ruler separates three states and does not invent a fourth. PLANTED FIXTURES ALONE WOULD NOT CALIBRATE THIS. The estate has already measured that a detector bite-proven on planted fixtures can carry a 941-permil false-positive rate on real data. So T5-T8 run the ruler against REAL SOURCES IN THIS TREE whose correct answer is independently known: nx_https_get.nx -> SM_STUB_MAIN (its own comment says `Compile-only smoke.`; measured 2026-09-03 to build 14,880 bytes against a 468,929-byte live binary) nx_https_fetch.nx -> SM_NO_MAIN (nx_catalog independently reports `KIND LIB -- no top-level main()`) nx_npy_gate.nx -> SM_REAL_MAIN (a program shipped and run GREEN on the NAS this session) nx_stubmain_lib.nx -> SM_NO_MAIN (this ruler's own subject is a library) A ruler that cannot classify the four sources whose answers are already known has no business classifying the other 12,063. THE FALSE-POSITIVE TOOTH IS T4, and it is the one that matters: a REAL main whose LAST statement is `return 0` and which contains a nested block must read REAL. A "first closing brace" body-finder would end the body early and report STUB -- turning a working program into a false ARMED row, and a false ARMED on this axis sends a seat to disarm something that is fine, which is how detectors get ignored. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_stubmain_lib.nx nx_stubmain_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_stubmain_lib.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 ↻ sys_mmap ↻ sg_put main ↻ gv_check_eq gv_check gv_puts ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap sm_classify sm_find_line_start sm_streq_at sm_open_brace sm_close_brace sm_body_is_stub sm_is_space sm_streq_at ↻ sm_classify_path

structs

none

consts

24const SG_CAP: i64 = 8192

functions

26func sg_put(b: *u8, o0: i64, s: *u8) -> i64
called by 1: main
33func main() -> i64