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

Manually merged
github merged 1 commit from github-bot/gh-3040 into gh-pr/3040/base 2026-11-27 11:31:27 +00:00 AGit
Owner

@⁠chadhyatt on GitHub · 2026-11-27 10:18 UTC · original
chadhyatt:backport/bvh-fp32-correctness → main · +202 −122 · 3 files · 1 commits · merged 2026-11-27 11:29 UTC

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 5d325d3039 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.

**@⁠chadhyatt** on GitHub · 2026-11-27 10:18 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3040) `chadhyatt:backport/bvh-fp32-correctness` → `main` · +202 −122 · 3 files · 1 commits · merged 2026-11-27 11:29 UTC 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 5d325d30390e7864f1bd3da53306cbfe0a4cafd3 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
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 10:41:44 +00:00
Author
Owner

@⁠RonLogic on GitHub · 2026-11-27 10:29 UTC · original

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.

**@⁠RonLogic** on GitHub · 2026-11-27 10:29 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3040#issuecomment-7215955452) 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.
github-bot changed target branch from main to gh-pr/3040/base 2026-11-27 11:31:26 +00:00
github manually merged commit 5d325d3039 into gh-pr/3040/base 2026-11-27 11:31:27 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-27 11:29 UTC · original · approved these changes

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** on GitHub · 2026-11-27 11:29 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3040#pullrequestreview-6087460255) · **approved these changes** 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.