gpu: compare dxr_placed_build with a direct-address DXR reference #1612

Merged
MasterDomino merged 1 commit from upstream-pr/1619 into main 2026-11-24 15:17:25 +00:00
MasterDomino commented 2026-11-24 15:07:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-24T15:07:30Z.


Refs #874

dxr_placed_build_{hardware,warp} now compares the slot-133 placed DXR path with a direct-address reference on the same adapter, as R0Y00 asked on #874. This follows #1360. It replaces the 1e-5 hit-distance tolerance from 82680176.

Change

  • check_dxr_placed_build traces three scenes with trace_placed_triangle:
    • placed: the path under test.
    • direct: the reference. It has the same geometry, build and instance inputs, rays and readback shader, with desktop GPU addresses given directly. Only the placed-address resolver is bypassed; this is the same call tests/cpu/placed_dxr_provider.cpp already uses for its reference.
    • misrouted: the wrong-routing control.
  • Checks:
    • placed and direct must both match the fixed expectations in hit, instance and primitive: hit instance 7, a spatial miss, a masked miss, with zero miss rows;
    • all 12 placed words, distance included, must equal the direct words;
    • the misrouted rows must differ from the direct rows.
  • Output: the three row sets (placed_dxr_rows) and the measured distance bits against the mathematical 0x3f800000 (placed_dxr_distance).
  • Wrong-routing control: PlacedBuildScene::misroute builds a decoy BLAS from the same triangle moved 4 units right. The decoy has its own placed destination and scratch, resolved through the same resolve_placed_build, and the TLAS instance is routed to it. trace_scene builds the decoy in the same command list, with a UAV barrier, as the address-range fixture already does.
  • Unchanged: the #1326 refusal controls (unregistered destination, short scratch, swapped roles) still run in every placed scene. The comparison applies to all adapters, and there is no general distance tolerance.
  • docs/experiments.md: the paragraph now describes the reference and the measured bits, keeping the RX 6600 note.

Results

main + this change at 8e0eb6cd (on 4aefce63). Windows 11 26H2, build 26300.9974. MSVC 19.44.35207, DXC 1.8.2502.11. D3D12 debug layer enabled, with debug_errors=0 debug_warnings=0 on both backends.

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

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

placed_dxr_rows placed    [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [0,0,0,0x00000000]
placed_dxr_rows direct    [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [0,0,0,0x00000000]
placed_dxr_rows misrouted [0,0,0,0x00000000] [1,7,0,0x3f7fffff] [0,0,0,0x00000000]
placed_dxr_distance placed=0x3f7fffff direct=0x3f7fffff (1.0=0x3f800000)

WARP 10.0.26100.9818: pass.

placed_dxr_rows placed    [1,7,0,0x3f800000] [0,0,0,0x00000000] [0,0,0,0x00000000]
placed_dxr_rows direct    [1,7,0,0x3f800000] [0,0,0,0x00000000] [0,0,0,0x00000000]
placed_dxr_rows misrouted [0,0,0,0x00000000] [1,7,0,0x3f800000] [0,0,0,0x00000000]
placed_dxr_distance placed=0x3f800000 direct=0x3f800000 (1.0=0x3f800000)

On the RX 9070 XT the placed and direct paths give the same one-ULP-short distance. As with #1360, that difference comes from the adapter's intersection, not from the placed-address path.

Other DXR tests:

  • ctest -R '^(dxr_.*|cpu_placed_dxr_.*|gpu_alias_(warp|hardware))$' in dev: 23/24 pass. The release DXR set: 21/22.
  • In both, the only failure is the known dxr_opacity_hardware (#1011).
  • cpu_placed_dxr_{hardware,warp}, which share trace_placed_triangle, pass.

AI-assisted.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6584881808 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1619). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-24T15:07:30Z. --- Refs #874 `dxr_placed_build_{hardware,warp}` now compares the slot-133 placed DXR path with a direct-address reference on the same adapter, as R0Y00 asked on #874. This follows #1360. It replaces the 1e-5 hit-distance tolerance from `82680176`. ## Change - **`check_dxr_placed_build`** traces three scenes with `trace_placed_triangle`: - **placed:** the path under test. - **direct:** the reference. It has the same geometry, build and instance inputs, rays and readback shader, with desktop GPU addresses given directly. Only the placed-address resolver is bypassed; this is the same call `tests/cpu/placed_dxr_provider.cpp` already uses for its reference. - **misrouted:** the wrong-routing control. - **Checks:** - placed and direct must both match the fixed expectations in hit, instance and primitive: hit instance 7, a spatial miss, a masked miss, with zero miss rows; - all 12 placed words, distance included, must equal the direct words; - the misrouted rows must differ from the direct rows. - **Output:** the three row sets (`placed_dxr_rows`) and the measured distance bits against the mathematical `0x3f800000` (`placed_dxr_distance`). - **Wrong-routing control:** `PlacedBuildScene::misroute` builds a decoy BLAS from the same triangle moved 4 units right. The decoy has its own placed destination and scratch, resolved through the same `resolve_placed_build`, and the TLAS instance is routed to it. `trace_scene` builds the decoy in the same command list, with a UAV barrier, as the address-range fixture already does. - **Unchanged:** the #1326 refusal controls (unregistered destination, short scratch, swapped roles) still run in every placed scene. The comparison applies to all adapters, and there is no general distance tolerance. - **`docs/experiments.md`:** the paragraph now describes the reference and the measured bits, keeping the RX 6600 note. ## Results `main` + this change at `8e0eb6cd` (on `4aefce63`). Windows 11 26H2, build 26300.9974. MSVC 19.44.35207, DXC 1.8.2502.11. D3D12 debug layer enabled, with `debug_errors=0 debug_warnings=0` on both backends. ```powershell cmake --build --preset release ctest --preset release --no-tests=error -R '^dxr_placed_build_(hardware|warp)$' -V ``` AMD Radeon RX 9070 XT (`1002:7550`), driver `32.0.31044.16`: pass. ``` placed_dxr_rows placed [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [0,0,0,0x00000000] placed_dxr_rows direct [1,7,0,0x3f7fffff] [0,0,0,0x00000000] [0,0,0,0x00000000] placed_dxr_rows misrouted [0,0,0,0x00000000] [1,7,0,0x3f7fffff] [0,0,0,0x00000000] placed_dxr_distance placed=0x3f7fffff direct=0x3f7fffff (1.0=0x3f800000) ``` WARP `10.0.26100.9818`: pass. ``` placed_dxr_rows placed [1,7,0,0x3f800000] [0,0,0,0x00000000] [0,0,0,0x00000000] placed_dxr_rows direct [1,7,0,0x3f800000] [0,0,0,0x00000000] [0,0,0,0x00000000] placed_dxr_rows misrouted [0,0,0,0x00000000] [1,7,0,0x3f800000] [0,0,0,0x00000000] placed_dxr_distance placed=0x3f800000 direct=0x3f800000 (1.0=0x3f800000) ``` On the RX 9070 XT the placed and direct paths give the same one-ULP-short distance. As with #1360, that difference comes from the adapter's intersection, not from the placed-address path. **Other DXR tests:** - `ctest -R '^(dxr_.*|cpu_placed_dxr_.*|gpu_alias_(warp|hardware))$'` in `dev`: 23/24 pass. The release DXR set: 21/22. - In both, the only failure is the known `dxr_opacity_hardware` (#1011). - `cpu_placed_dxr_{hardware,warp}`, which share `trace_placed_triangle`, pass. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-24 16:03:20 +00:00
tedin7 commented 2026-11-24 16:03:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T15:13:00Z.

Review: COMMENTED


Reviewed 8e0eb6cd012e15dca826215bf4ab593c93b50116:

  • Diff & semantics: Replacing the 1e-5 hit-distance tolerance with a direct-address DXR reference (trace_placed_triangle(device, nullptr, nullptr)) on the same adapter cleanly isolates the slot-133 placed-address resolver while preserving bit-exact distance comparison (output == direct) and fixed hit/miss/masked-miss checks. The decoy BLAS control (PlacedBuildScene::misroute / prepare_decoy routing the TLAS instance to a triangle 4 units to the right) ensures wrong instance routing is caught (misrouted != direct).
  • Hygiene (Linux): python3 tests/docs_links_check.py (16 Markdown files, 348 links) and python3 tests/bidi_controls_check.py (1262 files) passed.
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): cmake --build --preset dev --target offscreen_check + ctest --preset dev -R '^(dxr_placed_build_warp|dxr_pipeline_warp|dxr_query_warp)$' --parallel 4 --no-tests=error --output-on-failure -> 3/3 passed (0.16s).
    • Release /O2 (--preset release): cmake --build --preset release --target offscreen_check + ctest --preset release -R '^(dxr_placed_build_warp|dxr_pipeline_warp|dxr_query_warp)$' --parallel 4 --no-tests=error --output-on-failure -> 3/3 passed (0.15s).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6041916646 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1619#pullrequestreview-6041916646). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T15:13:00Z. **Review:** COMMENTED --- Reviewed `8e0eb6cd012e15dca826215bf4ab593c93b50116`: - **Diff & semantics**: Replacing the `1e-5` hit-distance tolerance with a direct-address DXR reference (`trace_placed_triangle(device, nullptr, nullptr)`) on the same adapter cleanly isolates the slot-133 placed-address resolver while preserving bit-exact distance comparison (`output == direct`) and fixed hit/miss/masked-miss checks. The decoy BLAS control (`PlacedBuildScene::misroute` / `prepare_decoy` routing the TLAS instance to a triangle 4 units to the right) ensures wrong instance routing is caught (`misrouted != direct`). - **Hygiene (Linux)**: `python3 tests/docs_links_check.py` (16 Markdown files, 348 links) and `python3 tests/bidi_controls_check.py` (1262 files) passed. - **Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)**: - Debug (`--preset dev`): `cmake --build --preset dev --target offscreen_check` + `ctest --preset dev -R '^(dxr_placed_build_warp|dxr_pipeline_warp|dxr_query_warp)$' --parallel 4 --no-tests=error --output-on-failure` -> **3/3 passed** (`0.16s`). - Release `/O2` (`--preset release`): `cmake --build --preset release --target offscreen_check` + `ctest --preset release -R '^(dxr_placed_build_warp|dxr_pipeline_warp|dxr_query_warp)$' --parallel 4 --no-tests=error --output-on-failure` -> **3/3 passed** (`0.15s`). AI-assisted; commands listed were executed locally.
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!1612
No description provided.