code wiki / (root) / nx_texm_ship_gate.nx

nx_texm_ship_gate.nx

buildroot/runtime/nx_texm_ship_gate.nx

8158 B166 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_texm_ship_gate.nx -- THE GATE FOR THE DERIVED SHIP RESOLUTION. SUBJECT: the nx_nxa_texm ELF, ship mode, forked for real. tex_res_floor stays the MEASURED bar; ship mode DERIVES the largest power-of-two rung whose measured bytes*cast_size fit a declared texture budget, and REFUSES when the budget is unsourced/absent or nothing fits. This gate proves the derivation RESPONDS to its inputs (budget and cast size) and abstains when it cannot decide -- never silently defaulting. EVERY BUDGET FIXTURE IS WRITTEN AT RUNTIME under /tmp/nx_texm_ship_gate/ and passed to the organ via its conf-path OVERRIDE (4th arg), so the gate never mutates the tracked production budget conf -- a gate that shares a fixture with a production conf reports on the fixture. The override arg exists precisely so this test is clean. ALL FIXTURES SELECT 512 OR REFUSE, ON PURPOSE: a 512 bake is fast and a refusal skips the bake entirely, so the gate finishes inside any caller deadline. A budget that selected 2048/4096 would derive correctly but bake slowly -- correctness is proven by the 512 case plus the discrimination pairs, not by paying for a large bake. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_tool_run.nx nx_texm_ship_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_tool_run.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 ↻ gv_puts ↻ sys_mkdir sys_unlinkat sg_write sg_slen sys_openat_wr sys_write ↻ sys_close sg_exists sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ gv_check gv_puts ↻ sys_mmap ↻

structs

none

consts

24const SG_SUBJECT_DEFAULT: *u8 = "/volume1/homes/elderwesto/nishihost/_offc/nx_nxa_texm.elf"
26const SG_INPUT: *u8 = "/volume1/homes/elderwesto/nishihost/sites/nishifamily/world/ref9d.nxa"
29const SG_TXM_OK: i64 = 0
30const SG_TXM_BAD: i64 = 3
32const SG_CAPCAP: i64 = 262144
33const SG_ARGVN: i64 = 8
34const SG_MODEDIR: i64 = 493
35const SG_ARGV_BYTES: i64 = 64
37const SG_DIR: *u8 = "/tmp/nx_texm_ship_gate"
38const SG_OUT: *u8 = "/tmp/nx_texm_ship_gate/o.nxa"
39const SG_FIT512: *u8 = "/tmp/nx_texm_ship_gate/fit512.conf"
40const SG_TIGHT: *u8 = "/tmp/nx_texm_ship_gate/tight.conf"
41const SG_BIGCAST: *u8 = "/tmp/nx_texm_ship_gate/bigcast.conf"
42const SG_UNSRC: *u8 = "/tmp/nx_texm_ship_gate/unsourced.conf"
47const SG_FIT512_C: *u8 = "res_bytes_512 148080\nres_bytes_1024 846904\nres_bytes_2048 5774640\nres_bytes_4096 31563984\ncast_size 12\ntexture_budget_bytes 2000000\n"
48const SG_TIGHT_C: *u8 = "res_bytes_512 148080\nres_bytes_1024 846904\nres_bytes_2048 5774640\nres_bytes_4096 31563984\ncast_size 12\ntexture_budget_bytes 1000000\n"
49const SG_BIGCAST_C: *u8 = "res_bytes_512 148080\nres_bytes_1024 846904\nres_bytes_2048 5774640\nres_bytes_4096 31563984\ncast_size 100\ntexture_budget_bytes 2000000\n"
50const SG_UNSRC_C: *u8 = "res_bytes_512 148080\nres_bytes_1024 846904\nres_bytes_2048 5774640\nres_bytes_4096 31563984\ncast_size 12\ntexture_budget_bytes UNSOURCED\n"
52const SG_SHIP: *u8 = "ship"

functions

54func sg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: sg_write
56func sg_write(path: *u8, content: *u8) -> i64
65func sg_exists(path: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
73func sg_ship(subject: *u8, budgetconf: *u8, out: *u8, olen: *i64) -> i64
called by 1: main calls 2: sys_mmaptr_run_capture
86func main(argc: i64, argv: *i64) -> i64