Repository navigation
Tests: seven host comparisons take their hardware reference on the layer's own adapter (LEONIDA_HOST_ADAPTER was ignored) - #2910
Conversation
…yer's own adapter
d3d12_copy_xfmt, d3d12_depth_resolve, d3d12_fence_events, d3d12_indirect_zero,
d3d12_node_mask, d3d12_query_rules and d3d12_resource_desc created their hardware
reference with D3D12CreateDevice(nullptr), the default adapter, and did not read
LEONIDA_HOST_ADAPTER. On a PC with two GPUs the layer then ran on one GPU and the
host driver on the other.
runtime/test/host_adapter.h picks the adapter by the rule d3d12_copy_compare.h
already follows for d3d12_vulkan_device: the adapter LEONIDA_HOST_ADAPTER names
(a name that matches none fails the run; "warp" leaves the hardware pass out),
else the adapter behind the Vulkan device (deviceLUID), else the default adapter.
The tests print the adapter's name instead of "the default adapter".
Measured on a Ryzen 7 9700X iGPU (AMD 32.0.21042.62) next to an RTX 3070
(NVIDIA 610.74, the default adapter): d3d12_depth_resolve with the layer on the
Radeon set aside nine resolves as host quirks before and after, but four of them
were NVIDIA's ("D24S8 stencil as X24_G8"); against the Radeon's own driver the
four are D24S8 depth MIN/MAX. The other six tests print the same results against
either adapter.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Code read of
That fixes the two-GPU case the comment measures, where the layer ran on one GPU and the "host" reference on the other. All seven tests now print the adapter actually used. Since the header says AI-assisted review (Claude Code). |
|
Tested All seven host-comparison tests pass ( Single-GPU machine, so the host reference and the layer resolve to the same RTX 5080 — this confirms the change doesn't regress the host comparisons on an NVIDIA single-adapter setup. AI-assisted. |
…me match from host_adapter.h Review of ItsNotRexed#2910: host_adapter.h said it follows the same rule as d3d12_copy_compare.h, with the variable read and the adapter name matched in both. hostadapter::wanted() and hostadapter::named() now do that once, and copycmp::try_create_host calls them, so the two cannot come to read the variable differently. No change in behaviour: d3d12_vulkan_device, d3d12_buffer_uav, d3d12_shader_cache and d3d12_stencil_copy give the same exit codes as main with the variable unset, naming either GPU in any case, "warp" and a name that matches nothing. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
@tupacfan04 thanks, done in No change in behaviour: with the variable unset, naming either GPU (also as One thing I saw on the way, the same on @hidrogenone thanks for the RTX 5080 run. |
|
Tested
Synthetic inputs only. Tested with assistance from OpenAI Codex. |
|
Tested I ran everything that picks a host adapter with One small thing: if the name matches an adapter with no D3D12 device, AI-assisted. |
|
Windows + GPU check: RTX 5080 + RTX 3070 Ti (NVIDIA 621.01) + AMD Radeon iGPU (Ryzen 9 9950X3D, driver 32.0.13018.6), Windows 11, MSVC RelWithDebInfo/Ninja, CMake 4.4.5, glslang 16.6.0, spirv-tools v2026.4, llvm-mc via scripts/build_llvm_mc.ps1. Tested head 91d26fb. A three-GPU machine - exactly the multi-adapter case this PR targets.
Synthetic fixtures only, no game files. AI-assisted (opencode); runs on my machine. |
|
Tested 91d26fb (merged onto main 77444fa) on NVIDIA GeForce RTX 4060 Ti, driver 610.88 (32.0.16.1088), Windows 11 26200, MSVC 14.51.36231 (VS 2026), Vulkan SDK 1.4.363.0: pass
AI-assisted (Claude). |
|
Addressed both outstanding edge cases in db6749c.
New Windows CPU regression: six real Win32 environment cases (unset, empty, mixed case, 127/128/300 characters) and two subprocess fatal paths. The named-adapter case enumerates a real DXGI adapter but stubs device creation and verifies the exact availability-probe arguments. All eight checks and CTest The PR description distinguishes this CPU follow-up from the earlier hardware comparison results. AI-assisted (Codex). |
|
Rechecked db6749c vs 91d26fb. All eight Windows CPU controls passed. The parent lost both 128- and 300-character values, accepted a long nonexistent selector, and returned the unavailable named adapter without probing. Head preserved both strings and rejected both failures; the named selection made exactly one FL11_0 probe with null output. The real DXGI enumeration included an RTX 5070; D3D12 creation was stubbed. AI-assisted. |
|
Tested db6749c on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran AI-assisted. |
|
Tested db6749c merged with main 98fa503 (merged tree b6546df22c) on Windows 11, RTX 4080 SUPER + Intel UHD 770 (MSVC 14.51): pass. Full runtime build from the merged tree.
|
New TEST item, claimed in the coordination issue: #2716 (comment)
What and why
Seven tests compare the layer with Windows D3D12 on a hardware adapter and on WARP, and created the hardware reference with
D3D12CreateDevice(nullptr, ...):d3d12_copy_xfmt,d3d12_depth_resolve,d3d12_fence_events,d3d12_indirect_zero,d3d12_node_mask,d3d12_query_rulesandd3d12_resource_desc. That is D3D12's default adapter, and none of them readLEONIDA_HOST_ADAPTER, whichdocs/testing.mdsays picks the host side.On a PC with two GPUs the layer then runs on one GPU and the host driver on the other. #1785 fixed this for
d3d12_vulkan_device; these seven still had it.runtime/test/host_adapter.hpicks the adapter by the ruled3d12_copy_compare.hfollows:LEONIDA_HOST_ADAPTERnames (part of its name, without case). A name that matches no adapter fails the run.warpleaves the hardware pass out, since these tests always compare with WARP as well;VkPhysicalDeviceIDProperties::deviceLUID);The tests print the adapter's name where they printed "the default adapter". On a PC with one GPU nothing else changes.
docs/d3d12_vulkan.mdsays which tests pick the host side through which header.Not changed:
d3d12_fence_timingasks for a NUMA host on purpose,d3d12_buffer_tileslooks for any adapter with tiled resources tier 2, andd3d12_bundlesays in its header that it does not readLEONIDA_HOST_ADAPTER.Review follow-up: explicit selections
The two reported edge cases are fixed in the shared helpers. The environment getter now resizes and retries when the value does not fit its buffer, and
copycmp::create_host()uses that same getter to distinguish explicit selection. An explicitly named adapter also passes the null-output D3D12 availability probe before it is returned; failure releases the adapter and ends the run, matching the copy-comparison path.A new Windows CPU CTest,
host_adapter, checks the real Win32 getter with unset, empty, mixed-case, 127-, 128- and 300-character values. Two subprocess cases check fatal failure for a long nonexistent selection and for an enumerated named adapter whose stubbed D3D12 probe fails. The probe checks its adapter, feature level, interface ID and null output. DXGI enumerates a real adapter; no D3D12 device is created and no GPU commands run.On Windows 11, MSVC 19.50.35717, Vulkan headers 1.4.363.0: the CPU test and CTest registration pass (8 checks, CTest 1/1). The 128/300-character reads and both fatal-path checks failed before the header fix. All seven affected test translation units compile with the updated helper;
test_ctest_registration.py,test_docs_repo_paths.pyandgit diff --checkpass. The hardware test results below are earlier adapter-routing validation; the full GPU suite was not repeated for this follow-up.Measured
Ryzen 7 9700X iGPU (RDNA2, AMD 32.0.21042.62, Vulkan driver 2.0.353) next to an RTX 3070 (NVIDIA 610.74), which is the default adapter. Windows 11, MSVC 14.50 (VS 2026). The "before" lines are from
main49475796; everything else was run again after rebasing ontoec8ec4c9.d3d12_depth_resolve, hardware pass:Before the change
LEONIDA_HOST_ADAPTER=radeongave the same lines as leaving it unset, with the layer on either GPU. After it,LEONIDA_VK_DEVICE=3070 LEONIDA_HOST_ADAPTER=radeonreports 22 of 31 and 9 host quirks against the Radeon.Host quirks per driver, from those runs (the host differs from the clears, the layer matches them): both have D24S8 stencil MIN/MAX and "R24G8_TYPELESS stencil as D24S8" MAX; NVIDIA adds "stencil as X24_G8" MIN/MAX and "depth as R24_X8" AVERAGE; AMD adds D24S8 depth MIN/MAX. The comment in the test named only NVIDIA's rectangle resolves and now says this.
The other six tests print the same results against either adapter on this PC, apart from the adapter's name.
Tested
LEONIDA_HOST_ADAPTERunset, naming the other GPU, andwarp: 35 runs, all exit 0, each naming the adapter asked for.LEONIDA_HOST_ADAPTER=nosuchgpu: all seven exit 1 withno such adapter.ctest -j 4withLEONIDA_VK_DEVICE=radeonand withLEONIDA_VK_DEVICE=3070, onec8ec4c9plus this commit: 129 of 129 pass on each.python -I tests/test_docs_repo_paths.py,test_docs_links.py,test_docs_list_items.py,test_ctest_registration.py: OK.No game files. Not tested under Wine or on Linux.
AI-assisted.