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

Merged
MasterDomino merged 1 commit from upstream-pr/1360 into main 2026-11-24 09:25:07 +00:00
MasterDomino commented 2026-11-24 09:13:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-24T09:13:32Z.


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

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6578447816 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1360). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-24T09:13:32Z. --- 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)
upstream-sync closed this pull request 2026-11-24 10:02:29 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1353
No description provided.