code wiki / (root) / nx_skin_pbr_gate.nx

nx_skin_pbr_gate.nx

buildroot/runtime/nx_skin_pbr_gate.nx

17529 B322 linesdepth 6pulls 16 transitivereach 0 importersview sourcekind gate/prooftopic skin
docsdependenciesstructsconstsfunctions

about

nx_skin_pbr_gate.nx -- GATE for the PBR map set (charsim R4, debt 1786549493 residue b+d). THE TOOTH THAT MATTERS IS T7: the four maps must differ from EACH OTHER. An implementation that returned albedo four times would pass every other tooth here and produce four files, which is exactly the "file count moved, nothing else did" failure the rung was written to avoid. T1 proves F0 is DERIVED, not typed: it recomputes Fresnel from the declared index and compares. T4 is the anti-vacuity tooth: a relief field that was constant would give perfect unit-length normals and perfect determinism while encoding no surface at all. The physics teeth need no fixture, so this gate does not duplicate the sibling texbake fixture. license_tier: ORIGINAL expect_exit: 0

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_nxa.nx nx_nxa_texc_lib.nx nx_nxa_texbake_lib.nx nx_gate_verdict.nx nx_skin_pbr_gate.nx

imports: nx_syscalls.nxnx_nxa.nxnx_nxa_texc_lib.nxnx_nxa_texbake_lib.nxnx_gate_verdict.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 ↻ ntb_f0_skin gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap sp_abs gv_check gv_puts ↻ ntb_rough_of_region sys_mmap ↻ ntb_normal_at ntb_relief_h rlf_relief_h rlf_noise3 rlf_hash3 rlf_relief_lat rlf_texel_um ntb_encode_normal ntb_encode_normal_um

structs

none

consts

16const SP_REF: *u8 = "sites/nishifamily/world/ref9d.nxa"
17const SP_TMP: *u8 = "/tmp/nxpbr_ref9d.nxa"
18const SP_RES: i64 = 128
19const SP_RES4K: i64 = 4096
20const SP_SEED: i64 = 7
21const SP_SEED2: i64 = 8
22const SP_HUE: i64 = 500
23const SP_F0_PUBLISHED: i64 = 28 // ((1.4-1)/(1.4+1))^2 = 0.0278 -> 28 per mille, the textbook skin F0
24const SP_F0_TOL: i64 = 2
25const SP_LEN_TOL: i64 = 12 // unit-length tolerance on the decoded normal (127 nominal)
26const SP_NOM: i64 = 127
27const SP_MID: i64 = 128
28const SP_SAMPLES: i64 = 64
29const SP_BADMAP: i64 = 99
30const SP_POLES: i64 = 5
31const SP_UNIT: i64 = 4096 // nx_trimesh represents 1.0 as 4096 in its normal fixed point
32const SP_DIAG: i64 = 2364 // 4096/sqrt(3), the unit diagonal in that same fixed point
33const SP_VEC_TOL: i64 = 140 // integer residue across two normalisations, ~3 percent of unit
34const SP_TILT: i64 = 1200 // a real tangent tilt, not a whisper
56const SP_CONV_RES_MIN: i64 = 8 // TXM_RES_MIN: the smallest bake the TEXM writer accepts
57const SP_CONV_RES_MAX: i64 = 4096 // SP_RES4K: the floor T8 already bakes; the walk never exceeds it
58const SP_CONV_STEP: i64 = 2 // the walk doubles -- every legal texture size is a power of two
59const SP_RISE_STEPS: i64 = 4 // quantisation steps the fixture gradient must move G by before the
62const SP_GRAD_FULL: i64 = 1023 // NTB_H_RANGE: the full relief codomain, the steepest gradient the

functions

65func sp_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: main
66func sp_bytes(res: i64) -> i64 { return res*res*3 + 64 }
called by 1: main
67func sp_ck(m: *u8, n: i64) -> i64
called by 1: main
74func main(argc: i64, argv: *i64) -> i64