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

Open
gurvancampion wants to merge 2 commits from upstream-pr/1411 into main
gurvancampion commented 2026-11-24 15:42:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gurvancampion on 2026-11-24T15:42:36Z.


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

  • Hardware / environment: Ryzen 7 9800X3D, RTX 5090 (NVIDIA 615.78.08 installed), Arch Linux, GE-Proton 11-12, Vulkan disabled and Wine's built-in DXGI with renderer=no3d. Debug x86_64-pc-windows-msvc cross-build with Rust 1.99.0 and cargo-xwin 0.24.1.
  • cargo xwin test --workspace --target x86_64-pc-windows-msvc --no-fail-fast -- --test-threads=4 on base 930e8b4 and head fd77d7e:
    • Base 930e8b4: 737 passed, 14 failed, 41 ignored (108 explicit skips).
    • Head fd77d7e: 748 passed, 4 failed, 41 ignored (118 explicit skips, +10 no WARP). The 4 remaining failures are the frame-dump test (#957), XMA2 (#890), synthetic-title e2e, and PLS quota (#810 / #937).
  • Targeted runs with --nocapture: all 10 changed tests report SKIPPED …: no WARP; all 10 fail when XCL_REQUIRE_GPU=wave64 or XCL_REQUIRE_GPU=mesh is set. The new unit test passed and failed against a negative control that rejected every HRESULT.
  • rustfmt --check --edition 2021 crates/xcl/src/hle/d3d12x/warp_tests.rs and git diff --check origin/main HEAD: passed.

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.
<!-- greyfinch-sync:ivall/xcl:issue:5475410434 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1411). Originally posted by [gurvancampion](https://github.com/gurvancampion) on 2026-11-24T15:42:36Z. --- 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. ```diff 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** - Hardware / environment: Ryzen 7 9800X3D, RTX 5090 (NVIDIA 615.78.08 installed), Arch Linux, GE-Proton 11-12, Vulkan disabled and Wine's built-in DXGI with `renderer=no3d`. Debug `x86_64-pc-windows-msvc` cross-build with Rust 1.99.0 and cargo-xwin 0.24.1. - `cargo xwin test --workspace --target x86_64-pc-windows-msvc --no-fail-fast -- --test-threads=4` on base `930e8b4` and head `fd77d7e`: - Base `930e8b4`: 737 passed, 14 failed, 41 ignored (108 explicit skips). - Head `fd77d7e`: 748 passed, 4 failed, 41 ignored (118 explicit skips, +10 `no WARP`). The 4 remaining failures are the frame-dump test (#957), XMA2 (#890), synthetic-title e2e, and PLS quota (#810 / #937). - Targeted runs with `--nocapture`: all 10 changed tests report `SKIPPED …: no WARP`; all 10 fail when `XCL_REQUIRE_GPU=wave64` or `XCL_REQUIRE_GPU=mesh` is set. The new unit test passed and failed against a negative control that rejected every HRESULT. - `rustfmt --check --edition 2021 crates/xcl/src/hle/d3d12x/warp_tests.rs` and `git diff --check origin/main HEAD`: passed. **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 commented 2026-11-24 16:07:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T15:55:30Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7136840116 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1411#issuecomment-7136840116). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T15:55:30Z. --- 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 commented 2026-11-24 18:08:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T17:08:31Z.


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

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

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7138747520 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1411#issuecomment-7138747520). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T17:08:31Z. --- 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 commented 2026-11-25 04:10:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:29:11Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7151959096 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1411#issuecomment-7151959096). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T03:29:11Z. --- 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.
DavidM1911 commented 2026-11-26 06:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T05:13:06Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7183286567 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1411#issuecomment-7183286567). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T05:13:06Z. --- 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 commented 2026-11-27 03:45:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-27T03:45:52Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7209252465 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1411#issuecomment-7209252465). Originally posted by [Anon64](https://github.com/Anon64) on 2026-11-27T03:45:52Z. --- 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.
Foniass commented 2026-12-01 05:39:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:39:42Z.


Triage (#1607) – head 4d7233e

No open PR makes the same change; merged #957 only made a different WARP frame-dump test in present.rs skip, and the compositor test changed here still unwraps EnumWarpAdapter on main.
The skip only applies under Wine with E_NOTIMPL, so Windows behaviour is unchanged. main now has more EnumWarpAdapter().expect("WARP") sites than the PR covers (e.g. gpu_times.rs, bind.rs, list_x.rs, console_heap.rs), so a rebase needs to cover them too; the PR description check is failing.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7302004182 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1411#issuecomment-7302004182). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:39:42Z. --- **Triage (#1607)** – head 4d7233e No open PR makes the same change; merged #957 only made a different WARP frame-dump test in present.rs skip, and the compositor test changed here still unwraps EnumWarpAdapter on main. The skip only applies under Wine with E_NOTIMPL, so Windows behaviour is unchanged. main now has more EnumWarpAdapter().expect("WARP") sites than the PR covers (e.g. gpu_times.rs, bind.rs, list_x.rs, console_heap.rs), so a rebase needs to cover them too; the PR description check is failing. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1411:upstream-pr/1411'
git switch 'upstream-pr/1411'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1411'
git switch 'upstream-pr/1411'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1411'
git switch 'upstream-pr/1411'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1411'
git switch 'main'
git merge --squash 'upstream-pr/1411'
git switch 'main'
git merge --ff-only 'upstream-pr/1411'
git switch 'main'
git merge 'upstream-pr/1411'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
xcl-dev/xcl!1401
No description provided.