code wiki / (root) / nx_surfacedetail_gate.nx

nx_surfacedetail_gate.nx

buildroot/runtime/nx_surfacedetail_gate.nx

10955 B231 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_surfacedetail_gate.nx -- THE RATCHET FOR THE SURFACE-DETAIL LEVER. WHY THIS EXISTS. On 2026-08-23 the human generator's high-frequency detail ceiling was found to be ONE PICKED CONSTANT -- PF_NB=48 in nx_profile_fit, with no override -- while the oracle holds up to 4096 points per section and the consumer already held 96. Removing it moved the measured ceiling (detail_head 187 -> 231, and shape RECOVERED 900 -> 923 at 1.36M triangles). Without a gate that is a MEASUREMENT, not a RATCHET, and the next lane can re-introduce exactly what was removed. These teeth lock the three properties that make the lever real. SUBJECT: the nx_profile_fit ELF, forked for real. A gate that re-derived the binning in-process would test a copy of the algorithm, not the shipped organ. THE ANTI-VACUITY TOOTH IS THE BITE PAIR AT THE END, AND IT IS THE POINT. T2 (neutrality) and T3 (dev falls) both pass trivially for an organ that IGNORES the bins argument and always emits 48: neutrality holds by definition, and dev-falls could pass on noise. The bite asserts the EMITTED bin count TRACKS THE REQUEST -- 96 when 96 is asked for, 48 when nothing is asked for. An organ that hardcoded the count back would satisfy every other tooth here and fail this one. ALSO LOCKED: the format carries "N <bins>" WITH the data, so a consumer can never assume a resolution the producer did not emit. That is the property that let the ceiling be lifted on both sides independently. 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_surfacedetail_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 sd_declared_bins sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close sd_num_after sd_slen gv_check gv_puts ↻ sys_mmap ↻ sd_run sys_mmap ↻ tr_run_capture

structs

none

consts

28const SD_SUBJECT_DEFAULT: *u8 = "./nx_profile_fit.elf"
29const SD_ORACLE: *u8 = "knowledge/skin.nxmesh"
30const SD_SHIPPED: *u8 = "knowledge/profile_human.dat"
32const SD_DIR: *u8 = "/tmp/nx_surfacedetail_gate"
33const SD_OUT48: *u8 = "/tmp/nx_surfacedetail_gate/p48.dat"
34const SD_OUT96: *u8 = "/tmp/nx_surfacedetail_gate/p96.dat"
35const SD_CANON: *u8 = "/tmp/nx_surfacedetail_gate/c96.dat"
37const SD_CAPTURE_CAP: i64 = 262144
38const SD_FILE_CAP: i64 = 4194304
39const SD_WORD: i64 = 8
40const SD_ARGV_SLOTS: i64 = 16
41const SD_MODE_DIR: i64 = 493 // 0755
42const SD_ASCII_ZERO: i64 = 48
43const SD_ASCII_NINE: i64 = 57
44const SD_DECIMAL: i64 = 10
45const SD_BYTE_MASK: i64 = 255
46const SD_MISS: i64 = 0 - 999999
51const SD_BINS_DEFAULT: i64 = 48
52const SD_BINS_RAISED: i64 = 96

functions

54func sd_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: sd_num_after
57func sd_run(subject: *u8, out: *u8, outlen: *i64, bins: *u8) -> i64
called by 1: main calls 2: sys_mmaptr_run_capture
80func sd_num_after(buf: *u8, n: i64, key: *u8) -> i64
called by 2: sd_declared_binsmain calls 1: sd_slen
122func sd_same(a: *u8, b: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
140func sd_declared_bins(path: *u8) -> i64
147func main(argc: i64, argv: *i64) -> i64