[PR #519] [MERGED] Tests: eight host-comparison tests skip Wine's host and still check the layer (TEST-WINE-HOST-GUARDS) #567

Closed
opened 2026-11-26 20:18:19 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/519
Author: @milk4sale
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD

Base: main ← Head: test/wine-host-guards


📝 Commits (3)

  • ffce6b5 Tests: eight host-comparison tests skip Wine's host and still check the layer (TEST-WINE-HOST-GUARDS)
  • b358f47 Tests: heap properties, residency and typeless depth check the layer on its own (TEST-WINE-HOST-GUARDS)
  • e80697b Tests: d3d12_heap_properties holds every output asked for to having been written (TEST-WINE-HOST-GUARDS)

📊 Changes

8 files changed (+313 additions, -46 deletions)

View changed files

📝 runtime/test/d3d12_heap_properties_test.cpp (+101 -3)
📝 runtime/test/d3d12_indirect_dispatch_count_test.cpp (+36 -20)
📝 runtime/test/d3d12_noop_copy_test.cpp (+11 -5)
📝 runtime/test/d3d12_residency_test.cpp (+78 -4)
📝 runtime/test/d3d12_typeless_depth_test.cpp (+65 -5)
📝 runtime/test/dxgi_host_parity_test.cpp (+4 -1)
📝 runtime/test/dxgi_swapchain_test.cpp (+14 -6)
📝 runtime/test/dxgi_waitable_latency_test.cpp (+4 -2)

📄 Description

Claimed in the coordination issue as: TEST-WINE-HOST-GUARDS (claim)

What and why

Eight tests compare the layer with the host's D3D12/DXGI without the runtime/test/host_wine.h guard the other host-comparison tests use. Under Wine that host is vkd3d and Wine's own DXGI, so all eight fail on its answers, and in three of them the layer's own checks never run:

Test What happens under Wine on main With this change
d3d12_noop_copy vkd3d accepts the upload-heap self-copy; the test stops at "native WARP incorrectly accepted" before it looks at the layer host run skipped, layer checked: passes
d3d12_indirect_dispatch_count exits 1 with no message: Wine's D3DCompile has no RWByteAddressBuffer::InterlockedAdd (E5005), so the reference shader does not build host runs skipped, the layer's 8 results checked against expected(): passes
d3d12_typeless_depth the host reads both planes back as zeros; the layer holds the cleared values (00 00 40 / 00 00 80 3e for depth 0.25, stencil 5a) the comparison with the host is left out and the layer's readback is checked against the cleared depth and stencil at every texel: passes
d3d12_residency 14 mismatches: vkd3d answers S_OK where the layer answers E_INVALIDARG no host comparison; the layer's own record is checked (the valid calls succeed, the device is never removed, the fence reaches the values asked for): passes
d3d12_heap_properties 44 mismatches: vkd3d reports other heap flags no host comparison; the layer's own record is checked (the call succeeds for committed and placed resources and reports the heap type they were created with, and fails for reserved ones): passes
dxgi_swapchain 18 of 45 CreateSwapChainForHwnd answers differ from Wine's DXGI, and the test returns before its own swap-chain checks; further on, Wine's DXGI reports a driver version of its own where the layer reports 0 the three host comparisons skipped, the rest runs: passes
dxgi_host_parity page fault inside Wine's wined3d on GetBuffer(0, iid, null) exits 77: every row is a host comparison
dxgi_waitable_latency page fault inside Wine's dxgi on GetMaximumFrameLatency(null), after the layer's suite had passed host suite skipped, the layer's contracts checked: passes

The guard is hostwine::host_is_wine(), as in the other tests. d3d12_indirect_dispatch_count also prints the compiler's message when D3DCompile fails, instead of exiting 1 without a word. Tests only; no layer change.

Not in this pull request: d3d12_clear and d3d12_clear_formats fail the same way under Wine (in d3d12_clear_formats the layer has the stencil values that were cleared and Wine's host reads 0), but #307 and #428 touch those files.

Tested

Cross-built on Linux with clang-cl 23.1.4 and xwin (SDK 10.0.26100), run under wine-staging 11.21:

  • The eight tests on this branch: 7 pass and 1 exits 77 (dxgi_host_parity). Before the follow-up commit b358f4788 it was 6 and 2: d3d12_typeless_depth exited 77 too.
  • The whole suite (300 tests, one disabled), ctest -j 4: main 8f481cf16 gives 244 passed, 23 failed, 32 skipped; this branch (on c023a365a) gives 250 passed, 15 failed, 34 skipped. The eight tests are the only ones whose result changed, and their sources are the same in both commits.
  • Negative control: with host_is_wine() forced to false and the eight tests rebuilt, each fails as it does on main (the same messages and mismatch counts, the same two fault addresses in wined3d and dxgi), so the path Windows takes behaves as before.
  • python -I scripts/check_no_game_data.py on the eight files, and git diff --check.
  • Follow-up b358f4788, after review: d3d12_heap_properties, d3d12_residency and d3d12_typeless_depth check the layer by itself on every host, before any comparison, and dxgi_swapchain names Wine as the reason it compared nothing. Controls on main 3ed8e50b7: a layer answering E_FAIL for a buffer's GetHeapProperties fails the first, a fence reaching 6 for 7 fails the second, and a flipped depth or stencil byte fails the third; with host_is_wine() forced to false the three pass their layer checks and then fail in the host comparison as on main (44 mismatches, 14 mismatches, readback differs from WARP). The whole suite was not run again for this commit.
  • Second follow-up e80697bab: the layer check of d3d12_heap_properties also holds every output asked for to having been written. With the layer leaving the two node masks unwritten, b358f4788 passes and e80697bab fails (62 wrong answers).

Not run on Windows, and not built with MSVC: I have neither here. On Windows host_is_wine() is false and each test takes the path it took before, except that since the follow-up three of them first run their layer checks; that part has not run on Windows.

The 15 that still fail here are outside this change: d3d12_clear and d3d12_clear_formats (above), d3d12_present and xbox_present (a tiling compositor resizes their 320x240 window; both pass in a nested gamescope session), device_proxy and device_proxy_trace, and nine loader and shim tests.

GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 620.70.06, Linux (CachyOS), through wine-staging 11.21

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • 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.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/519 **Author:** [@milk4sale](https://github.com/milk4sale) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `test/wine-host-guards` --- ### 📝 Commits (3) - [`ffce6b5`](https://github.com/ubiquitarianism/leonida/commit/ffce6b5c394765977d12840b8c25cb8773ab9b5e) Tests: eight host-comparison tests skip Wine's host and still check the layer (TEST-WINE-HOST-GUARDS) - [`b358f47`](https://github.com/ubiquitarianism/leonida/commit/b358f4788b09ece8a6090499f730f8f6cee60e91) Tests: heap properties, residency and typeless depth check the layer on its own (TEST-WINE-HOST-GUARDS) - [`e80697b`](https://github.com/ubiquitarianism/leonida/commit/e80697babe0dd79ff6389b2e6a830a94d2508180) Tests: d3d12_heap_properties holds every output asked for to having been written (TEST-WINE-HOST-GUARDS) ### 📊 Changes **8 files changed** (+313 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/d3d12_heap_properties_test.cpp` (+101 -3) 📝 `runtime/test/d3d12_indirect_dispatch_count_test.cpp` (+36 -20) 📝 `runtime/test/d3d12_noop_copy_test.cpp` (+11 -5) 📝 `runtime/test/d3d12_residency_test.cpp` (+78 -4) 📝 `runtime/test/d3d12_typeless_depth_test.cpp` (+65 -5) 📝 `runtime/test/dxgi_host_parity_test.cpp` (+4 -1) 📝 `runtime/test/dxgi_swapchain_test.cpp` (+14 -6) 📝 `runtime/test/dxgi_waitable_latency_test.cpp` (+4 -2) </details> ### 📄 Description Claimed in the coordination issue as: TEST-WINE-HOST-GUARDS ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7124174128)) ### What and why Eight tests compare the layer with the host's D3D12/DXGI without the `runtime/test/host_wine.h` guard the other host-comparison tests use. Under Wine that host is vkd3d and Wine's own DXGI, so all eight fail on its answers, and in three of them the layer's own checks never run: | Test | What happens under Wine on `main` | With this change | |---|---|---| | `d3d12_noop_copy` | vkd3d accepts the upload-heap self-copy; the test stops at "native WARP incorrectly accepted" before it looks at the layer | host run skipped, layer checked: passes | | `d3d12_indirect_dispatch_count` | exits 1 with no message: Wine's `D3DCompile` has no `RWByteAddressBuffer::InterlockedAdd` (E5005), so the reference shader does not build | host runs skipped, the layer's 8 results checked against `expected()`: passes | | `d3d12_typeless_depth` | the host reads both planes back as zeros; the layer holds the cleared values (`00 00 40` / `00 00 80 3e` for depth 0.25, stencil `5a`) | the comparison with the host is left out and the layer's readback is checked against the cleared depth and stencil at every texel: passes | | `d3d12_residency` | 14 mismatches: vkd3d answers `S_OK` where the layer answers `E_INVALIDARG` | no host comparison; the layer's own record is checked (the valid calls succeed, the device is never removed, the fence reaches the values asked for): passes | | `d3d12_heap_properties` | 44 mismatches: vkd3d reports other heap flags | no host comparison; the layer's own record is checked (the call succeeds for committed and placed resources and reports the heap type they were created with, and fails for reserved ones): passes | | `dxgi_swapchain` | 18 of 45 `CreateSwapChainForHwnd` answers differ from Wine's DXGI, and the test returns before its own swap-chain checks; further on, Wine's DXGI reports a driver version of its own where the layer reports 0 | the three host comparisons skipped, the rest runs: passes | | `dxgi_host_parity` | page fault inside Wine's `wined3d` on `GetBuffer(0, iid, null)` | exits 77: every row is a host comparison | | `dxgi_waitable_latency` | page fault inside Wine's `dxgi` on `GetMaximumFrameLatency(null)`, after the layer's suite had passed | host suite skipped, the layer's contracts checked: passes | The guard is `hostwine::host_is_wine()`, as in the other tests. `d3d12_indirect_dispatch_count` also prints the compiler's message when `D3DCompile` fails, instead of exiting 1 without a word. Tests only; no layer change. Not in this pull request: `d3d12_clear` and `d3d12_clear_formats` fail the same way under Wine (in `d3d12_clear_formats` the layer has the stencil values that were cleared and Wine's host reads 0), but #307 and #428 touch those files. ### Tested Cross-built on Linux with clang-cl 23.1.4 and xwin (SDK 10.0.26100), run under wine-staging 11.21: - The eight tests on this branch: 7 pass and 1 exits 77 (`dxgi_host_parity`). Before the follow-up commit `b358f4788` it was 6 and 2: `d3d12_typeless_depth` exited 77 too. - The whole suite (300 tests, one disabled), `ctest -j 4`: `main` 8f481cf16 gives 244 passed, 23 failed, 32 skipped; this branch (on c023a365a) gives 250 passed, 15 failed, 34 skipped. The eight tests are the only ones whose result changed, and their sources are the same in both commits. - Negative control: with `host_is_wine()` forced to `false` and the eight tests rebuilt, each fails as it does on `main` (the same messages and mismatch counts, the same two fault addresses in `wined3d` and `dxgi`), so the path Windows takes behaves as before. - `python -I scripts/check_no_game_data.py` on the eight files, and `git diff --check`. - Follow-up `b358f4788`, after review: `d3d12_heap_properties`, `d3d12_residency` and `d3d12_typeless_depth` check the layer by itself on every host, before any comparison, and `dxgi_swapchain` names Wine as the reason it compared nothing. Controls on `main` 3ed8e50b7: a layer answering `E_FAIL` for a buffer's `GetHeapProperties` fails the first, a fence reaching 6 for 7 fails the second, and a flipped depth or stencil byte fails the third; with `host_is_wine()` forced to `false` the three pass their layer checks and then fail in the host comparison as on `main` (44 mismatches, 14 mismatches, readback differs from WARP). The whole suite was not run again for this commit. - Second follow-up `e80697bab`: the layer check of `d3d12_heap_properties` also holds every output asked for to having been written. With the layer leaving the two node masks unwritten, `b358f4788` passes and `e80697bab` fails (62 wrong answers). Not run on Windows, and not built with MSVC: I have neither here. On Windows `host_is_wine()` is false and each test takes the path it took before, except that since the follow-up three of them first run their layer checks; that part has not run on Windows. The 15 that still fail here are outside this change: `d3d12_clear` and `d3d12_clear_formats` (above), `d3d12_present` and `xbox_present` (a tiling compositor resizes their 320x240 window; both pass in a nested gamescope session), `device_proxy` and `device_proxy_trace`, and nine loader and shim tests. GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 620.70.06, Linux (CachyOS), through wine-staging 11.21 AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] 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. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:19 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#567
No description provided.