Skip to content

d3d12_vulkan_device_test: seven buffer-state and heap cases are not comparable on Windows 10 (TEST-724) - #3557

Merged
ItsNotRexed merged 2 commits into
ItsNotRexed:mainfrom
stocksock:win10-buffer-state-cases
Nov 23, 2026
Merged

ItsNotRexed merged 2 commits into
ItsNotRexed:mainfrom
stocksock:win10-buffer-state-cases

Conversation

@stocksock

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: TEST-724 (my finding and claim in #3381)

What and why

d3d12_vulkan_device cannot pass on a Windows 10 host. Windows 10's D3D12 (no ID3D12Device10) still validates a buffer's initial state and refuses a HARDWARE_PROTECTED heap, where newer runtimes and the layer accept them. Seven cases compared those answers without a predicate:

  • committed: buffer in state 0x80000000
  • committed: buffer in RENDER_TARGET | UNORDERED_ACCESS state
  • heap: HARDWARE_PROTECTED
  • placed: upload buffer in COPY_DEST
  • placed: readback buffer in GENERIC_READ
  • placed: default buffer in state 0x80000000
  • reserved: buffer in state 0x80000000

TEST-724 lists the first two. The other five are the same kind and only show once the first two pass, because each comparison group fails the test before the next one's result matters.

All seven now carry the ID3D12Device10 predicate that eight neighbouring cases already use (+device10), through a shared host_device10() for the two functions that had no such lambda. compare_heap_neighbours gains the same "not comparable on this host" path as the other two comparisons. On a host with ID3D12Device10 nothing changes: the predicate is true and every case is compared as before.

Only runtime/test/d3d12_vulkan_device_test.cpp changes; no runtime code.

Tested

Windows 10 22H2 (build 19045.5737), NVIDIA GeForce RTX 3090, driver 621.24 (Vulkan 1.4.357), MSVC 19.44.35229, Vulkan SDK 1.4.363.0, RelWithDebInfo, on main f847748:

Not tested: a Windows 11 host (the predicate is true there, so the comparisons are unchanged, but I could not run it), clang-cl, other GPUs.

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

…omparable on Windows 10

Windows 10's D3D12 (no ID3D12Device10) still validates a buffer's initial
state and refuses a HARDWARE_PROTECTED heap, where newer runtimes and the
layer accept them. Seven cases compared those answers without a predicate,
so the test could not pass on a Windows 10 host:

  committed: buffer in state 0x80000000
  committed: buffer in RENDER_TARGET | UNORDERED_ACCESS state
  heap: HARDWARE_PROTECTED
  placed: upload buffer in COPY_DEST
  placed: readback buffer in GENERIC_READ
  placed: default buffer in state 0x80000000
  reserved: buffer in state 0x80000000

They now carry the ID3D12Device10 predicate their neighbours already use,
and compare_heap_neighbours gains the same "not comparable on this host"
path as the other two comparisons. Hosts with ID3D12Device10 compare
exactly as before.

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

@kacper-serewis kacper-serewis 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.

At 5ee2189 all seven comparisons still run when ID3D12Device10 is available. Without that interface the exemption accepts any unequal HRESULTs, including layer E_FAIL versus host E_INVALIDARG. The Windows 10 measurement supports only layer S_OK versus host E_INVALIDARG. Please restrict the exemption to that pair and retain failure for other mismatches. Verified using 48 CPU-only synthetic combinations from the three comparison loops; device availability and HRESULTs were simulated. AI-assisted.

@stocksock
stocksock force-pushed the win10-buffer-state-cases branch from 5ee2189 to dc4256f Compare November 22, 2026 21:03
Review of the previous commit (@kacper-serewis): the ID3D12Device10
predicate excused any unequal answers for the seven cases on a Windows 10
host, where only one pair was measured. Each case is now marked
windows10_refuses, and windows10_refusal() excuses exactly the layer's
S_OK against the host's E_INVALIDARG on a host without ID3D12Device10.
Any other difference there, and any difference on a newer host, is a
mismatch again.

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

Copy link
Copy Markdown
Contributor Author

@kacper-serewis good catch, done in f8fe26d.

The seven cases no longer use the ID3D12Device10 predicate. Each is marked windows10_refuses, and windows10_refusal() excuses exactly one pair: the layer's S_OK against the host's E_INVALIDARG, on a host without ID3D12Device10. Any other difference there, and any difference on a newer host, is a mismatch again. The eight neighbouring +device10 cases are untouched.

Re-tested on the same host (Windows 10 22H2 19045.5737, RTX 3090, NVIDIA 621.24, main f847748):

  • d3d12_vulkan_device passes; the seven cases print Windows 10's runtime refuses it (ours 0x00000000, host 0x80070057).
  • Negative control: with the excused host answer changed to E_FAIL in windows10_refusal() (not committed), the test fails again at argument_mismatches <= 0, so the exemption only covers the measured pair.

AI-assisted (Claude).

@kacper-serewis kacper-serewis 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.

At f8fe26d all 252 CPU-simulated control combinations passed. All seven marked cases now detect unexpected E_FAIL mismatches; only layer S_OK versus host E_INVALIDARG on a host lacking ID3D12Device10 is exempted. Prior finding resolved. AI-assisted.

@MeNoSkills

Copy link
Copy Markdown
Contributor

Tested f8fe26dd (on current main f847748c) on a second Windows 10 Pro 19045 host (no ID3D12Device10), MSVC 2022, SDK 10.0.26100.0, Vulkan SDK 1.4.363.0, d3d12_vulkan_device_test built RelWithDebInfo:

  • NVIDIA GeForce RTX 4070 Ti (621.24): pass, exit 0. Before this PR the same test stops at argument_mismatches <= 0 on main, so the seven cases do get excused here as intended.
  • AMD Radeon Graphics iGPU of a Ryzen 7 9700X (driver 24.30.18, host comparisons on the same adapter): exit 1 with exactly one mismatch left, invalid arguments format 67 RT: ours 0x00000000, host 0x80070057 (line 5121: argument_mismatches <= 0). That one is outside this PR: R9G9B9E5_SHAREDEXP as a render target, which the layer deliberately accepts (the comment at d3d12_vulkan_device.cpp:1154 says the host accepts it), and this older AMD driver's D3D12 refuses it. Other AMD drivers pass it (Windows 11 runs on RX 9070 / RX 7900 XTX / an RDNA2 iGPU report a clean ctest). I am not proposing a layer change for it.

So on two different NVIDIA and AMD adapters of a Windows 10 host, no other case in the seven you excuse is left mismatching. I did not run the full ctest. AI-assisted (Claude Code).

@VeTkN VeTkN left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested f8fe26d on Windows 11 Pro (10.0.26200), RTX 5070, NVIDIA 621.24, MSVC (VS 2026 Build Tools) via scripts/build_runtime.ps1: pass. This is the Windows 11 host the description lists as not tested.

  • ctest -R ^d3d12_vulkan_device$ -V: passed (12.5 s).
  • No "Windows 10's runtime refuses it" line was printed, so none of the windows10_refuses cases was excused on this host: they were compared as before and matched.
  • The only "not comparable on this host" line is committed: UAV buffer in RAYTRACING_ACCELERATION_STRUCTURE state (ours 0x80070057, host 0x00000000), which goes through its comparable gate, not the Windows 10 excuse.

AI-assisted (Claude).

@AirKyzzZ

Copy link
Copy Markdown

Tested f8fe26dd on RTX 2060, NVIDIA 566.14, Windows 10 22H2 (19045), clang-cl 23.1.6 + SDK 10.0.26100: pass.

The branch is 1307 commits behind, so I merged it onto main aa2988cc locally (clean, only the test file changes) and built that. d3d12_vulkan_device passes, and exactly the seven cases print Windows 10's runtime refuses it (ours 0x00000000, host 0x80070057), nothing else is excused. On main aa2988cc the same test fails at line 5124: argument_mismatches <= 0 with the two committed-buffer cases. Full ctest: 130 passed / 10 skipped / 0 failed (gameinput disabled; this box has no glslangValidator, so the GLSL-gated tests aren't built here), and main aa2988cc is the same apart from that one failure. Third Windows 10 host after the 3090 and the 4070 Ti, so the pair looks like the runtime's answer and not a driver's. AI-assisted.

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.

6 participants