gpu: preserve precision in scaled DXR reference rays #206
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/209"
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-21T18:26:04Z.
Change
Compute the inverse instance scale in double precision when transforming a ray direction for the DXR CPU reference. For a triangle at world z = 1.5 and a ray starting at z = −0.5, the previous float division produced a distance slightly below 2. That caused the reference to accept a hit at its open upper endpoint.
Add a z-scaled instance to the existing facing fixture and check the clipped ray separately on the CPU. The regular DXR comparison exercises both primitives from both directions with three culling flag settings.
Verification
Windows x64 build 26200, MSVC 19.44.35230, Debug, based on
1a88110.With the new fixture and the previous direction transform both cases failed before the GPU trace, reporting
Scaled CPU ray: expected miss at farT=2, instance=8 t=1.9999999403953568.With double-precision direction division, the CPU rejected the clipped ray and reproduced the hand-derived distances and facing table for all 96 interior rays. Both CTests passed with zero skips:
The existing twelve shared-edge and control rays also passed on each backend. The D3D12 debug layer was unavailable.
Evidence and follow-up
The fixture consists of original MIT-licensed C++ geometry and rays. The added instance scales world z by 1.5, so the unit z direction becomes 2/3 in object space. The CPU comparison checks exact hit distances of 2 and 3 for the interior probes. The GPU comparison uses the existing relative tolerance. Only the CPU receives the endpoint probe.
This contribution was AI-assisted.
Checklist
docs/experiments.md.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T18:26:14Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
760593eℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.