gpu: compare dxr_address_ranges with a direct-address DXR control #1360

Manually merged
github merged 1 commit from gh-pr/1360/head into gh-pr/1360/base 2026-11-26 23:01:03 +00:00
Owner

@⁠MasterDomino on GitHub · 2026-11-24 09:13 UTC · original
MasterDomino:gpu/dxr-address-direct-control → main · +82 −20 · 2 files · 1 commits · merged 2026-11-24 09:25 UTC

Refs #874

dxr_address_ranges_hardware failed on an AMD Radeon RX 9070 XT, although every hit, instance ID, primitive and miss matched. The fixture compared the hit distance with the fixed bits of 1.0 and 2.0, and that adapter returns t one ULP below. As R0Y00 asked on #874, the fixture now adds a native D3D12 control on the same adapter and compares against it.

Change (tests/dxr_check.cpp, check_dxr_address_ranges)

  • AddressScene gets a route:
    • title: unchanged. Builds and instances resolve through era_title_va::Table.
    • direct: the native control, with the same triangles, masks, rays and instance transforms. The two BLAS builds and the TLAS instance descriptors get the two BLAS GPU addresses directly, without the range table. With truncate, both instances explicitly name the left BLAS.
    • misroute_high: the title path, but the high instance is looked up at the low title base on purpose.
  • The check traces five dispatches: title full, direct full, title truncated, direct truncated and misrouted.
    • Hit flag, instance ID and primitive keep their fixed expectations: hit7, miss, miss, hit11 full, and hit7, miss, hit11, miss truncated, on both title and direct.
    • All four words of every ray, distance bits included, must equal the direct-address result: title full against direct full, and title truncated against direct truncated.
    • The bit-40 control is kept: truncation must route both instances to the left BLAS.
    • The misrouted dispatch must differ from the direct full result. Otherwise the fixture fails ("Routing the high instance to the low backing still matched the direct control").
    • All five row sets are printed (dxr_address_rows), along with the distance bits of rays 0 and 3 and of the truncated ray 2 against 1.0 / 2.0 (dxr_address_distance).
  • docs/experiments.md: the paragraph describes the control and the measured bits.

Results

main + this change at f008456f, release preset, MSVC 19.44.35207, DXC 1.8.2502.11, Windows 11 26H2 build 26300.9974, D3D12 debug layer enabled (debug_errors=0 debug_warnings=0).

cmake --build --preset release
ctest --preset release --no-tests=error -R '^dxr_address_ranges_(hardware|warp)$' -V

AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31044.16. Pass:

dxr_address_rows title_full       [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [0,0,0,0x00000000] [1,11,0,0x3fffffff]
dxr_address_rows direct_full      [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [0,0,0,0x00000000] [1,11,0,0x3fffffff]
dxr_address_rows title_truncated  [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [1,11,0,0x3f7fffff] [0,0,0,0x00000000]
dxr_address_rows direct_truncated [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [1,11,0,0x3f7fffff] [0,0,0,0x00000000]
dxr_address_rows misroute_high    [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [1,11,0,0x3f7fffff] [0,0,0,0x00000000]
dxr_address_distance ray0_t=0x3f7fffff (1.0=0x3f800000) ray3_t=0x3fffffff (2.0=0x40000000) truncated_ray2_t=0x3f7fffff (1.0=0x3f800000)

WARP 10.0.26100.9818. Pass:

dxr_address_rows title_full       [1,7,0,0x3f800000] [0,0,0,0x00000000] [0,0,0,0x00000000] [1,11,0,0x40000000]
dxr_address_rows direct_full      [1,7,0,0x3f800000] [0,0,0,0x00000000] [0,0,0,0x00000000] [1,11,0,0x40000000]
dxr_address_rows title_truncated  [1,7,0,0x3f800000] [0,0,0,0x00000000] [1,11,0,0x3f800000] [0,0,0,0x00000000]
dxr_address_rows direct_truncated [1,7,0,0x3f800000] [0,0,0,0x00000000] [1,11,0,0x3f800000] [0,0,0,0x00000000]
dxr_address_rows misroute_high    [1,7,0,0x3f800000] [0,0,0,0x00000000] [1,11,0,0x3f800000] [0,0,0,0x00000000]
dxr_address_distance ray0_t=0x3f800000 (1.0=0x3f800000) ray3_t=0x40000000 (2.0=0x40000000) truncated_ray2_t=0x3f800000 (1.0=0x3f800000)

On the RX 9070 XT the direct-address control gives the same one-ULP-low t as the title path: 0x3f7fffff for 1.0 and 0x3fffffff for 2.0. So the difference comes from that device's triangle intersection, not from address translation. In both backends, the title rows equal the direct rows in all four words. The misrouted high instance changes ray 2 to a hit and ray 3 to a miss, and is caught.

Before this change: at f5d83c31, dxr_address_ranges_hardware failed 3 of 3 times on the same adapter ("mismatch at ray 0"), with the same title rows as above.

Other DXR tests: ctest -R '^(gpu_alias_(warp|hardware)|dxr_.*)$' in release and dev presets on the base 1e8b0570: everything passes except two hardware tests this PR does not touch:

  • dxr_opacity_hardware, the known #1011 failure.
  • dxr_placed_build_hardware. Its fixed expectation {1,7,0,0x3f800000, …} meets the same one-ULP t (0x3f7fffff, 2 of 2 runs, measured with a local print that is not committed). I left it out of this PR and mentioned it on #874.

AI-assisted.

🤖 Generated with Claude Code

**@⁠MasterDomino** on GitHub · 2026-11-24 09:13 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1360) `MasterDomino:gpu/dxr-address-direct-control` → `main` · +82 −20 · 2 files · 1 commits · merged 2026-11-24 09:25 UTC Refs #874 `dxr_address_ranges_hardware` failed on an AMD Radeon RX 9070 XT, although every hit, instance ID, primitive and miss matched. The fixture compared the hit distance with the fixed bits of 1.0 and 2.0, and that adapter returns t one ULP below. As R0Y00 asked on #874, the fixture now adds a native D3D12 control on the same adapter and compares against it. ## Change (`tests/dxr_check.cpp`, `check_dxr_address_ranges`) - `AddressScene` gets a `route`: - `title`: unchanged. Builds and instances resolve through `era_title_va::Table`. - `direct`: the native control, with the same triangles, masks, rays and instance transforms. The two BLAS builds and the TLAS instance descriptors get the two BLAS GPU addresses directly, without the range table. With `truncate`, both instances explicitly name the left BLAS. - `misroute_high`: the title path, but the high instance is looked up at the low title base on purpose. - The check traces five dispatches: title full, direct full, title truncated, direct truncated and misrouted. - Hit flag, instance ID and primitive keep their fixed expectations: `hit7, miss, miss, hit11` full, and `hit7, miss, hit11, miss` truncated, on both title and direct. - All four words of every ray, distance bits included, must equal the direct-address result: title full against direct full, and title truncated against direct truncated. - The bit-40 control is kept: truncation must route both instances to the left BLAS. - The misrouted dispatch must differ from the direct full result. Otherwise the fixture fails ("Routing the high instance to the low backing still matched the direct control"). - All five row sets are printed (`dxr_address_rows`), along with the distance bits of rays 0 and 3 and of the truncated ray 2 against 1.0 / 2.0 (`dxr_address_distance`). - `docs/experiments.md`: the paragraph describes the control and the measured bits. ## Results `main` + this change at `f008456f`, `release` preset, MSVC 19.44.35207, DXC 1.8.2502.11, Windows 11 26H2 build 26300.9974, D3D12 debug layer enabled (`debug_errors=0 debug_warnings=0`). ```powershell cmake --build --preset release ctest --preset release --no-tests=error -R '^dxr_address_ranges_(hardware|warp)$' -V ``` AMD Radeon RX 9070 XT (`1002:7550`), driver `32.0.31044.16`. Pass: ``` dxr_address_rows title_full [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [0,0,0,0x00000000] [1,11,0,0x3fffffff] dxr_address_rows direct_full [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [0,0,0,0x00000000] [1,11,0,0x3fffffff] dxr_address_rows title_truncated [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [1,11,0,0x3f7fffff] [0,0,0,0x00000000] dxr_address_rows direct_truncated [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [1,11,0,0x3f7fffff] [0,0,0,0x00000000] dxr_address_rows misroute_high [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [1,11,0,0x3f7fffff] [0,0,0,0x00000000] dxr_address_distance ray0_t=0x3f7fffff (1.0=0x3f800000) ray3_t=0x3fffffff (2.0=0x40000000) truncated_ray2_t=0x3f7fffff (1.0=0x3f800000) ``` WARP `10.0.26100.9818`. Pass: ``` dxr_address_rows title_full [1,7,0,0x3f800000] [0,0,0,0x00000000] [0,0,0,0x00000000] [1,11,0,0x40000000] dxr_address_rows direct_full [1,7,0,0x3f800000] [0,0,0,0x00000000] [0,0,0,0x00000000] [1,11,0,0x40000000] dxr_address_rows title_truncated [1,7,0,0x3f800000] [0,0,0,0x00000000] [1,11,0,0x3f800000] [0,0,0,0x00000000] dxr_address_rows direct_truncated [1,7,0,0x3f800000] [0,0,0,0x00000000] [1,11,0,0x3f800000] [0,0,0,0x00000000] dxr_address_rows misroute_high [1,7,0,0x3f800000] [0,0,0,0x00000000] [1,11,0,0x3f800000] [0,0,0,0x00000000] dxr_address_distance ray0_t=0x3f800000 (1.0=0x3f800000) ray3_t=0x40000000 (2.0=0x40000000) truncated_ray2_t=0x3f800000 (1.0=0x3f800000) ``` On the RX 9070 XT the direct-address control gives the same one-ULP-low t as the title path: `0x3f7fffff` for 1.0 and `0x3fffffff` for 2.0. So the difference comes from that device's triangle intersection, not from address translation. In both backends, the title rows equal the direct rows in all four words. The misrouted high instance changes ray 2 to a hit and ray 3 to a miss, and is caught. **Before this change:** at `f5d83c31`, `dxr_address_ranges_hardware` failed 3 of 3 times on the same adapter ("mismatch at ray 0"), with the same title rows as above. **Other DXR tests:** `ctest -R '^(gpu_alias_(warp|hardware)|dxr_.*)$'` in `release` and `dev` presets on the base `1e8b0570`: everything passes except two hardware tests this PR does not touch: - `dxr_opacity_hardware`, the known #1011 failure. - `dxr_placed_build_hardware`. Its fixed expectation `{1,7,0,0x3f800000, …}` meets the same one-ULP t (`0x3f7fffff`, 2 of 2 runs, measured with a local print that is not committed). I left it out of this PR and mentioned it on #874. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The title-range fixture compared the hit distance with fixed bits, so it
failed on an RX 9070 XT that returns t one ULP below 1.0 and 2.0 while
every hit, instance and miss matched. Trace the same scene a second time
with the two BLAS GPU addresses given to the builds and the TLAS
directly (both instances on the left BLAS for the truncation control),
and require all four words of every ray to equal that result. Hit,
instance and primitive keep their fixed expectations, the distance bits
are printed against 1.0 and 2.0, and a dispatch that routes the high
instance to the low backing must differ from the direct result.

Refs #874

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:01:01 +00:00
github manually merged commit f008456f0a into gh-pr/1360/base 2026-11-26 23:01:03 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.