Count in-plane box candidates in the BVH CPU reference #116
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/117"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T16:31:35Z.
Change
The CPU reference behind
bvh_hitsandbvh_packedskipped every leaf for rays with a zero depth component, so it reported no box candidates for a ray lying in a leaf row's plane.TraceHitsaccepts those flat boxes through its zero-direction slab branch (origin inside the zero-thickness[lo, hi]range). The reference now computes the closed in-plane overlap in double precision. Such rays still never hit a triangle, matching the shader's zero-determinant rule. Two coplanar rays were added: one crosses the first row, the other ends exactly on the third box's face.docs/experiments.mdis updated for 132 rays and the new miss counts.Verification
Linux (no D3D12): the anonymous-namespace code of
tests/bvh_hits.cppwas compiled with g++ and clang++ and compared with a float C++ port ofTraceHits' slab test, triangle test, counts and tie rule. Without the reference change, the two new rays gave 6 mismatches in the box count (reference 0, shader 8/3, 2/2, 8/3 across the three scenes). With it, 132 rays x 3 scenes gave 0 mismatches. The existing 130 rays already agreed before the change.Windows:
ctest --preset dev --no-tests=error -R 'bvh_hits|bvh_packed|bvh_differential' -Vat839bf85(rebased on main with #99) on Windows 11 build 26200.9974, VS Build Tools 2022 17.14 (MSVC 14.44.35207), Windows SDK 10.0.26100: 6/6 passed on an NVIDIA GeForce RTX 5080 (driver 32.0.16.1692) and on WARP (Microsoft Basic Render Driver). The D3D12 debug layer was not available.bvh_differentialoutput is identical to upstream main. On upstream main the same command reportsrays=130, misses 18/116/22 andrays_per_run=390.Evidence and follow-up
No new fixture data; the geometry is source-built. Treating a coplanar ray as a box candidate but never a triangle hit is a fixture convention that follows the shader.
bvh_differentialkeeps its own ray list and is unchanged. Rays with infinite or NaN direction components remain uncovered.Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-21T16:49:21Z.
Second GPU at
daad822: RTX 3060 (driver 32.0.15.9636) on Windows 10 22H2 (19045.6466), VS Build Tools 17.14, SDK 10.0.26100, debug layer unavailable.bvh_hits_hardware,bvh_packed_hardwareandbvh_differential_hardwarepassed, with output identical to your RTX 5080 run:The WARP variants could not be checked here. On Windows 10 WARP (SM 6.2),
bvh_hits_warpandbvh_packed_warpfail at pipeline creation, which is the issue #99 fixed and this branch predates.AI-assisted (Claude Code); run locally on the configuration above.
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T17:04:29Z.
Thanks for the RTX 3060 / Windows 10 run. I rebased the branch onto current main (now
839bf85), so it includes #99 and the cs_6_5 fixtures should skip instead of failing on Windows 10 WARP (SM 6.2). No change to the commit itself.Re-run at
839bf85on Windows 11 26200.9974 (RTX 5080, driver 32.0.16.1692, and WARP):ctest --preset dev --no-tests=error -R 'bvh_hits|bvh_packed|bvh_differential' -Vpassed 6/6 with the same output (rays=132, misses 20/118/24,rays_per_run=396).