nx_bvh_test.nx
buildroot/runtime/nx_bvh_test.nx
about
nx_bvh_test.nx -- exercise BVH build on tetrahedron mesh in both
single-leaf and forced-multi-node configurations.
Closed-form invariants:
(a) Default-threshold build on tetrahedron (4 tris, threshold=4)
yields exactly 1 node (a single leaf with count=4).
(b) Root AABB matches mesh bbox: (0,0,0) to (EDGE,EDGE,EDGE).
(c) Sum of leaf counts == n_tris.
(d) leaf_threshold=2 forces the tetrahedron to split, producing
>= 3 nodes (1 internal + 2 leaves minimum) and a tree where
sum of leaf counts is still 4.
(e) Internal node's right child index == left + 1 (depth-first
sibling-adjacency invariant).
(f) Empty mesh degenerate: n_tris=0 returns BVH with n_tris=0.
expect_exit: 0
license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_mesh.nxnx_mesh_print_check.nxnx_bvh.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
| 24 | const EDGE_Q14: i64 = 16384 |
functions
| 26 | func main() -> i64 |