Skip to content

shader: correct FP32 BVH descriptor byte units and child results - #3040

Merged
R0Y00 merged 1 commit into
R0Y00:mainfrom
chadhyatt:backport/bvh-fp32-correctness
Nov 27, 2026
Merged

R0Y00 merged 1 commit into
R0Y00:mainfrom
chadhyatt:backport/bvh-fp32-correctness

Conversation

@chadhyatt

Copy link
Copy Markdown
Contributor

AI-assisted backport patch from x2w-microlift

Refs #2922, #3032. Decode the 40-bit descriptor base in 256-byte units, preserve all four descriptor DWORDs and refuse unsupported 48-bit node-address wraps. With sorting disabled, keep original child slots; sorted misses use +infinity so valid FLT_MAX hits sort first.

Source-built regression cases compare the public independent box model, exact descriptor literal/manifest values, unsorted holes and the infinity boundary. GPU dispatch controls exercise actual emitted HLSL mutations when available. No runtime BVH binding changes.

Verified commit 5d325d3 on Apple Silicon macOS: python3 -B tests/gfx1030_bvh_box/check.py --model-only (315 witnesses, 231 node, 84 pointer, 0 mismatches); python3 -B tests/startup_gfx2hlsl_bvh_check.py (all checks passed; DXC compile capability skipped). Windows GPU dispatch not run.

The overlapping binary16 extension should carry the same semantics; see coordination in #3032.

Decode the 40-bit descriptor base in 256-byte units and preserve the full encoded words. Preserve unsorted result slots and use positive-infinity miss keys. Refuse unsupported 48-bit node wraps.
Source-built model and translator checks passed; DXC/GPU execution not available on this host.
AI-assisted backport patch from x2w-microlift

Copy link
Copy Markdown
Contributor

Independent Windows verification at 5d325d30390e7864f1bd3da53306cbfe0a4cafd3: the source-built tests/gfx1030_bvh_box/check.py --model-only suite matched all 315 witnesses. python -B tests/startup_gfx2hlsl_bvh_check.py dispatch <dxc> <offscreen_check> <backend> passed all 11 baseline cases and caught all five mutations on both in-box WARP (10.0.26100.10068) and RTX 4070 (32.0.16.2124). In particular the low/high descriptor-base controls, unsorted holes and FLT_MAX/miss boundary passed on both. Windows 26300.10075, SDK DXC 1.9.2602.17, existing MSVC Release runner using its unchanged --raw-uav-dump path. D3D12 debug enabled, zero errors or warnings and no skips.

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5d325d30 on main 67e60e8f (tested integration tree 2bdf003a). python -B tests/gfx1030_bvh_box/check.py --model-only matched all 315 witnesses, and python -B tests/startup_gfx2hlsl_bvh_check.py passed. The fixture's dispatch <dxc> <offscreen_check> <warp|hardware> invocation passed 11 baseline cases and caught all five mutations on WARP and RTX with both Debug and Release /O2 renderers. The unchanged renderer and adapter helper sources match the reusable builds. Encoded 40-bit base fields, unsorted child holes, and the FLT_MAX boundary matched. Windows 11 26200.9974, SDK 10.0.26100, WARP 10.0.26100.9818, RTX 4060 Laptop driver 32.0.16.1656, debug layer enabled, no errors or warnings, no skips. Hosted Windows, Linux Python and gfx1013 passed. #3032 should take this corrected descriptor and child-order baseline before its binary16 extension.

@R0Y00
R0Y00 merged commit 1c87950 into R0Y00:main Nov 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants