nx_texm_ship_gate.nx
buildroot/runtime/nx_texm_ship_gate.nx
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
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
structs
| none |
consts
| 24 | const SG_SUBJECT_DEFAULT: *u8 = "/volume1/homes/elderwesto/nishihost/_offc/nx_nxa_texm.elf" |
| 26 | const SG_INPUT: *u8 = "/volume1/homes/elderwesto/nishihost/sites/nishifamily/world/ref9d.nxa" |
| 29 | const SG_TXM_OK: i64 = 0 |
| 30 | const SG_TXM_BAD: i64 = 3 |
| 32 | const SG_CAPCAP: i64 = 262144 |
| 33 | const SG_ARGVN: i64 = 8 |
| 34 | const SG_MODEDIR: i64 = 493 |
| 35 | const SG_ARGV_BYTES: i64 = 64 |
| 37 | const SG_DIR: *u8 = "/tmp/nx_texm_ship_gate" |
| 38 | const SG_OUT: *u8 = "/tmp/nx_texm_ship_gate/o.nxa" |
| 39 | const SG_FIT512: *u8 = "/tmp/nx_texm_ship_gate/fit512.conf" |
| 40 | const SG_TIGHT: *u8 = "/tmp/nx_texm_ship_gate/tight.conf" |
| 41 | const SG_BIGCAST: *u8 = "/tmp/nx_texm_ship_gate/bigcast.conf" |
| 42 | const SG_UNSRC: *u8 = "/tmp/nx_texm_ship_gate/unsourced.conf" |
| 47 | const 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" |
| 48 | const 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" |
| 49 | const 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" |
| 50 | const 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" |
| 52 | const SG_SHIP: *u8 = "ship" |
functions
| 54 | func 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 |
| 56 | func sg_write(path: *u8, content: *u8) -> i64 |
| 65 | func sg_exists(path: *u8) -> i64 |
| 73 | func sg_ship(subject: *u8, budgetconf: *u8, out: *u8, olen: *i64) -> i64 |
| 86 | func main(argc: i64, argv: *i64) -> i64 |