Skip to content

Tests: verify direct DXIL vs HLSL GPU parity for BVH ray-box and ray-triangle ops - #2087

Open
ramon-victor wants to merge 1 commit into
xcl-dev:mainfrom
ramon-victor:tests/gpu-dxil-bvh-parity
Open

ramon-victor wants to merge 1 commit into
xcl-dev:mainfrom
ramon-victor:tests/gpu-dxil-bvh-parity

Conversation

@ramon-victor

Copy link
Copy Markdown

Add GPU differential parity tests between the direct RDNA2 → DXIL translator (xcl::gpu::dxil::kernel::translate, validated with dxil.dll), the HLSL + DXC path (xcl::gpu::recomp), and the CPU BVH reference (xcl::gpu::bvh::intersect_node) for IMAGE_BVH_INTERSECT_RAY and IMAGE_BVH64_INTERSECT_RAY across wave32 and wave64 (split wave64 on wave32-only GPUs). Test-only change; no runtime files modified.

What is in it

  • crates/xcl/tests/gpu_dxil_bvh_parity.rs:
    • direct_dxil_bvh_box32_box16_and_exec_mask_parity: Box32 sorted and unsorted child ordering, Box16 half-precision bounds, t_max culling, NaN-disabled and inverted boxes, axis-aligned grazing rays (dx == 0, inv.x == +inf), full misses, and inactive EXEC destination preservation.
    • direct_dxil_bvh_triangle_pair_and_bvh64_parity: rotated quad triangle pair (tri0 / tri1) through both IMAGE_BVH_INTERSECT_RAY and IMAGE_BVH64_INTERSECT_RAY, asserting parity across Direct DXIL, HLSL+DXC, and CPU bvh::intersect_node.
    • direct_dxil_bvh64_multi_window_parity: 2-window UMA arena (Uma::with_windows(2, 1 MiB)) with BVH in window 1 and poisoned decoy in window 0, checking both 64-bit node pointers (IMAGE_BVH64_INTERSECT_RAY, base 0) and 48-bit bvh_words descriptors (IMAGE_BVH_INTERSECT_RAY).

Tested

  • Hardware: NVIDIA GeForce RTX 3070 (8 GiB, driver 621.24, wave32), AMD Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.99.0 (x86_64-pc-windows-msvc), DXC 1.8.2502.11 (Windows SDK 10.0.26100.0), debug build.
  • cargo test -p xcl --test gpu_dxil_bvh_parity -- --nocapture: 3 passed, 0 failed, 0 ignored (0 SKIPPED; each test ran both wave32 and split wave64 through both Direct DXIL and HLSL+DXC).
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4) on head dc0ef7f: 1157 passed, 0 failed, 46 ignored (24 SKIPPED GPU tests: 20 no wave64, 3 per-lane form #1426, 1 no heap windows).

Not tested

  • Native 64-lane hardware wave64 (AMD RDNA2/3/4) — RTX 3070 only supports 32-lane waves, so wave64 ran in split-wave64 mode.
  • Release build and retail game titles (test-only PR, no runtime changes).

AI use

  • Antigravity (Google DeepMind; Gemini frontier model — exact minor version not exposed to the agent): wrote the integration test file, ran the full test suite on the RTX 3070, and drafted this PR description.

@JJAutoCompare

Copy link
Copy Markdown

PR #2087 — Arc A770 ray-triangle parity

Tested

  • PR #2087 was open at dc0ef7fd41b702a7cdad5bb4b0772a780af0f699 before and after the run. The assigned worktree was clean and detached at that SHA. The live discussion had no JJAutoCompare report or follow-up comment, and the all-project T3 search for 2087 returned only this worker.
  • STOR-WINLAB ran Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X and Intel Arc A770 driver 32.0.101.9175. Rust 1.100.0 (0ef1bc386 2026-11-09) targeted x86_64-pc-windows-msvc and Cargo was 1.100.0 (3acc79c0c 2026-11-05). Test stderr confirmed DXC and DXIL 1.9.2609.5 from the configured directory.
  • Prebuild exited 0 in 26.53s, outside the device lock. The exact integration fixture exited 0 in 2.72s under the Arc lock with 1 passed, 0 failed, 0 ignored, 0 measured, 0 hardware skips, 2 filtered out.
  • The fixture exercised IMAGE_BVH_INTERSECT_RAY and IMAGE_BVH64_INTERSECT_RAY using alternating tri0 and tri1 nodes from a rotated quad in one memory window. It compiled and dispatched both the HLSL/DXC and direct DXIL paths, including validation of the direct DXIL. For each lane, direct 32-bit and 64-bit node-pointer results matched bit-for-bit. Direct and HLSL results agreed with the CPU bvh::intersect_node hit/miss classification through the direct result, and the fixture checked the four normalized hit components against HLSL and CPU with an absolute tolerance of 1e-5. Both modes met the assertion of at least four hits per mode.
  • The two mode branches were Wave32 (32 logical lanes) and split Wave64 (64 logical lanes). Mode selection follows from the fixture's gpu_modes() gate and the same-host Arc capability log, which records WaveLaneCountMin=8 and WaveLaneCountMax=32. The fixture does not print its wave modes or per-mode hit totals.

Commands

$runDir = 'L:/XclTooling/pr2087/dc0ef7f-20261125T034142015Z'
$env:TEMP = Join-Path $runDir 'temp'
$env:TMP = $env:TEMP
$env:CARGO_TARGET_DIR = 'L:/XclTooling/pr1778-2e2ee55-20261125-020159/target'
$env:CARGO_BUILD_JOBS = '2'
$env:CARGO_INCREMENTAL = '0'
$env:CARGO_PROFILE_DEV_DEBUG = '0'
$env:CARGO_PROFILE_TEST_DEBUG = '0'
$env:XCL_ADAPTER = 'A770'
$env:XCL_DXC_DIR = Join-Path $env:LOCALAPPDATA 'XclTooling/dxc-1.9.2609/bin/x64'
$env:Path = "$env:USERPROFILE/.cargo/bin;$env:Path"
cargo test --locked -p xcl --test gpu_dxil_bvh_parity --no-run --message-format=json-render-diagnostics
$env:XCL_PR2087_TEST_EXE = [IO.File]::ReadAllText((Join-Path $runDir 'test-executable.txt'))
# This block ran in powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -EncodedCommand.
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    & $env:XCL_PR2087_TEST_EXE --exact direct_dxil_bvh_triangle_pair_and_bvh64_parity --test-threads=1 --nocapture
}

Cargo's JSON artifact record selected the executable. The build and run logs, exit codes, and executable path are stored beside this report. The wrapper logged lock release, and the assigned Cargo target slot is released.

Not tested

Box32/Box16 and EXEC masks, multi-window addressing, native Wave64, other adapters, the workspace suite, retail data, and title smoke runs.

AI use

T3 Code / Codex (gpt-6.2-sol) ran and recorded this focused verification.

@DarkPanda69

Copy link
Copy Markdown

Native 64-lane wave64 run on AMD, which this PR lists as not tested (the RTX 3070 ran wave64 split; the other report here is Arc). AMD also has hardware ray accelerators, so this is the BVH parity on a GPU with its own RT units.

Tested: pass, head dc0ef7f applied on its base main cbc296a, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17. cargo test -p xcl --test gpu_dxil_bvh_parity -- --test-threads=4 with XCL_ADAPTER set to each GPU:

  • AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010, waves 32..64: 3 passed, 0 failed, 0 SKIPPED.
  • NVIDIA RTX 3060, driver 32.0.16.1088: 3 passed, 0 failed, 0 SKIPPED.

AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

@JoaoPauluu

Copy link
Copy Markdown

A run with vkd3d-proton as the host D3D12, so both the direct DXIL and the HLSL → DXC output go through dxil-spirv and the NVIDIA Vulkan driver: all 3 parity tests pass, none skipped.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. dc0ef7f as it is (merge base with main cbc296a), no uncommitted changes. The gpu_dxil_bvh_parity test binary runs under Wine, one test per process.
    • direct_dxil_bvh64_multi_window_parity: ok
    • direct_dxil_bvh_box32_box16_and_exec_mask_parity: ok
    • direct_dxil_bvh_triangle_pair_and_bvh64_parity: ok

Not tested

  • wave64 forms (this GPU has 32-lane waves only), the whole suite on this head, native Windows, AMD.

AI use

  • Claude Code (Claude Opus 5.5) built the commit, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

@throny throny added the off-goal Does not bear on the current goal (world loading); waits until it is reached label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants