code wiki / _hdl_build / nx_gltf2mesh_units_gate.nx

nx_gltf2mesh_units_gate.nx

buildroot/runtime/_hdl_build/nx_gltf2mesh_units_gate.nx

11760 B237 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic gltf2mesh
docsdependenciesstructsconstsfunctions

about

nx_gltf2mesh_units_gate.nx -- THE GATE FOR UNIT DETERMINATION IN THE glTF INGEST. WHAT IT GUARDS. nx_gltf2mesh used to carry a hardcoded 500-2500mm window and refuse anything outside it. That window was ANTHROPOMETRY -- "the subject is a HUMAN between 0.5 and 2.5 metres" -- welded into a FORMAT CONVERTER. Measured 2026-08-22 over the full 18-file GLB population (corpus_complete=1) it refused 2 of 18 assets, both a legitimate 2.615 m character, for being 115 mm too tall. glTF 2.0 fixes the unit of length as the METRE, so a conformant donor needs no guessing at all; the sniffing exists only for donors authored in another power of 1000. THE SUBJECT IS FORKED FOR REAL. The organ's contract is its EXIT CODE (0 convert, 8 refuse-units, 2 usage) and /api/gate_run derives verdicts from exit codes, so every tooth here asserts an exit code. Output markers are checked only where the exit code alone cannot distinguish two states. THE NEGATIVE CONTROL IS LOAD-BEARING AND IT IS T4. A guard that ACCEPTS EVERYTHING passes every accept-test, so proving "the 2.615 m human now converts" is only half a proof. T4 forces the refusal branch by pointing the organ at a /tmp conf whose floor no scale can clear, and gv_bite judges T1 and T4 together: it must fire on the bad input AND stay silent on the good one. FIXTURES ARE /tmp ONLY. The organ's units_conf= override exists precisely so this gate never edits the production conf -- a gate that shares a fixture with a production beat reports on the fixture rather than on the code, which is how a RED can track scratch state instead of a defect. 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_gltf2mesh_units_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 ug_unlink sys_unlinkat ug_write_text sys_openat_wr sys_write ↻ sys_close gv_check gv_puts ↻ ug_size sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ sys_mmap ↻

structs

none

consts

28const UG_SUBJECT_DEFAULT: *u8 = "_offc/nx_gltf2mesh.elf"
31const UG_EXIT_OK: i64 = 0
32const UG_EXIT_REFUSE_UNIT: i64 = 8
37const UG_HUMAN: *u8 = "/volume1/homes/elderwesto/nishihost/sites/nishifamily/synth/human.glb"
38const UG_ELF: *u8 = "/volume1/homes/elderwesto/nishihost/sites/nishifamily/synth/elf.glb"
40const UG_DIR: *u8 = "/tmp/nx_gltf2mesh_units_gate"
41const UG_CONF_REAL: *u8 = "/tmp/nx_gltf2mesh_units_gate/real.conf"
42const UG_CONF_ABSURD:*u8 = "/tmp/nx_gltf2mesh_units_gate/absurd.conf"
43const UG_CONF_NONE: *u8 = "/tmp/nx_gltf2mesh_units_gate/no_such_conf_at_all"
44const UG_OUT_HUMAN: *u8 = "/tmp/nx_gltf2mesh_units_gate/human.nxmesh"
45const UG_OUT_ELF: *u8 = "/tmp/nx_gltf2mesh_units_gate/elf.nxmesh"
46const UG_OUT_NEG: *u8 = "/tmp/nx_gltf2mesh_units_gate/neg.nxmesh"
47const UG_OUT_DFLT: *u8 = "/tmp/nx_gltf2mesh_units_gate/dflt.nxmesh"
48const UG_BADMAGIC: *u8 = "/tmp/nx_gltf2mesh_units_gate/not_a_glb.bin"
49const UG_OUT_BAD: *u8 = "/tmp/nx_gltf2mesh_units_gate/bad.nxmesh"
51const UG_ARG_REAL: *u8 = "units_conf=/tmp/nx_gltf2mesh_units_gate/real.conf"
52const UG_ARG_ABSURD: *u8 = "units_conf=/tmp/nx_gltf2mesh_units_gate/absurd.conf"
53const UG_ARG_NONE: *u8 = "units_conf=/tmp/nx_gltf2mesh_units_gate/no_such_conf_at_all"
59const UG_CONF_REAL_TXT: *u8 = "sliver_floor_mm=100\n"
60const UG_CONF_ABSURD_TXT: *u8 = "sliver_floor_mm=100000000\n"
61const UG_BADMAGIC_TXT: *u8 = "this is definitely not a binary glTF container\n"
63const UG_CAPTURE_CAP: i64 = 262144
64const UG_ARGV_SLOTS: i64 = 8
65const UG_MODE_DIR: i64 = 493 // 0755
66const UG_WORD: i64 = 8
67const UG_MIN_MESH_BYTES: i64 = 1000 // a real conversion of a 2530-vertex donor is >100 kB;

functions

70func ug_write_text(path: *u8, s: *u8) -> i64
81func ug_size(path: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
90func ug_has(buf: *u8, n: i64, lit: *u8) -> i64
called by 1: main
106func ug_run(subject: *u8, a1: *u8, a2: *u8, a3: *u8, out: *u8, olen: *i64) -> i64
called by 1: main calls 2: sys_mmaptr_run_capture
116func main(argc: i64, argv: *i64) -> i64