code wiki / _hdl_build / nx_gsplat_frommesh_gate.nx

nx_gsplat_frommesh_gate.nx

buildroot/runtime/_hdl_build/nx_gsplat_frommesh_gate.nx

8548 B169 linesdepth 3pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic gsplat
docsdependenciesstructsconstsfunctions

about

nx_gsplat_frommesh_gate.nx -- THE GATE FOR MESH -> GAUSSIANS (gs_from_mesh, landed 2026-09-04). The subject is the ingest edge of the splat lane: the estate could render, fit, densify and cage-bind gaussians but could not MAKE them from a mesh, so an authored sculpt could not enter the representation. ★ANTI-VACUITY IS THE POINT OF THIS FILE. A converter that emitted one fixed blob per triangle, ignored the density argument, painted every splat one colour and picked a constant radius would still "produce gaussians" and would pass any tooth that only counted them. So the load-bearing teeth are the ones such an implementation FAILS: density must move the count (T2), density must move the radius INVERSELY (T6), two faces of different size must get the SAME radius at one density (T7 -- uniform coverage is the whole reason the radius is derived rather than picked), and a three-coloured face must yield more than one splat colour (T5). ⚠T6/T7 ARE AN ARITHMETIC IDENTITY, NOT A HOPE: side = isqrt(density*area/GFX^2) and rtan = isqrt(area/nsamp), so rtan reduces to GFX/isqrt(density) -- INDEPENDENT of area. That is why a bigger face gets more splats of the same size instead of bigger splats, and it is checked as an identity. MEASURED on the first run: rtan 32 at density 1024 and 16 at 4096, which is GFX/isqrt(density) exactly. ⚠NEGATIVE CONTROLS CARRIED: an empty mesh must yield nothing rather than fabricate (NC1), and a degenerate zero-area triangle must be skipped without crashing and without inventing a surfel (NC2). ⚠⚠EVERY CONJUNCT IS BUILT WITH NESTED ifs, NEVER WITH gv_env_pair. That helper PRINTS a pair and RETURNS 0, so passing it as a condition feeds the tooth a constant zero. v1 of this gate did exactly that and read 7/12 RED with `[1,1]` printed ahead of every failure -- the pair values proving BOTH conjuncts were true while the tooth recorded FAIL. A helper whose return value is not its meaning is the cheapest way to build a gate that lies in the safe direction. nx_gsplat_frommesh_gate license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_gsplat.nx nx_gate_verdict.nx nx_gsplat_frommesh_gate.nx

imports: nx_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 ↻ fg_tri gs_from_mesh gs_isqrt vm_isqrt gs_set_aniso gv_check gv_puts ↻ gv_check_eq gv_check ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap fg_degenerate gv_values_head gv_puts ↻ gv_kv gv_puts ↻ gv_num ↻

structs

none

consts

33const FG_TS: i64 = 18 // triangle record stride, mirrored from gs_tri_stride()
34const FG_GS: i64 = 12 // anisotropic gaussian stride (GSTA)
35const FG_CAP: i64 = 4096 // fixture gaussian capacity
36const FG_STATS: i64 = 4
37const FG_UNIT: i64 = 1024 // one model unit in GFX fixed point
38const FG_DENSITY: i64 = 1024 // baseline samples per unit area
39const FG_DENSITY_4X: i64 = 4096 // 4x density: shrinks the radius, grows the count
40const FG_OPACITY: i64 = 200
41const FG_COL_R: i64 = 240
42const FG_COL_G: i64 = 120
43const FG_COL_B: i64 = 30
44const FG_NORMAL_UNIT: i64 = 256 // GFXA: a unit normal component
45const FG_SMALL_CAP: i64 = 3 // deliberately smaller than the fixture requests, to force truncation
46const FG_TRIBUF: i64 = 8 // triangles the fixture buffer holds

functions

49func fg_tri(tris: *i64, t: i64, sc: i64) -> i64
called by 1: main
58func fg_degenerate(tris: *i64, t: i64) -> i64
called by 1: main
67func main(argc: i64, argv: *i64) -> i64