← ClaudeAtlas

bvh-build-traversallisted

Bounding volume hierarchies for ray tracing and spatial queries covering the SAH cost model and quality metrics, binned SAH, SBVH and early split clipping, LBVH/PLOC GPU builds, wide and compressed BVHs, robust slab traversal, refit vs rebuild, two-level TLAS/BLAS and hardware acceleration-structure flags, compaction and scratch. Load when building, tuning or debugging a BVH or acceleration structure.
rustcircle/c101 · ★ 0 · Web & Frontend · score 65
Install: claude install-skill rustcircle/c101
# BVH build and traversal Rule zero: report SAH cost, box and triangle tests per ray and Mrays/s on a named machine before and after every builder change, and assert identical hits (count and sum of t) across builders. Tested harness and recorded runs: [references/bvh-benchmark.md](references/bvh-benchmark.md). ## 1. SAH cost model and quality metrics ```text split cost C = C_trav + (A_L/A) N_L C_isect + (A_R/A) N_R C_isect leaf cost C_isect N tree cost C_tree = Σ_inner (A_n/A_root) C_trav + Σ_leaf (A_l/A_root) N_l C_isect ``` - A is surface area. C_trav/C_isect ≈ 1 for scalar binary nodes (the benchmark uses 1/1), lower with SIMD triangle tests, higher for wide nodes; state the constants next to every reported cost. - Leaf rule: stop when C_isect N ≤ the best split cost or N ≤ 1-2, but force a split above a cap (16 here) so a degenerate SAH estimate cannot create huge leaves. - Report: SAH cost, end-point overlap (EPO, Aila-Karras-Laine 2013, which predicts traversal cost better than SAH when boxes overlap), box and triangle tests per ray for primary and diffuse rays, Mrays/s, build ms, nodes and bytes, max depth, and a node-visit heatmap per builder (PGM or EXR). ## 2. Builder decision table | Need | Builder | Notes | |---|---|---| | production CPU tracing | Embree 4 (`RTC_BUILD_QUALITY_HIGH` uses spatial splits) or tinybvh | do not ship a hand-rolled builder | | static scene, offline quality | binned SAH with 16-32 bins | O(n log n); the baseline fo