Tests: verify direct DXIL vs HLSL GPU parity for BVH ray-box and ray-triangle ops #2077
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2087"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by ramon-victor on 2026-11-25T03:35:12Z.
Add GPU differential parity tests between the direct RDNA2 → DXIL translator (
xcl::gpu::dxil::kernel::translate, validated withdxil.dll), the HLSL + DXC path (xcl::gpu::recomp), and the CPU BVH reference (xcl::gpu::bvh::intersect_node) forIMAGE_BVH_INTERSECT_RAYandIMAGE_BVH64_INTERSECT_RAYacross 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_maxculling, NaN-disabled and inverted boxes, axis-aligned grazing rays (dx == 0,inv.x == +inf), full misses, and inactiveEXECdestination preservation.direct_dxil_bvh_triangle_pair_and_bvh64_parity: rotated quad triangle pair (tri0/tri1) through bothIMAGE_BVH_INTERSECT_RAYandIMAGE_BVH64_INTERSECT_RAY, asserting parity across Direct DXIL, HLSL+DXC, and CPUbvh::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-bitbvh_wordsdescriptors (IMAGE_BVH_INTERSECT_RAY).Tested
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 headdc0ef7f: 1157 passed, 0 failed, 46 ignored (24 SKIPPED GPU tests: 20no wave64, 3per-lane form#1426, 1no heap windows).Not tested
AI use
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T03:44:17Z.
PR #2087 — Arc A770 ray-triangle parity
Tested
dc0ef7fd41b702a7cdad5bb4b0772a780af0f699before and after the run. The assigned worktree was clean and detached at that SHA. The live discussion had noJJAutoComparereport or follow-up comment, and the all-project T3 search for2087returned only this worker.26200.9974, AMD Ryzen 7 3800X and Intel Arc A770 driver32.0.101.9175. Rust1.100.0 (0ef1bc386 2026-11-09)targetedx86_64-pc-windows-msvcand Cargo was1.100.0 (3acc79c0c 2026-11-05). Test stderr confirmed DXC and DXIL1.9.2609.5from the configured directory.IMAGE_BVH_INTERSECT_RAYandIMAGE_BVH64_INTERSECT_RAYusing alternatingtri0andtri1nodes 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 CPUbvh::intersect_nodehit/miss classification through the direct result, and the fixture checked the four normalized hit components against HLSL and CPU with an absolute tolerance of1e-5. Both modes met the assertion of at least four hits per mode.gpu_modes()gate and the same-host Arc capability log, which recordsWaveLaneCountMin=8andWaveLaneCountMax=32. The fixture does not print its wave modes or per-mode hit totals.Commands
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.Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T03:52:20Z.
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
dc0ef7fapplied on its basemaincbc296a, 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=4withXCL_ADAPTERset to each GPU:AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
upstream-sync referenced this pull request2026-11-25 05:07:03 +00:00
Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-25T05:26:01Z.
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
x86_64-pc-windows-gnu.dc0ef7fas it is (merge base withmaincbc296a), no uncommitted changes. Thegpu_dxil_bvh_paritytest binary runs under Wine, one test per process.direct_dxil_bvh64_multi_window_parity: okdirect_dxil_bvh_box32_box16_and_exec_mask_parity: okdirect_dxil_bvh_triangle_pair_and_bvh64_parity: okNot tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T05:27:54Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
upstream-sync referenced this pull request2026-11-25 10:09:30 +00:00
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T09:50:04Z.
Independent desktop NVIDIA verification of PR #2087 at head
dc0ef7fd41b702a7cdad5bb4b0772a780af0f699(1commit; exact parent & merge-base:cbc296ab65a2661a61e3e2da109134bcd5319f60, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12, Wave32-only Ada), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted GPU parity tests & build (
dc0ef7fd)cargo test --release -p xcl --test gpu_dxil_bvh_parity -- --nocapture(3 consecutive runs)3 passed; 0 failed; 0 ignored; 0 filtered out× 3 (2.42s,0.79s,0.56s,0skipped; live RTX 4060wave32+split-wave64execution ofdirect_dxil_bvh_box32_box16_and_exec_mask_parity,direct_dxil_bvh_triangle_pair_and_bvh64_parity, and UMA 2-windowdirect_dxil_bvh64_multi_window_parity)cargo build --release -p xcl1.94sincremental--testcompile +0.06sincremental--releasebuild, exit0,0new warnings)Paired quiet 60 s retail smoke (
title: 29640639)Exact parent & merge-base (
cbc296ab65a2661a61e3e2da109134bcd5319f60, cached baseline on the same machine):PR #2087 (
dc0ef7fd41b702a7cdad5bb4b0772a780af0f699):Limits of coverage
crates/xcl/tests/gpu_dxil_bvh_parity.rs,0production-code changes); all 3 direct-DXIL vs. HLSL BVH ray-box, ray-triangle, and UMA 2-windowbvh64differential parity tests executed and passed3/3on desktop RTX 4060 acrosswave32andsplit-wave64(gpu_modes()omits native Wave64 on Wave32-only Ada).AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T10:10:37Z.
merge-check claim
head:
dc0ef7fd41Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T10:22:44Z.
merge-check
base:
9dfbe3ea66head:
dc0ef7fd41merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2887 passed, 2 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails on the base alone too (base: 2885 passed, 1 failed, 51 ignored, 28 SKIPPED lines); and this PR's own
direct_dxil_bvh_triangle_pair_and_bvh64_parity(in--test gpu_dxil_bvh_parity), new here. It fails the same way in 3 of 3 runs (the suite and two reruns of the test binary):lane 6: direct [-20.0, -4.0, 3.64e-43, 1e-45] vs cpu [-20.0, -4.0, -1.5082724, -0.78466433]. The other two tests of the file passed. 28 SKIPPED lines, as on the base.review: test-only, one new file, read; nothing unsafe. The blocking point is the failing test: on that lane direct DXIL and HLSL agree with each other (the assertion before it passes) and both differ from the CPU reference
bvh::intersect_nodein the third and fourth result components. So either the reference on current main no longer matches what the test expects for that triangle case (main has had BVH changes since the PR's base, e.g.a173b472and #1322), or both GPU paths are wrong for it; I did not determine which. It needs a rebase and a look at that case before it can go in.performance: none; tests only.
verdict: not yet: the PR's own test
direct_dxil_bvh_triangle_pair_and_bvh64_parityfails on current main (GPU paths agree with each other, not with the CPU reference)hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
Imported from ivall/xcl. Originally posted by SzczepanGrela on 2026-11-30T13:39:47Z.
merge-check
base:
9dfbe3ea66head:
dc0ef7fd41merge: clean; staged tree 0aa8bdd85fa4cdb1f7a2b5f768f550288a5240cb.
build: cargo test -p xcl --test gpu_dxil_bvh_parity --release --target x86_64-pc-windows-gnu --offline --locked -j 3 --no-run --message-format=json-render-diagnostics -> ok on the merge and the local one-line candidate. Tier 0, test-only diff.
tests: Wine <gpu_dxil_bvh_parity.exe> --nocapture --test-threads=1, three fresh processes, then --test-threads=4 once. Unchanged PR merged onto this base: 2 passed, 1 failed, 0 ignored each time. Local descriptor-only candidate: 3 passed, 0 failed, 0 ignored each time. Zero SKIPPED notices. Full workspace suite not run for this check.
review: The triangle fixture requests return mode 0 but compares its result to the CPU's barycentric return. This reproduces the lane-6 failure reported above on AMD as well. Selecting return mode 1 fixes this fixture without changing an assertion or production code; details below.
performance: Test-only, no runtime or default frame-path change; no timing/FPS claim.
verdict: not yet: the current PR head adds a failing test when merged onto main. The one-line candidate below passes all three targeted tests, but is not in the PR.
hardware / tool and model: RX 9070 16 GB, RADV GFX1201 / Mesa 26.3.1-arch3.5; Ryzen 7 7700, CachyOS 7.3.6-3-cachyos; GE-Proton11-12 / Wine 11.0 Staging, vkd3d-proton 8293130ebe370b1+; Rust 1.97.1, Windows GNU release executables. Codex, GPT-6 (exact serving variant not exposed).
Finding and tested candidate
The triangle descriptor at line 207 hardcodes word 3 to zero. Since a173b472, both translators honor bit 24: mode 0 returns triangle ID/status in dwords 2/3; mode 1 returns barycentric numerators.
bvh::intersect_nodesupplies the latter.On lane 6, mode 0 returns raw dwords
c1a00000 c0800000 00000104 00000001. Treating the last two integers as floats gives the observed3.64e-43, 1e-45. Mode 1 givesc1a00000 c0800000 bfc10f12 bf48dfc3, matching the CPU result.Only change the triangle test's descriptor line to use the existing helper:
All original inputs and assertions were retained. Box/EXEC-mask and multi-window tests pass on both versions; the triangle test changes from fail to pass.
Additional verification
An owned diagnostic runs both return modes through HLSL/DXC and direct DXIL, with BVH32 and BVH64 instructions, in wave32 and non-split wave64 configurations. Three fresh processes: 1 passed, 0 failed, 0 ignored each, zero skips. Mode 0 checks integer ID/status; mode 1 checks barycentrics. Captured inputs were independently regenerated and all 576 lane records / 9,216 GPU result words checked against planar geometry and typed results; normalized geometric error below 7.5e-8. Repeat captures are identical.
Not tested
Native Windows, other GPUs, split-wave64, a separate physical-wave-width probe, full workspace suite, retail titles,
scripts/smoke.ps1, or FPS.XCL_SAMPLE_*unset;XCL_NETWORK=0. The original head on its historical base was not executed here.AI use
Codex (GPT-6, exact serving variant not exposed) reviewed the diff and descriptor history, ran the comparisons, prepared the local candidate and diagnostic, independently verified captures and source/binary provenance, and drafted this report. Publication authorized by the account owner.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:19:41Z.
Triage (#1607) – head
dc0ef7fTest-only: adds
crates/xcl/tests/gpu_dxil_bvh_parity.rs, which compares direct DXIL with HLSL and the CPUbvh::intersect_nodefor IMAGE_BVH(64)_INTERSECT_RAY (box32 sorted and unsorted, box16, triangle pairs, EXEC masking, 2-window UMA). No open or merged PR adds BVH parity tests. Sibling PRs #2084/#2089/#2091/#2093 each cover other instruction families in separate files, so none of them duplicates this one.One small thing: in
direct_dxil_bvh64_multi_window_parity, a missing 2-window UMA arena is reported asskip_test("no GPU"), which gives the wrong reason.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.