Tests: eight host-comparison tests skip Wine's host and still check the layer (TEST-WINE-HOST-GUARDS) #519
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!519
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/519/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@milk4sale on GitHub · 2026-11-24 06:51 UTC · original
milk4sale:test/wine-host-guards→main· +313 −46 · 8 files · 3 commits · merged 2026-11-24 21:27 UTCClaimed 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.hguard 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:maind3d12_noop_copyd3d12_indirect_dispatch_countD3DCompilehas noRWByteAddressBuffer::InterlockedAdd(E5005), so the reference shader does not buildexpected(): passesd3d12_typeless_depth00 00 40/00 00 80 3efor depth 0.25, stencil5a)d3d12_residencyS_OKwhere the layer answersE_INVALIDARGd3d12_heap_propertiesdxgi_swapchainCreateSwapChainForHwndanswers 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 0dxgi_host_paritywined3donGetBuffer(0, iid, null)dxgi_waitable_latencydxgionGetMaximumFrameLatency(null), after the layer's suite had passedThe guard is
hostwine::host_is_wine(), as in the other tests.d3d12_indirect_dispatch_countalso prints the compiler's message whenD3DCompilefails, instead of exiting 1 without a word. Tests only; no layer change.Not in this pull request:
d3d12_clearandd3d12_clear_formatsfail the same way under Wine (ind3d12_clear_formatsthe 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:
dxgi_host_parity). Before the follow-up commitb358f4788it was 6 and 2:d3d12_typeless_depthexited 77 too.ctest -j 4:main8f481cf16gives 244 passed, 23 failed, 32 skipped; this branch (onc023a365a) 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.host_is_wine()forced tofalseand the eight tests rebuilt, each fails as it does onmain(the same messages and mismatch counts, the same two fault addresses inwined3danddxgi), so the path Windows takes behaves as before.python -I scripts/check_no_game_data.pyon the eight files, andgit diff --check.b358f4788, after review:d3d12_heap_properties,d3d12_residencyandd3d12_typeless_depthcheck the layer by itself on every host, before any comparison, anddxgi_swapchainnames Wine as the reason it compared nothing. Controls onmain3ed8e50b7: a layer answeringE_FAILfor a buffer'sGetHeapPropertiesfails the first, a fence reaching 6 for 7 fails the second, and a flipped depth or stencil byte fails the third; withhost_is_wine()forced tofalsethe three pass their layer checks and then fail in the host comparison as onmain(44 mismatches, 14 mismatches, readback differs from WARP). The whole suite was not run again for this commit.e80697bab: the layer check ofd3d12_heap_propertiesalso holds every output asked for to having been written. With the layer leaving the two node masks unwritten,b358f4788passes ande80697babfails (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_clearandd3d12_clear_formats(above),d3d12_presentandxbox_present(a tiling compositor resizes their 320x240 window; both pass in a nested gamescope session),device_proxyanddevice_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
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🤖 Generated with Claude Code
@kawaii-shakal on GitHub · 2026-11-24 07:55 UTC · original
Review of head
6c1428a779eaf95d8758d6ffc747ddf746cf203f(read only; Linux, no Windows, no Wine, no GPU).What I did: I read the diff of all eight tests and
runtime/test/host_wine.h. I could not build or run them here (they need a Windows toolchain plus Wine or Windows).Findings, from reading the code (nothing executed):
host_is_wine()looks forwine_get_versionin ntdll, which Microsoft's ntdll does not export, so every new guard is false there. In each test the host branch is the old code, unchanged apart from indentation. The one new behaviour is the extraD3DCompileerror text ind3d12_indirect_dispatch_count.noop_copy,indirect_dispatch_count,residency,heap_properties,dxgi_swapchainanddxgi_waitable_latencyall still run the layer's own checks. Inindirect_dispatch_count, settingnative_result = wantmakes the WARP clause and the laternative_result != wantbranch no-ops, andlayer_result != wantis still enforced.d3d12_typeless_depthanddxgi_host_parity, Wine exits 77 and the layer is not checked at all there. The PR says so, and both tests are pure host comparisons, so this is expected. Still, it means CI on a Wine host gives no coverage for these two.dxgi_swapchainprints "no host D3D12 device to compare with, skipped" (lines 645 and 648) because the guard returns the same -1. That message is misleading in a Wine log. A separate message, or a printf in the guard, would make the reason clear.Not tested: I did not build or run anything (no clang-cl/xwin, Wine or Windows here). I did not reproduce the before/after ctest counts.
Review written by Claude (Claude Code, Opus 5.5), an AI agent, posted from a contributor's account.
@moffington on GitHub · 2026-11-24 14:04 UTC · original
I reproduced all eight failures on the merge base and got six passes and two skips at 6c1428a77 on RTX 3060 / Wine 11.20. Forcing the host path back on reproduced all eight failures. The copy, indirect-dispatch, swap-chain, and latency checks still exercise Leonida independently.
Please add layer assertions before treating heap properties and residency as correctness passes under Wine. In a local probe, a committed-buffer GetHeapProperties returning E_FAIL and a residency fence reaching 6 instead of 7 both passed. Please also retain a layer-only typeless-depth readback check. Both formats matched the expected depth and stencil at every texel on Leonida, while Wine’s reference returned zeros. The Wine guards and Windows comparisons can stay.
@milk4sale on GitHub · 2026-11-24 16:43 UTC · original
@moffington @kawaii-shakal thanks for the reviews.
b358f4788is a follow-up commit on top offfce6b5c3, the head you both looked at (same eight files as6c1428a77); nothing was rebased or force-pushed.Layer assertions for heap properties and residency. Both tests now check the layer's own record on every host, before any comparison, so a run with no host to compare with (Wine, or no host device) fails on a wrong answer:
d3d12_heap_properties: for every committed or placed resource the layer created,GetHeapPropertieshas to succeed with both outputs, with the properties alone and with the flags alone;Typehas to be the heap type it was created with (for a custom heap the CPU page property and the memory pool too); and a call asking for one output has to report what the call asking for both does. For a reserved resource the call has to fail. The values D3D12 derives itself (the flags a committed resource reports, the node masks) stay with the host comparison: I have no Microsoft answers recorded for them and did not want to pin the layer's own.d3d12_residency: no call may raise an exception, the plainly valid calls (a buffer, a heap, the named priorities, twoEnqueueMakeResidentcalls) have to succeed, the device may never be removed, and afterEnqueueMakeResidentthe fence has to hold the value asked for, stay where it was for a lower one, and not move after a failure.Your two probes, rebuilt into the layer here: with
GetHeapPropertiesansweringE_FAILfor buffers,d3d12_heap_propertiesexits 1 (139 wrong answers reported); with the fence reaching 6 for 7,d3d12_residencyexits 1 with one line,EnqueueMakeResident NONE, two objects, value 7 (fence): the layer answers 0x6.Layer-only typeless-depth readback.
d3d12_typeless_depthno longer exits 77 under Wine. The layer's readback has to hold the cleared depth and stencil at every texel (0.25 /0x5a, and 0.75 /0x3cinside the rectangle), for both formats; under Wine that is the whole check and the test passes, elsewhere it runs before the comparison with WARP. ForR24G8the depth is the low 24 bits with one step of tolerance, for a device that keeps D24 as a float. A flipped depth byte and a flipped stencil byte each fail it, for both formats.The swap-chain message. Under Wine
dxgi_swapchainnow printsthe host's DXGI is Wine's, not compared with itfor both comparisons instead of "no host D3D12 device".With
LEONIDA_D3D49_VERBOSE=1the first two tests also print the layer's record when there is no host.Tested on
main3ed8e50b7with both commits, clang-cl 23.1.4 + xwin, wine-staging 11.21, RTX 4070 Ti (NVIDIA 620.70.06): seven of the eight tests pass anddxgi_host_parityexits 77 (it is still a pure host comparison). Withhost_is_wine()forced tofalse, the three changed tests pass their new layer checks and then fail in the host comparison as they do onmain(44 mismatches, 14 mismatches,readback differs from WARP), so the path Windows takes still ends in the comparison. Not run on Windows and not built with MSVC: the new checks run there too, before the comparison, so a Windows run of these three would be welcome.AI-assisted.
@milk4sale on GitHub · 2026-11-24 19:13 UTC · original
One more small commit,
e80697bab, on top ofb358f4788: a gap in the layer check I added tod3d12_heap_properties.The check compared a properties-only call with the call asking for both outputs, and passed when both still held the sentinel the outputs start as. So a
GetHeapPropertiesthat answeredS_OKand left a field unwritten passed for it. Each of the five property fields and the flags now also has to differ from the sentinel.Control, with the layer rebuilt to leave
CreationNodeMaskandVisibleNodeMaskunwritten:b358f4788passes (31 resources, 0 wrong),e80697babexits 1 with 62 wrong answers. On the unchanged layer it passes as before. Same setup as above (wine-staging 11.21, RTX 4070 Ti, NVIDIA 620.70.06); one file, tests only, not run on Windows. AI-assisted.@kawaii-shakal on GitHub · 2026-11-24 19:18 UTC · original
All eight affected tests passed on native Windows with MSVC (RelWithDebInfo), RTX 5070 Ti and Vulkan validation enabled. I used
b358f4788plus the updated heap-properties source frome80697bab(verified Git blob1033e01e). The layer-only heap checks covered 31 resources, followed by 561 host comparisons with zero mismatches. Residency passed all 110 layer checks and all 99 comparable host values. Both typeless depth formats matched WARP, 120 bytes each. The five other affected tests also passed, including all 63 DXGI host-parity rows. This run covered the eight changed tests on Windows.— Codex
@QemmHD on GitHub · 2026-11-24 21:27 UTC · original
Merging.
Why merged: TEST-WINE-HOST-GUARDS, test-only: eight host-comparison tests skip the host part under Wine and still check the layer, and the heap-properties and residency tests gain layer-only assertions. moffington's request for layer assertions is done, and kawaii-shakal ran all 8 on an RTX 5070 Ti with validation.
Why it's good: 8/8 pass both plain and under validation, with no skips on Windows. The only host libraries loaded are d3dcompiler_47 from SYSTEM32 and dxgi.dll.
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main
66d4f5aa3, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative of this batch (13 PRs) on main0b45fdc21: the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The only failures are main's: d3d12_depth_resolve (pre-existing) and d3d12_close_parity (the #510 regression, fixed by #1286). All d3d12_* tests under validation show 0 VUIDs. git merge-tree against current main6261ca916: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.AI-assisted (Claude Code, Claude Opus 5.5).