Skip to content

d3d12_compute_test: a host that answers nothing is not a CachedPSO reference - #5236

Open
stocksock wants to merge 1 commit into
ItsNotRexed:mainfrom
stocksock:compute-cachedpso-empty-host
Open

stocksock wants to merge 1 commit into
ItsNotRexed:mainfrom
stocksock:compute-cachedpso-empty-host

Conversation

@stocksock

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: new TEST item (my claim in #5156), follow-up to #3023

What and why

d3d12_compute fails on a native Windows 10 host at host == layer. cached_pso_cases() returns no cases when the device's own GetCachedBlob fails, and on this host it fails for both reference devices (0x8000FFFF on the GPU adapter and on WARP; measured, see my comment on #3023). host_cached_pso_cases() kept those empty lists, so hosts was not empty and the test compared two empty lists with the layer's eleven answers on every run. #3023 skipped the same "every host answered nothing" condition for Wine only.

An adapter's answers are now kept only when it gave some. With none left, the existing SKIP line prints, and its text names this case. A host that does answer is compared exactly as before, and the layer's own answers are still checked against the expected list.

Only runtime/test/d3d12_compute_test.cpp changes.

Tested

Windows 10 22H2 (19045.5737), NVIDIA GeForce RTX 3090, driver 621.24 (Vulkan 1.4.357), MSVC 19.44, Vulkan SDK 1.4.363.0, RelWithDebInfo, main 3faac55:

  • Before: d3d12_compute fails with line 396: host == layer.
  • After: passes (exit 0) and prints SKIP: no host D3D12 reference (Wine, no device or compiler, or a host whose GetCachedBlob fails) for the CachedPSO comparison.

Not tested: a host whose GetCachedBlob works (the comparison code path is unchanged there, but I could not run it), Wine, clang-cl. I don't know why GetCachedBlob fails on this host; another Windows 10 19045 tester reported d3d12_compute passing, so it is not Windows 10 in general.

AI-assisted (Claude).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator changes.)

🤖 Generated with Claude Code

…ference

host_cached_pso_cases kept an adapter's answers even when there were
none. cached_pso_cases returns no cases when the host's own GetCachedBlob
fails, which it does on a native Windows 10 22H2 host (0x8000FFFF for the
GPU adapter and for WARP), so the test compared two empty lists with the
layer's eleven answers and failed at "host == layer" on every run. ItsNotRexed#3023
skipped the same condition for Wine only.

An adapter's answers are now kept only when it gave some. With none left
the existing SKIP line prints, and it names this case.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 02a825e on Windows 11: pass. The native D3D12 adapter and WARP both returned cached pipeline data on this machine. Each gave the same 11 answers as the layer.

I built d3d12_compute_test in RelWithDebInfo. I ran d3d12_compute_test.exe with the RTX 4090 Vulkan driver selected and again with the AMD Radeon Vulkan driver selected. Both runs exited with code 0. Both reference devices also matched on merge base 3faac55.

I tested a mixed result with a local change in the host loop. I supplied an empty result for the default adapter and kept the real WARP result. On the PR head the test compared all 11 WARP answers and exited with code 0. With the same local change on the merge base, the test failed at line 396 on host == layer and exited with code 1. This control simulates one empty result. Both devices returned data in the unmodified run.

AI-assisted.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: PR #5236 @ 02a825e (base 3faac55; Windows 11, MSVC 19.44, Ninja, RelWithDebInfo)

Configured C:/Users/kam/AppData/Local/Temp/opencode/review-5236/runtime/build-5236 (VULKAN_SDK=1.4.363.0, LEONIDA_VK_DEVICE="RTX 5070 Ti"):

cmake -S C:/Users/kam/AppData/Local/Temp/opencode/review-5236/runtime -B C:/Users/kam/AppData/Local/Temp/opencode/review-5236/runtime/build-5236 -G Ninja -DCMAKE_MAKE_PROGRAM="C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=ON -DLEONIDA_BUILD_WINDOWS_RUNTIME=ON -DVulkan_INCLUDE_DIR=C:/VulkanSDK/1.4.363.0/Include -DVulkan_LIBRARY=C:/VulkanSDK/1.4.363.0/Lib/vulkan-1.lib -DVulkan_GLSLANG_VALIDATOR_EXECUTABLE=C:/VulkanSDK/1.4.363.0/Bin/glslangValidator.exe

Build: cmake --build <build-5236> --target d3d12_compute_test -> exit 0.
Run: .\d3d12_compute_test.exe -> exit 0, no EXPECT failures (test returns nonzero on any EXPECT failure or validation error). Final lines:
cached PSO: 2 host adapter(s) gave the same 11 answers
compute: root constants, a root UAV and a descriptor table reached the shader through the GPU address arena; 64 elements matched in each of three dispatches
Also built the other registered compute tests, then ctest -R compute -> 3/3 passed (d3d12_compute 0.63 s, d3d12_fspx_compute 0.27 s, d3d12_set0_compute 0.29 s), exit 0.
git diff --check -> clean, exit 0.

Verdict: no blocking issue. Note: the new "host answered nothing" filter did not execute here - both host adapters returned 11 answers - so that branch is inspection-only. The layer is still compared against hardcoded expectations, so the skip does not remove coverage of layer behavior.

@JRamos1993

Copy link
Copy Markdown
Contributor

Tested 02a825e merged onto main 3faac55 on an RTX 5090 (driver 616.92), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363, RelWithDebInfo:

  • Full ctest: 178/178.
  • d3d12_compute: passes 20 of 20 runs, and passes under LEONIDA_VK_VALIDATION=1 with 0 validation messages.
  • Warnings: none new in the files this PR changes.

AI-assisted (Claude Code).

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.

4 participants