Skip to content

Tests: check Microsoft's recorded answers where Wine and Proton have no reference - #3679

Open
kmorales13 wants to merge 1 commit into
ItsNotRexed:mainfrom
kmorales13:test/host-reference-answers
Open

kmorales13 wants to merge 1 commit into
ItsNotRexed:mainfrom
kmorales13:test/host-reference-answers

Conversation

@kmorales13

@kmorales13 kmorales13 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

New TEST item, claimed in #3381 (scope in the status). It replaces #3527, which I closed: that one only skipped the comparisons, so three of the tests checked almost nothing under Wine and Proton.

What and why

Under Wine the host D3D12 is Wine's vkd3d. Under Proton it's vkd3d-proton, and Proton's DXGI answers EnumWarpAdapter with the hardware adapter (WARP not supported, returning first hardware adapter). So the host and WARP references these tests compare with are not Microsoft's runtime. On main (f847748c), six tests fail for that reason alone:

Test Fails under Why
d3d12_r9g9b9e5_uav Proton "WARP mismatch on clear case 1": vkd3d-proton truncates the mantissa tie (0x840a0300) where WARP rounds half-up (0x840e0501)
d3d12_method_variants Proton exit code 5: an access violation inside vkd3d-proton's d3d12core.dll on the edge-case arguments
d3d12_sampler2 Proton the same, at another address
d3d12_fence_timing Wine, Proton GetCustomHeapProperties answers differ from vkd3d's
d3d12_subresource_copy Wine, Proton WriteToSubresource/Map edge cases answered differently by vkd3d
d3d12_private_data Wine SetName(nullptr) answered differently by Wine's vkd3d

Under Wine and Proton each test now skips the host comparison (hostwine::host_is_wine(), as the other host-comparison tests do) and checks the layer against Microsoft's answers recorded in the test. On Windows it checks both: the live runtime and the recorded answers.

Test Checked under Wine and Proton now Where the answers come from
d3d12_r9g9b9e5_uav all 16 texels of all 6 clear cases (before: only that the clears succeeded) WARP's packing rule in docs/d3d12_vulkan.md (round half up, negatives and NaN to 0, +Inf and overflow to 65408, uint clears write 0), recomputed by hand and matching the words already pinned in the test's copy patterns
d3d12_subresource_copy 109 steps per copy path (before: none) new d3d12_subresource_copy_answers.h
d3d12_private_data 667 steps (before: none) new d3d12_private_data_answers.h
d3d12_method_variants, d3d12_sampler2, d3d12_fence_timing their recorded answers, unchanged already in the tests

The two tables are the records these tests compared live with Microsoft's runtime on Windows with 0 mismatches: subresource_copy on RTX 3060 (twice), RX 9070 XT, RTX 3080 + RDNA2 iGPU, RTX 5080 + RDNA2 iGPU and RTX 3070 (see #2736 and #3477); private_data on RTX 4070, RX 7900 XTX, RTX 4090 and an AMD iGPU (see #2533). Neither the tests nor the code they exercise have changed since. So for every compared step the layer's answer is Microsoft's. I can't measure on Windows here, which is why I took the values this way. The steps Microsoft faults on (null data, SetName(nullptr)) are stored as the fault and stay uncompared, as do subresource_copy's default-heap and overlap-byte records, as before. LEONIDA_D3D49_DUMP=1 prints the host's record in the tables' format, for regenerating them on Windows; it refuses to run without Microsoft's runtime. subresource_copy's Map records are now named per resource (Map tex 0 …), so a device without BC formats lines up with the table.

What under Wine and Proton is still not checked: d3d12_fence_timing's comparisons for an unknown heap type, node mask 2 and the CUSTOM heap, and d3d12_sampler2's comparison of the host's own border colours. None of these has a recorded answer, and on Windows they still run.

Related pull requests

Tested

CachyOS Linux, AMD Ryzen 7 7700X iGPU (RDNA2, RADV, Mesa 26.3.1), Windows runtime cross-built with clang-cl 23.1.5 and xwin (MSVC CRT 14.44, SDK 10.0.26100). Full ctest (140 tests):

main failed this PR failed
Proton Experimental (11.0-20261112) 6 1: d3d12_compute (#3023)
Wine 11.22 5 2: d3d12_compute (#3023), device_proxy (a proxy test over Wine's vkd3d)
  • Wrong answers fail: I changed one recorded value in each new table and one of WARP's words, and the test failed on each, naming the step.
  • A device without BC formats: with BC forced off, subresource_copy compares 107 steps per path with 0 mismatches.
  • Not tested: Windows and MSVC (no Windows machine here). On Windows host_is_wine() is false, so the live comparisons run as before, plus the recorded ones. It would help if someone on Windows ran d3d12_subresource_copy and d3d12_private_data to confirm the tables against the live runtime.

No game files. AI-assisted (Claude-Opus).

@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 78f9d96 all asserted comparisons passed on Windows x64 with RTX 5070 driver 616.56, MSVC 19.50 and SDK 10.0.26100.0. Both Vulkan copy paths matched 109 live and 109 recorded steps per adapter. Raw dumps matched 111/117 rows: the six differences were the intentionally excluded overlap hashes and default-heap results. Private data matched all 667 asserted steps and all 672 dump rows. Unmodified binaries used hardware D3D12; a private variant explicitly selected WARP for the second comparison. AI-assisted.

@sh1shu1

sh1shu1 commented Nov 22, 2026

Copy link
Copy Markdown

Tested 78f9d96 on NVIDIA RTX 4070 SUPER (driver 616.92), Windows 11 26200, MSVC 14.44, Vulkan SDK 1.4.363, RelWithDebInfo: pass, no regression against main f847748.

  • ctest: 140/140 passed, same 8 skips as main f847748
  • d3d12_fence_timing, d3d12_method_variants, d3d12_private_data, d3d12_r9g9b9e5_uav, d3d12_sampler2, d3d12_subresource_copy: 6/6
  • run_gpu_tests (LEONIDA_VK_VALIDATION=1): 153/199 native, 184/199 with LEONIDA_W64_EMULATE=1, 0 failed; identical to main f847748
    AI-assisted (Claude Code, Claude Fable 5.1).

@FaKL-Code

Copy link
Copy Markdown
Contributor

Tested 78f9d96 (merged onto main f847748) 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 on Windows, where both the host and the recorded answers are checked

  • Merges cleanly; no new compiler warnings against main.
  • ctest: 131 of 131 pass (same 8 skips as main). Loader test passes; validation run: 52 tests clean (2 skipped, as on main).
  • The six tests with -V, all pass:
    • d3d12_private_data: "667 steps compared with the host (5 more the host faults on), 0 mismatches", and the same line for "Microsoft's recorded answers".
    • d3d12_subresource_copy: 109 steps against the host and 109 against the recorded answers, 0 mismatches, for both the host-image-copy and the staging-copy paths (8 more not compared in each).
    • d3d12_r9g9b9e5_uav: "6/6 cases matched WARP bit-for-bit".
    • d3d12_fence_timing: the GetCustomHeapProperties cases "match the host runtime".
    • d3d12_method_variants and d3d12_sampler2: pass.
  • So on Microsoft's runtime the new answer tables agree with the live host at every step compared. I have no Wine or Proton here to run the recorded-only path.
  • Main has moved since (aa2988c); git merge-tree merges this head with it cleanly. I didn't rebuild on it.

AI-assisted (Claude).

…no reference

Under Wine the host D3D12 is vkd3d and under Proton vkd3d-proton, and
Proton's EnumWarpAdapter returns the hardware adapter, so the host and
WARP references six tests compare with are not Microsoft's runtime:
d3d12_r9g9b9e5_uav, d3d12_method_variants and d3d12_sampler2 fail under
Proton (the last two crash inside vkd3d-proton), d3d12_fence_timing and
d3d12_subresource_copy under both, d3d12_private_data under Wine.

The six skip the host comparison there with hostwine::host_is_wine() and
check the layer against Microsoft's answers recorded in the test instead,
so Wine and Proton still check values. d3d12_r9g9b9e5_uav gets WARP's
words for its six clear cases, from the packing rule in
docs/d3d12_vulkan.md. d3d12_subresource_copy and d3d12_private_data get
answer tables, taken from the records that Windows runs on NVIDIA and AMD
compared with Microsoft's runtime with no mismatches; LEONIDA_D3D49_DUMP=1
prints the host's record on Windows to regenerate them. The other three
already had recorded answers. Windows still compares with the live
runtime too.
@Hanioe2

Hanioe2 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Native Windows verification of the refreshed private-data table at b136ee4680c4a04c44653da4325d83cee130fbfe: all 672 ordered rows agree with a live LEONIDA_D3D49_DUMP=1 capture here (Windows 11 26200, D3D12Core 10.0.26100.9818, RTX 5070/610.88, MSVC 19.44.35227). I built the test on 03b09a08 with the byte-identical d3d12_private_data_test.cpp and d3d12_private_data_answers.h from this head. It matched both the live and recorded references on all 667 compared steps. With the previous table, the live comparison passed and all 75 wide-name results differed from the recording.

I also checked the subresource-copy changes together with #3077 at 2612b150 on 03b09a08. The host-copy, staging-copy, and forced-retry paths each matched 109 live and 109 recorded steps. The focused seven-test set passed on rerun after the table refresh. One earlier run crashed in d3d12_fence_timing and the cause is undetermined.

Synthetic inputs only. 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.

5 participants