Tests: time the emulated BVH walk against DXR RayQuery (#1751) #1805
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1815"
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 marquezinii on 2026-11-24T21:04:23Z.
#1751 proposes building host DXR structures from the title's inputs and tracing its rays with inline
RayQueryinstead of the emulated walk, and asks first for the GPU time of the two paths on the same scene. This adds an ignored GPU test that measures it.The scene is a terrain of triangles (256 × 256 quads by default,
XCL_BENCH_GRIDto change). It is built twice:bvh::build, walked with a short stack and the translator's ownbvh_intersect, taken out of a translation ofIMAGE_BVH_INTERSECT_RAYso it is the code titles run;RayQuery.Both trace the same rays: 1024 × 1024 by default (
XCL_BENCH_RAYS), first coherent camera rays, then incoherent random directions as GI or shadow rays would be. Both must find the same closest t on 99.9 % of the rays. The test prints the GPU time of each (timestamps, best of 5) and the BLAS build time.Part of #1751.
What is in it
crates/xcl/src/gpu/recomp/tests.rs:gpu_bvh_host_dxr_vs_emulated_traversal(#[ignore], a measurement likeblob_dxc_cost); runs on the adapter the other GPU tests use (XCL_ADAPTER) and prints its name; skips without DXC, a GPU or DXR 1.1.Tested
cargo test -p xcl --lib gpu_bvh_host_dxr_vs_emulated_traversal -- --ignored --nocapture, two runs per scene size, 1 048 576 rays per run:RayQueryThe device follows
XCL_ADAPTER(since291c4c4, after @futurepro62 found the label could name another GPU than the one measured):XCL_ADAPTER=warpprintsWARP (software renderer)with WARP's own times (RayQuery 0.2–0.4× the emulated walk there, 2048 triangles), and an adapter that matches nothing skips withno GPU. Default adapter, same numbers as above: 8.6× / 15.2×.@futurepro62's runs on
291c4c4(comment), two runs per GPU:XCL_ADAPTER=radeon)On the iGPU the host BLAS was 20.8 MB and took 34 ms to build. The same closest t on 1 048 567 / 1 048 576 rays there.
948c842is291c4c4rebased ontomaincbc296a: the conflict was only both sides appending at the end oftests.rs, and the test is unchanged.cargo test --workspace --no-runbuilds. The GPU was in use by another run here, so the suite on this head is left to CI.Console BVH 19.1 MB / host BLAS 7.9 MB at 131 072 triangles (76.5 / 31.7 MB at 524 288); BLAS + TLAS build 0.54–0.63 ms (1.25–1.49 ms).
cargo test --workspace -- --test-threads=4on291c4c4: 891 passed, 0 failed, 43 ignored. SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache).How to read it: the emulated side here is an idealised walk written directly in HLSL. A title's translated traversal also runs its guest loop, stack and EXEC bookkeeping (and the split wave64 form on 32-lane GPUs), so it does more work per node than this. The ratio above is what the node test and walk alone cost against the hardware, not a title's numbers. The closest-hit agreement says the console BVH from
bvh::buildand the host structure describe the same geometry. It does not cover #1751's hit-equivalence mapping (barycentric permutation, instance and primitive ids).Regression run
Not needed: test-only (
tests.rsonly).Not tested
AI use
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T22:21:12Z.
Full-suite run, since this PR has no test report yet. Tested exact head
8370b95(on its base4178e88).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record: 889 passed, 0 failed, 43 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.#[ignore], so I ran it on its own:cargo test -p xcl --lib -- --ignored --exact gpu::recomp::tests::gpu_bvh_host_dxr_vs_emulated_traversal --nocapture: passed.XCL_ADAPTER=radeonthe test printedAMD Radeon(TM) Graphics: ..., but with the same numbers as above (emulated 0.593 / 1.939 ms, RayQuery 0.074 / 0.142 ms). The test makes its device withD3D12CreateDevice(None, ...), the default adapter (the RTX 5070 Ti here), while the label comes fromrunner::adapter(), which followsXCL_ADAPTER. So both measurements ran on the NVIDIA card and the second was labelled as the iGPU. Creating the device on the adapterrunnerpicks, or printing the device's own adapter description, would keep the label honest. I have no numbers for the iGPU itself.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 891 passed, 0 failed, 43 ignored. SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)).--skipon NVIDIA. Both fail on main7f7e768too, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns their skips into failures.heap_window_out_of_memory_falls_back_to_the_switch_formskips whenXCL_HEAP_WINDOWSis unset (#1651), andshaders::tests::pso_measurement_compiles_an_exact_synthetic_recordskips because Developer Mode was off on this PC (it cannot disable the driver cache). The AMD run does not setXCL_REQUIRE_GPU, so there both just print SKIPPED.Not tested
AI use
Imported from ivall/xcl. Originally posted by marquezinii on 2026-11-24T22:42:16Z.
@futurepro62 thanks for the full run and for the second GPU. The adapter catch is right: the device came from
D3D12CreateDevice(None, …), but the label came fromrunner::adapter(). Fixed in291c4c4(squashed into the one commit). The test now picks the adapter the wayrunnerdoes, withXCL_ADAPTERthroughgpu::adapter::candidates, WARP included, then creates the device on it withagility::create_deviceand prints that adapter's name.Checked here (RTX 5070):
XCL_ADAPTER:NVIDIA GeForce RTX 5070, 8.6× coherent and 15.2× incoherent, as before.XCL_ADAPTER=warp:WARP (software renderer)with WARP's own times (RayQuery 0.2–0.4× the emulated walk, small scene), so the device really follows the setting.XCL_ADAPTER=nosuchgpu: skips withno GPU.cargo test --workspace -- --test-threads=4: 891 passed, 0 failed, 43 ignored.If you rerun it with
XCL_ADAPTER=radeon, that would give the first iGPU (RDNA2, with ray accelerators) numbers.AI use: Claude Code (Claude Opus 5.5) made the fix, ran the checks and drafted this reply.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T00:28:13Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-25T00:47:50Z.
@marquezinii reran
gpu::recomp::tests::gpu_bvh_host_dxr_vs_emulated_traversalat291c4c4on both GPUs, twice each. The label now followsXCL_ADAPTER.XCL_ADAPTERXCL_ADAPTER=radeonBoth: 661973 / 960895 hits. Same closest t on 1048566 (NVIDIA) and 1048567 (AMD) of 1048576 coherent rays, and 1048575 (NVIDIA) and 1048576 (AMD) incoherent.
Tested:
cargo build --workspace, thencargo test -p xcl --lib -- --ignored --exact gpu::recomp::tests::gpu_bvh_host_dxr_vs_emulated_traversal --nocapture, with and withoutXCL_ADAPTER=radeon. NVIDIA driver 621.40, Windows 11, Rust 1.100.0 MSVC, debug.Not tested: the full suite at this head (it ran at the previous head), release build.
AI-assisted (Claude Code).
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T02:11:25Z.
Reviewed
291c4c4(#[ignore]benchmark incrates/xcl/src/gpu/recomp/tests.rs) and approved theaction_requiredCI run.Both NVIDIA (
RTX 5070/RTX 5070 Ti) and AMD (Radeon iGPU) runs are already verified on291c4c4. Once rebased ontomainto resolve thetests.rsconflict and CI goes green, this will be ready to merge.Imported from ivall/xcl. Originally posted by marquezinii on 2026-11-25T04:31:38Z.
@raylitebull thanks for the review and for approving the CI run. Rebased onto
maincbc296aas948c842. The conflict was only both sides appending a test at the end oftests.rs, so I kept both, and this test is unchanged from291c4c4. It builds here (cargo test --workspace --no-run). Another run had the GPU, so I've left the suite on this head to CI.@futurepro62 thank you for the rerun, and for the first AMD numbers. 5.0× / 4.0× on an RDNA2 iGPU, which has its own ray accelerators, against 8.7× / 14–16× on the 5070 Ti, is the kind of spread the description guessed at. Both are in Tested now, with a link.
AI use: Claude Code (Claude Opus 5.5) did the rebase and drafted this reply.
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:38:05Z.
XCL PR #1815 verification
Tested the fetched PR head
948c842ffdf1866aaac398b79c407d1a940eee9bin a clean detached worktree. It superseded the assignment’s expected291c4c45a1a9d67b1fb1f8f02c3b88d9abdd16ff. The diff adds one ignored benchmark incrates/xcl/src/gpu/recomp/tests.rs.Tested
32.0.101.9175, Windows 11 Enterprise Evaluation x64 build26200, DXC1.9.2609.5, and rustc1.100.0 (0ef1bc386 2026-11-09)forx86_64-pc-windows-msvc.cargo build --workspaceandcargo test --workspace --no-runsucceeded outside the GPU lock (unoptimized dev/test profiles, incremental and debuginfo disabled).cargo test -p xcl --lib gpu_bvh_host_dxr_vs_emulated_traversal -- --ignored --nocaptureunderInvoke-ArcTest.ps1withXCL_ADAPTER=A770,XCL_BENCH_GRID=256, andXCL_BENCH_RAYS=1024gave 1 passed, 0 failed, 0 ignored, 0 skips. The 131,072-triangle terrain used a 19,114 KB console BVH and an 18,022 KB host BLAS built in 1.61 ms.Workspace failures and skips
cargo test --workspace --no-fail-fast -- --test-threads=4under the same lock withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1exited 101.pr1815-suite.logsums to 1,126 passed, 28 failed, 47 ignored across 21 result lines (20 test binaries and one doctest run). The benchmark is included in the ignored count.SKIPPEDlines are excluded from coverage. Reasons include missing wave64, rejected wave32 DXIL, tiled resources tier, driver-cache controls, D3D12 debug layers, and heap windows.CreateComputePipelineStatereturning0x80070057. The e2e test title failed itsRSSetDepthBiasXpixel check.Not tested
Matched
mainbaseline, retail-title smoke run, other GPUs, or other benchmark scenes. The origin of the suite failures remains unverified.AI use
T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1815-suite.logand published.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T06:19:54Z.
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-29T17:29:30Z.
I ported the benchmark from
948c842fonto main0fe06eb0on native Windows. Appending the benchmark totests.rsapplied cleanly, then DXC rejected the generated shader. Main’sbvh_intersecttakes nine arguments and references two additional helpers. These two benchmark-only edits fixed the compile:float bvh_grow_hi(andfloat bvh_grow_lo(from the translation betweenpick4andbvh_intersect.true, 0u, falsefor the final arguments to the benchmark’sbvh_intersectcall. That uses zero box expansion and leaves the closest-distance calculation unchanged.The port passed the default case and a ray-count sweep on RTX 5070 12 GB (616.92), Ryzen 7 5700X3D, Windows 11 26300.10075, Rust 1.100.0 MSVC, DXC 1.8.2502.11, debug. A second sweep added one GPU timestamp after TLAS construction. These timings are best-of-five traversal dispatches, with two fresh processes per count and 131,072 triangles throughout. All eight timestamped runs passed with zero skips. At 1,048,576 rays the closest-distance check agreed on 1,048,566 coherent rays and 1,048,575 incoherent rays in both runs.
Native BLAS+TLAS construction took 0.590–0.682 ms of GPU time. If the emulated BVH is already available and the native build is added serially, the 1,048,576-ray incoherent sample still wins (0.799–0.864 ms build plus trace). The two 262,144-ray incoherent runs did not recover the build cost. The calculation excludes CPU setup, uploads, synchronization with other queues, and any overlap or reuse across a frame. The scene is synthetic and title performance remains unmeasured.
OpenAI Codex with GPT-6.2 Sol ported the existing benchmark, instrumented the build, ran the tests and prepared this report.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:52:39Z.
Triage (#1607) – head
948c842No open or merged PR adds this benchmark. The #2184-#2189 series puts native RayQuery into the runtime and does not time the emulated walk. The test is
#[ignore](an opt-in GPU benchmark), so CI never runs it; it still asserts that both walks agree on 99.9 % of rays when it is run. No problems found in the diff; it conflicts with main.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Pull request closed