Skip to content

Tests: skip D3D12 WARP fallback when Wine lacks the adapter - #1411

Open
gurvancampion wants to merge 2 commits into
xcl-dev:mainfrom
gurvancampion:topic/wine-warp-tests
Open

gurvancampion wants to merge 2 commits into
xcl-dev:mainfrom
gurvancampion:topic/wine-warp-tests

Conversation

@gurvancampion

Copy link
Copy Markdown

Ten D3D12 unit tests panic when their hardware device attempt fails and Wine's built-in DXGI returns
E_NOTIMPL from EnumWarpAdapter. Report SKIPPED …: no WARP for that specific Wine result.
The frame-dump test is covered separately in #957.

 D3D12CreateDevice(None, D3D_FEATURE_LEVEL_11_0, &mut dev) -> Err
   CreateDXGIFactory1()
-  factory.EnumWarpAdapter().expect("WARP")          # panics on Wine E_NOTIMPL
+  warp_tests::enum_warp_adapter(&factory)
+    under_wine() && E_NOTIMPL -> skip_test("no WARP") and return
+    any other Err             -> panic!("WARP: {err:?}")
   D3D12CreateDevice(&warp, D3D_FEATURE_LEVEL_11_0, &mut dev)

What is in it

  • crates/xcl/src/hle/d3d12x/warp_tests.rs (wired via #[cfg(test)] mod warp_tests; in mod.rs) shares the Wine E_NOTIMPL check across the ten test sites in bind.rs, console_heap.rs, cpu_writes.rs, fence_x.rs, list_x.rs, real.rs (2 sites), and sparse.rs (3 sites), and adds a unit test (warp_adapter_absence_requires_wine_and_not_implemented) for HRESULT and host classification. Native Windows errors, other enumeration errors, and WARP device creation failures still fail the test.

Tested

Regression run

The diff is compiled only under #[cfg(test)] (no runtime code changes). python3 scripts/pr_check.py --local --test-only returns description ok; the hosted check requires the maintainer test-only label to waive retail smoke for this revision.

Not tested

  • Native Windows, a working WARP device, GPU-backed execution, release builds, and retail titles.

AI use

  • OpenAI Codex (gpt-6.2-sol) checked upstream, wrote the patch and regression test, ran the before/after comparisons, and drafted this description. Antigravity (Gemini 4 Neon) coordinated, reviewed the diff, and verified the PR checks. The author reviewed the diff and description before opening the PR.

@futurepro62

futurepro62 commented Nov 24, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head fd77d7e (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: warp_adapter_absence_requires_wine_and_not_implemented.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.

Thanks!

@Toons29

Toons29 commented Nov 25, 2026

Copy link
Copy Markdown

Regression run of fd77d7e2 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: fd77d7e20f6a429cdea25412ac4d471a670ddbaa
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1632 (PresentX 1632)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14815 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

Wine's built-in DXGI returns E_NOTIMPL from EnumWarpAdapter. Report the missing adapter with the shared GPU skip helper, which still fails in strict mode. Keep other enumeration and WARP device creation errors fatal.

Assisted-by: Codex (GPT-6, exact variant unavailable)
xcl-dev#2345's test_state_with_reserved and the compositor test in present.rs
still panicked on EnumWarpAdapter when Wine's built-in DXGI returns
E_NOTIMPL. They now use the warp_tests helper, so both flush_parked tests
and the compositor test report "no WARP", fail in strict mode, and keep
other enumeration errors fatal.

Assisted-by: Claude Code (Claude Opus 5.5)
@DavidM1911

Copy link
Copy Markdown
Contributor

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

@Anon64

Anon64 commented Nov 27, 2026

Copy link
Copy Markdown

Linux / Wine check of #1411 at head 4d7233e7ee3e765d8b50a599943b95cc9d5ea32e, merged onto main 8b957bec6f82495aec940944c6bf47faa02db590 (no conflicts), against main alone.

Setup

  • Ubuntu 24.04 in Docker, Wine 11.0 (WineHQ stable), Xvfb, no GPU passed into the container, so no Vulkan device for vkd3d.
  • Cross-built with x86_64-pc-windows-gnu (Rust 1.100.0, mingw-w64 GCC 13), debug; tests run through Wine as the target runner. DXC 1.9.2609.5 via XCL_DXC_DIR.
  • Command: cargo test -p xcl --lib --target x86_64-pc-windows-gnu hle::d3d12x -- --test-threads=4

Results

tree passed failed ignored
main 247 13 2
main + #1411 261 0 2

On main the failures are the WARP-backed tests (sparse ×5, readback_routing ×2, fence_x, cpu_writes, console_heap, bind, list_x depth bias, present compositor), each with 0x80004001 Not implemented from WARP. With #1411 each prints SKIPPED …: no WARP and passes; the remaining skips are the existing no GPU ones.

Not tested

  • Windows (MSVC) builds, a Wine setup with a GPU or vkd3d-proton, the rest of the workspace on this tree.

AI use
Claude Code (Claude Opus 5.5) set up the container, ran the tests and wrote this report.

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