code wiki / _hdl_build / nx_gsplat_frommesh_gate.nx
nx_gsplat_frommesh_gate.nx
buildroot/runtime/_hdl_build/nx_gsplat_frommesh_gate.nx
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
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
structs
| none |
consts
| 33 | const FG_TS: i64 = 18 // triangle record stride, mirrored from gs_tri_stride() |
| 34 | const FG_GS: i64 = 12 // anisotropic gaussian stride (GSTA) |
| 35 | const FG_CAP: i64 = 4096 // fixture gaussian capacity |
| 36 | const FG_STATS: i64 = 4 |
| 37 | const FG_UNIT: i64 = 1024 // one model unit in GFX fixed point |
| 38 | const FG_DENSITY: i64 = 1024 // baseline samples per unit area |
| 39 | const FG_DENSITY_4X: i64 = 4096 // 4x density: shrinks the radius, grows the count |
| 40 | const FG_OPACITY: i64 = 200 |
| 41 | const FG_COL_R: i64 = 240 |
| 42 | const FG_COL_G: i64 = 120 |
| 43 | const FG_COL_B: i64 = 30 |
| 44 | const FG_NORMAL_UNIT: i64 = 256 // GFXA: a unit normal component |
| 45 | const FG_SMALL_CAP: i64 = 3 // deliberately smaller than the fixture requests, to force truncation |
| 46 | const FG_TRIBUF: i64 = 8 // triangles the fixture buffer holds |
functions
| 49 | func fg_tri(tris: *i64, t: i64, sc: i64) -> i64 called by 1: main |
| 58 | func fg_degenerate(tris: *i64, t: i64) -> i64 called by 1: main |
| 67 | func main(argc: i64, argv: *i64) -> i64 |