code wiki / (root) / nx_gsplat_fit_gate.nx

nx_gsplat_fit_gate.nx

buildroot/runtime/nx_gsplat_fit_gate.nx

10464 B186 linesdepth 3pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic gsplat
docsdependenciesstructsconstsfunctions

about

nx_gsplat_fit_gate.nx -- THE RECONSTRUCTOR TOOTH: can we FIT gaussians to an image, or only PLACE them? WHY THIS GATE EXISTS. Until 2026-08-23 nx_gsplat could optimise COLOUR only. Colour is the easy leg -- a pixel is LINEAR in colour, so the gradient is analytic and a step cannot really go wrong. Position is what 3D Gaussian Splatting actually IS: without it we have a splat RENDERER, not a splat RECONSTRUCTOR, and the whole photoreal-avatar lane rests on reconstruction. gs_pos_grad_step adds the position leg. ★★THE ACCEPT RULE IS DECLARED HERE, BEFORE THE EXPERIMENT, and it is deliberately threshold-free: MONOTONE RECOVERY -- the mean |position - truth| must STRICTLY DECREASE at EVERY step. Not "drops below X", which is a number nobody measured; strict monotonicity over the whole run. This is the ANTI-VACUITY tooth and it is the reason the gate exists: - an implementation whose position gradient is ZERO leaves the error EXACTLY constant -> FAILS - an implementation that JITTERS reduces error sometimes and raises it others -> FAILS - only a gradient that actually points downhill can decrease it every single step. A loss-only tooth would pass all three, which is why loss is reported but is NOT the accept rule. ★AND THE OPTIMUM IS A CONTROL, NOT AN ASSUMPTION. T5 runs the SAME step on a scene ALREADY at truth. A correct gradient is ~0 there and the scene must stay put; a jittering one wanders. The bite is asked both directions -- fires on the perturbed scene, silent on the converged one -- because a step that moves everything passes every "it moved" check ever written. ⚠FIXTURE HONOURS THE DECLARED APPROXIMATION. gs_pos_grad_step ignores transmittance (stated in its own header), so the fixture separates every gaussian in DEPTH: the approximation is exact for a non-overlapping scene, and testing an organ outside its declared domain measures the fixture. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gsplat.nx nx_gate_verdict.nx nx_gsplat_fit_gate.nx

imports: nx_syscalls.nxnx_gsplat.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 ↻ gs_w gs_h sys_mmap ↻ gs_nb gs_expn gs_build_explut fg_truth gs_set gs_fxa gs_render it_sin4096 it_cos4096 it_sin4096 ↻ gs_clear gs_clear_at fg_copy fg_poserr fg_abs gs_fx gs_focal_for

structs

none

consts

30const FG_NG: i64 = 8
31const FG_STEPS: i64 = 12
32const FG_CAMZ: i64 = 30
33const FG_SC: i64 = 400
34const FG_XSTEP: i64 = 2600
35const FG_ZSTEP: i64 = 900
36const FG_PERTURB: i64 = 300 // world units; see T1 for its size in PIXELS, which is what matters
37const FG_W64: i64 = 8
38const FG_BGR: i64 = 26
39const FG_BGG: i64 = 28
40const FG_BGB: i64 = 44

functions

42func fg_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: fg_poserr
45func fg_truth(g: *i64) -> i64
called by 1: main calls 2: gs_setgs_fxa
56func fg_copy(dst: *i64, src: *i64, n: i64) -> i64
called by 1: main
62func fg_poserr(g: *i64, t: *i64) -> i64
called by 1: main calls 1: fg_abs
72func main() -> i64