code wiki / (root) / nx_gi_path_gate.nx

nx_gi_path_gate.nx

buildroot/runtime/nx_gi_path_gate.nx

9626 B156 linesdepth 5pulls 9 transitivereach 0 importersview sourcekind gate/prooftopic gi
docsdependenciesstructsconstsfunctions

about

nx_gi_path_gate.nx -- THE TEETH OF THE BEAUTY TIER'S FIRST BYTE (graphics GR42 / GR10). In-process over nx_gi_path_lib: no fork, no fixture files, every tooth arithmetic on the tracer's own functions, so the gate runs in well under a second and its RED can only mean the transport changed. Inherits nx_gate_verdict (gv_check / gv_bite / gv_verdict): the exit code IS the verdict, declared == executed by construction, and every neg-control is NAMED so the gatelaw census can see it. WHAT IS PROVEN HERE, and only this: (1) a hit is refined onto the surface (the no-terracing law) and the refinement is load-bearing (the incumbent raymarcher's bare step would miss by more than the tolerance); (2) a path is deterministic byte-for-byte under one seed and changes under another; (3) the linear decode pairs with the display encode (the pale-frame defect fires the neg-control); (4) the cosine-weighted sampler has the cosine mean 2/3 (a uniform sampler's 1/2 fires the neg-control); (5) a straight-up ray is sky-only; (6) transport never gains energy; (7) directions normalise; (8) the palette stays in display range. NOT PROVEN: photorealism, or anything a referee would grade -- that is GR42's UNGRADED cell until a calibrated referee exists. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_gi_path_lib.nx nx_gi_path_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_gi_path_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_head gv_puts sys_write 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 ↻ sys_mmap ↻ gp_norm3 vm_isqrt gp_march gv_check gv_puts ↻ gg_abs gv_bite gv_puts ↻ it_sin4096 it_cos4096 it_sin4096 ↻ gp_trace gp_march ↻ gp_lin gp_clamp gp_normal gp_norm3 ↻ gp_albedo gp_cosine_dir

structs

none

consts

18const GG_SEED: i64 = 77
19const GG_WORDS: i64 = 16
20const GG_SURF_TOL: i64 = 2 // units: a refined hit may sit this far from the terrain surface (2^-8 of a step, rounded up)
21const GG_DOWN_Y: i64 = 0 - 700 // a ray pitched down toward the terrain (fx1024 components before normalising)
22const GG_DOWN_Z: i64 = 731
23const GG_SAMPLES: i64 = 4096 // cosine-sampler census size
24const GG_COS_MEAN: i64 = 683 // E[cos] over a cosine-weighted hemisphere = 2/3, in fx1024
25const GG_UNIFORM_MEAN: i64 = 512 // E[cos] over a UNIFORM hemisphere = 1/2: the wrong sampler's signature
26const GG_COS_TOL: i64 = 24 // 4096 samples of an integer sampler: 3 sigma is ~14, the band is wider than that on purpose
27const GG_RT_TOL: i64 = 1 // sqrt(lin(c)*255) must land within one display step of c
28const GG_LEN_TOL: i64 = 2
29const GG_N_PROBES: i64 = 5
30const GG_PITCH_STEP: i64 = 512 // yaw step between fixture probe rays (1/8 turn)
31const GG_PITCH_LIFT: i64 = 60 // each probe pitches a little higher so one of them clears the lake

functions

33func gg_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: main
35func gg_nl() -> i64 { let b: *u8 = sys_mmap(2); b[0] = 10 as u8; sys_write(1, b, 1); sys_munmap(b, 2); return 0 }
called by 1: main calls 3: sys_mmapsys_writesys_munmap
37func main() -> i64