Skip to content

d3d12_dxr_validation_test: skip before allocating AS buffers on non-RT GPUs - #7241

Open
KarolKurzyna wants to merge 1 commit into
ItsNotRexed:mainfrom
KarolKurzyna:fix/dxr-validation-khr-skip
Open

KarolKurzyna wants to merge 1 commit into
ItsNotRexed:mainfrom
KarolKurzyna:fix/dxr-validation-khr-skip

Conversation

@KarolKurzyna

Copy link
Copy Markdown
Contributor

Follow-up to #6825. Claimed in #7231 (comment) (reproduced on Intel UHD Graphics 770 in #166 (comment)).

Problem

d3d12_dxr_validation_test.cpp skips native adapters when OPTIONS5.RaytracingTier == D3D12_RAYTRACING_TIER_NOT_SUPPORTED, and intentionally lets Leonida continue because d3d12_vulkan_device.cpp reports RaytracingTier == NOT_SUPPORTED even when XDXR or KHR acceleration structures are enabled. To skip on a Leonida device with neither backend active (e.g. d3d12_dxr_validation_khr with LEONIDA_RT_AS=khr on a GPU without VK_KHR_acceleration_structure), run_suite() checked for zero GetRaytracingAccelerationStructurePrebuildInfo sizes and returned 77.

However, run_suite() allocated blas_buf, tlas_buf, and src_as with D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE before that prebuild query. On a device without acceleration structures, CreateCommittedResource refuses RAYTRACING_ACCELERATION_STRUCTURE (initial_state_refusal in d3d12_vulkan_device.cpp), so the test failed with exit 1 (Leonida Vulkan: failed to allocate synthetic buffers) and the return 77 skip was unreachable.

Fix

Probe a minimal 1-triangle BLAS GetRaytracingAccelerationStructurePrebuildInfo before allocating the synthetic buffers when check_strict_validation && o5.RaytracingTier == D3D12_RAYTRACING_TIER_NOT_SUPPORTED, returning 77 if the backend reports zero sizes, and drop the unreachable duplicate skip check below.

Testing

Built on Windows 11 x64 (10.0.26300), MSVC 19.52.37029 (VS 2026), Windows SDK 10.0.26100.0, CMake + Ninja RelWithDebInfo (0 warnings on d3d12_dxr_validation_test.cpp), commit 50aef11:

  • Negative control (before fix, b3c972b): LEONIDA_VK_DEVICE=intel ctest -R "^d3d12_dxr_validation_khr$" failed (exit 1, ID3D12Device::CreateCommittedResource refused (acceleration-structure state on a device without acceleration structures)).
  • Intel(R) UHD Graphics 770 (driver 101.6129, Vulkan 1.3.295, no VK_KHR_acceleration_structure), LEONIDA_VK_VALIDATION off & on:
    • d3d12_dxr_validation (XDXR): PASS
    • d3d12_dxr_validation_khr (LEONIDA_RT_AS=khr): SKIP (exit 77: Leonida Vulkan: neither XDXR nor KHR acceleration structures supported, skipping)
  • NVIDIA GeForce RTX 3070 Ti (driver 621.24, Vulkan 1.4.357), LEONIDA_VK_VALIDATION off & on:
    • d3d12_dxr_validation (XDXR): PASS
    • d3d12_dxr_validation_khr (LEONIDA_RT_AS=khr): PASS (0 Vulkan validation errors)

Synthetic tests only, no game data. AI-assisted.

…ffer allocation

Leonida reports OPTIONS5.RaytracingTier == NOT_SUPPORTED even when XDXR or KHR
acceleration structures are active, so run_suite() had a skip path (exit 77)
when GetRaytracingAccelerationStructurePrebuildInfo returned zero. However,
make_buffer() allocated RAYTRACING_ACCELERATION_STRUCTURE buffers earlier in
run_suite(), which CreateCommittedResource refuses when neither backend is
available (such as d3d12_dxr_validation_khr with LEONIDA_RT_AS=khr on a GPU
without VK_KHR_acceleration_structure). That made the skip path unreachable
and turned a non-RT GPU skip into exit 1.

Move the minimal BLAS PrebuildInfo probe ahead of synthetic buffer allocation
so non-RT GPUs cleanly exit 77 in d3d12_dxr_validation_khr while XDXR and
RT-capable KHR runs remain unchanged.
@EduAzevedo

Copy link
Copy Markdown

Tested 50aef11 on NVIDIA GeForce RTX 2070 SUPER (Turing), driver 610.88, Vulkan 1.4.341, Windows 11 (10.0.26200): pass

Built d3d12_dxr_validation_test with MSVC 14.51 (VS 2026), CMake, Visual Studio generator, RelWithDebInfo, Vulkan SDK 1.4.363.0. Ran ctest -C RelWithDebInfo -R "^d3d12_dxr_validation" with LEONIDA_VK_DEVICE=nvidia.

Results:

  • d3d12_dxr_validation (XDXR): PASS with LEONIDA_VK_VALIDATION=0 and with LEONIDA_VK_VALIDATION=1
  • d3d12_dxr_validation_khr (LEONIDA_RT_AS=khr): PASS with LEONIDA_VK_VALIDATION=0 and with LEONIDA_VK_VALIDATION=1

Both print "valid prebuild, GPU BLAS+TLAS build, and all strict validation checks OK", so on an RT-capable Turing card the new early probe does not skip by mistake. I could not exercise the skip path: this machine's other adapter (AMD Radeon integrated) is not picked by the runtime (no Vulkan 1.3 device with the required features), so with LEONIDA_VK_DEVICE=amd both tests are Not Run before reaching the probe.

Also read the diff: the probe uses the same 1-triangle BLAS inputs as the later prebuild check, and the removed branch is unreachable after it. Looks good to me.

@pulria

pulria commented Nov 23, 2026

Copy link
Copy Markdown

Tested 50aef11b5 merged onto main 1f8cba3f (clean) on AMD Radeon RX 9070 XT (RDNA4), AMD Windows driver 32.0.32015.7029, Windows 11 Pro 10.0.26300, MSVC 19.44 RelWithDebInfo, Vulkan headers from LEONIDA_VULKAN_HEADERS_FETCH: pass. On an RT-capable AMD GPU the new probe does not skip the suite.

d3d12_dxr_validation (XDXR) d3d12_dxr_validation_khr
main 1f8cba3f exit 0 exit 0
this PR, 3 runs each exit 0, 3/3 exit 0, 3/3
  • Every run of both suites prints native WARP and native HW (RX 9070 XT, tier 11) OK, then Leonida Vulkan (tier=0): valid prebuild, GPU BLAS+TLAS build, and all strict validation checks OK. Leonida reports tier 0 here, so the new early probe does run on this card with both backends. Its prebuild sizes come back non-zero and the whole strict suite runs after it.
  • ctest -R "^d3d12_dxr_validation(_khr)?$": 2/2 passed. No warnings from d3d12_dxr_validation_test.cpp.
  • Code read: since the duplicate skip is gone, a zero BLAS-array prebuild after a passing probe now fails with valid BLAS ARRAY prebuild returned zero instead of returning 77. That seems the right way round: only "no AS backend at all" skips.
  • Not covered: the skip path itself. This machine has one GPU, and it has KHR acceleration structures, so neither LEONIDA_RT_AS setting reaches it. No Vulkan SDK here, so no validation layer either. Your UHD 770 run covers the skip.

AI-assisted (Claude Code). Synthetic test only, no game files.

@Jadiac5

Jadiac5 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 50aef11 on Windows 11, AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: pass

  • MSVC 19.44 (VS 2022 Build Tools), Ninja, RelWithDebInfo. Built d3d12_dxr_validation_test (no new warnings in the changed file).
  • ctest -R ^d3d12_dxr_validation: 2/2 pass with LEONIDA_VK_VALIDATION=0 and 2/2 with LEONIDA_VK_VALIDATION=1 (d3d12_dxr_validation and d3d12_dxr_validation_khr).
  • Running the exe by hand with LEONIDA_RT_AS=khr and validation on: the native WARP, native hardware and Leonida Vulkan suites all report OK (exit 0). On this card the Leonida device has KHR acceleration structures, so the probe returns non-zero sizes and the test goes on to the real build.
  • This is the first AMD run. It checks that the early probe does not skip a GPU that can build acceleration structures. The new skip (exit 77) is only reached on a GPU without VK_KHR_acceleration_structure; this card cannot reach it, so the Intel result in the description is not repeated here.
  • Not done: negative control (it needs a GPU without acceleration structures). Not run against the retail executable.

AI-assisted (Claude Code).

@mrp1no

mrp1no commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 50aef11b5 merged onto current main (clean merge) on Windows 11, MSVC 2026 RelWithDebInfo + Ninja: pass. One of the GPUs is non-RT, which is the case this PR fixes. Each GPU ran with LEONIDA_VK_VALIDATION=0 and =1, and main is the control: the same tree with main's copy of the test file.

GPU Test main this PR
Intel UHD 750 (32.0.101.7088), no VK_KHR_acceleration_structure d3d12_dxr_validation_khr fails (Leonida Vulkan: failed to allocate synthetic buffers) skipped (exit 77)
Intel UHD 750 d3d12_dxr_validation passes passes
RTX 3060 (610.88) both pass pass (no skip, the probe stays out of the way on an RT GPU)

That's an independent confirmation, after the UHD 770, that the skip is now reachable on a non-RT iGPU. AI-assisted (Claude Code).

@myokex

myokex commented Nov 23, 2026

Copy link
Copy Markdown

Tested 50aef11b5 on Windows 11, AMD Radeon RX 7800 XT (RDNA3, driver 32.0.32029.2010), MSVC 2022 RelWithDebInfo, CMake 4.4.4, Vulkan SDK 1.4.363.0; merged alone onto main 042c5f378, full ctest -j8; synthetic, no game files: pass. d3d12_dxr_validation and d3d12_dxr_validation_khr pass (this card has ray tracing, so the new early skip is not taken). The failures main itself has on this card (d3d12_vulkan_device, d3d12_texture_tiles, d3d12_indirect_dispatch_count, d3d12_pipeline_library_host, and vk_queue_query_sync in most runs; see #166) are unchanged. d3d12_bindless_churn failed once in this run; it is a flake under parallel ctest -j8 on this card (it fails with unrelated PRs too, and passes 10/10 alone on main), not this PR. AI-assisted (Claude Code).

@gero-stack

Copy link
Copy Markdown

Tested on an RX 5700 XT (RDNA1), AMD Software 26.8.1 (driver 32.0.21045.5002), Windows build 26300.9974, MSVC 14.44, merged alone onto main 867d922f0; built and run directly, not through CTest: pass.

No hardware ray tracing on this card. With LEONIDA_RT_AS=khr (d3d12_dxr_validation_khr): main fails 2/2 (failed to allocate synthetic buffers); with this PR it skips (exit 77) 10/10, and 3/3 with LEONIDA_VK_VALIDATION=1. The default run passes 10/10 and 3/3. With the layer on this PC's AMD iGPU both modes pass 10/10, and 3/3 with validation. No VUIDs.

AI-assisted (Claude Code). Synthetic test only, no game files.

@AlexLavoie42

Copy link
Copy Markdown

Tested 50aef11b5414db423465c87c24f0b02255996b75 merged onto main 1f8cba3f0 on an NVIDIA GeForce RTX 3080 (Ampere), driver 616.56, Windows 11 26200, MSVC 19.50 (VS 2026 18.5) + Ninja, RelWithDebInfo: no new failures against main. 1f8cba3f0 is older than the current main, which has moved on since this was run.

  • ctest with this PR, without the window-opening tests: 219 passed, 1 failed (d3d12_vulkan_device, tiles == 1), 12 skipped (the same 12 that skip on main on this machine).
  • The same machine on main 1f8cba3f0 without it: 219 passed, 1 failed (d3d12_vulkan_device, tiles == 1), 12 skipped. No test changes status.
  • d3d12_dxr_validation and d3d12_dxr_validation_khr both pass with this PR, as on main; neither skips.
  • Not exercised: a GPU without acceleration-structure support, and the five window-opening tests (d3d12_present, xbox_present, dxgi_swapchain, dxgi_swapchain_count, vk_presenter_sync), left out of this run. No game files. AI-assisted.

Raxstreams added a commit to Raxstreams/Leonida that referenced this pull request Nov 23, 2026
…otRexed#7145 ItsNotRexed#7327 ItsNotRexed#7391 ItsNotRexed#7186 ItsNotRexed#7220 ItsNotRexed#7260 ItsNotRexed#7279 ItsNotRexed#7294 ItsNotRexed#7301 ItsNotRexed#7404 ItsNotRexed#7449 ItsNotRexed#7459 ItsNotRexed#7481 ItsNotRexed#7029 ItsNotRexed#7157 ItsNotRexed#7161 ItsNotRexed#7210 ItsNotRexed#7213 ItsNotRexed#7241 ItsNotRexed#7256 ItsNotRexed#7268

ItsNotRexed#8919 fork integration. Each parent after the first is an exact reviewed PR head.

ItsNotRexed#5180 554ddf4 ItsNotRexed#5180 (comment)
ItsNotRexed#5887 1894146 ItsNotRexed#5887 (comment)
ItsNotRexed#7145 8366ec8 ItsNotRexed#7145 (comment)
ItsNotRexed#7327 0392f03 ItsNotRexed#7327 (comment)
ItsNotRexed#7391 4abe9b3 ItsNotRexed#7391 (comment)
ItsNotRexed#7186 f27a7e8 ItsNotRexed#7186 (comment)
ItsNotRexed#7220 7fe517a ItsNotRexed#7220 (comment)
ItsNotRexed#7260 007d10f ItsNotRexed#7260 (comment)
ItsNotRexed#7279 d6b5221 ItsNotRexed#7279 (comment)
ItsNotRexed#7294 d895219 ItsNotRexed#7294 (comment)
ItsNotRexed#7301 ec5b887 ItsNotRexed#7301 (comment)
ItsNotRexed#7404 3e2978f ItsNotRexed#7404 (comment)
ItsNotRexed#7449 dfedc14 ItsNotRexed#7449 (comment)
ItsNotRexed#7459 90045c5 ItsNotRexed#7459 (comment)
ItsNotRexed#7481 fd9231a ItsNotRexed#7481 (comment)
ItsNotRexed#7029 97211c7 ItsNotRexed#7029 (comment)
ItsNotRexed#7157 4d13060 ItsNotRexed#7157 (comment)
ItsNotRexed#7161 40066d7 ItsNotRexed#7161 (comment)
ItsNotRexed#7210 9c8950e ItsNotRexed#7210 (comment)
ItsNotRexed#7213 43e0772 ItsNotRexed#7213 (comment)
ItsNotRexed#7241 50aef11 ItsNotRexed#7241 (comment)
ItsNotRexed#7256 e83aa4e ItsNotRexed#7256 (comment)
ItsNotRexed#7268 b75d669 ItsNotRexed#7268 (comment)

AI-assisted integration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants