Tests: compare CheckFeatureSupport hook against host D3D12 driver #547

Manually merged
github merged 1 commit from gh-pr/547/head into gh-pr/547/base 2026-11-26 04:25:19 +00:00
Owner

@⁠GustavoEllwanger on GitHub · 2026-11-24 01:37 UTC · original
GustavoEllwanger:test/d3d12-check-feature-support-host → main · +249 −0 · 1 files · 1 commits · merged 2026-11-25 19:19 UTC

Part of #480.

What is in it
Adds a standalone integration test (crates/xcl/tests/d3d12_check_feature_support.rs) that compares XCL's CheckFeatureSupport vtable hook (d3d12x::real) directly against the host PC D3D12 driver on the same adapter, with no console files or game data required:

  • Captures the unadopted ID3D12Device::CheckFeatureSupport entry point and adapter LUID before d3d12x::real::init() adopts the device vtable, then verifies both point to the same adapter and that vtable slot #13 is intercepted by XCL.
  • Verifies exact PC-sized queries (D3D12_OPTIONS through D3D12_OPTIONS13, ARCHITECTURE, ARCHITECTURE1, GPU_VIRTUAL_ADDRESS_SUPPORT, SHADER_MODEL, ROOT_SIGNATURE, SHADER_CACHE, EXISTING_HEAPS, FORMAT_SUPPORT, MULTISAMPLE_QUALITY_LEVELS, and FORMAT_INFO) return the same HRESULT and payload bytes as the host driver.
  • Verifies oversized console-sized structs (pc_size + 8, as titles such as XDefiant pass) fail on the raw host driver, succeed through XCL with the host driver's prefix bytes, and zero the trailing console bytes.
  • Verifies console-only formats (116..=120) return the host driver's answers for their mapped PC formats (10, 45, 46, 47) while restoring the caller's console format field.

Tested

  • Adapter: AMD Radeon RX 7600 (8133 MiB VRAM, RDNA3, Adrenalin 26.11.2 / driver 32.0.32029.2010), Windows 11 x64.
  • cargo test -p xcl --test d3d12_check_feature_support -- --nocapture: 3 passed, 0 failed, 0 ignored (RX 7600).
  • XCL_ADAPTER=warp cargo test -p xcl --test d3d12_check_feature_support -- --nocapture: 3 passed, 0 failed, 0 ignored (WARP software renderer).
  • cargo test --workspace -- --test-threads=4: 680 passed, 0 failed, 41 ignored, 0 SKIPPED.

Not tested

  • Retail Xbox games (scripts/smoke.ps1 not run; test-only PR with no changes under crates/xcl/src/).
  • Non-AMD GPUs (NVIDIA / Intel hardware) and non-default XCL_RAYTRACING overrides.

AI use
Written and verified with Antigravity (Gemini 4 Carbon); all commands and tests were run locally on this machine's RX 7600 and WARP adapter.

**@⁠GustavoEllwanger** on GitHub · 2026-11-24 01:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/547) `GustavoEllwanger:test/d3d12-check-feature-support-host` → `main` · +249 −0 · 1 files · 1 commits · merged 2026-11-25 19:19 UTC Part of #480. **What is in it** Adds a standalone integration test (`crates/xcl/tests/d3d12_check_feature_support.rs`) that compares XCL's `CheckFeatureSupport` vtable hook (`d3d12x::real`) directly against the host PC D3D12 driver on the same adapter, with no console files or game data required: - Captures the unadopted `ID3D12Device::CheckFeatureSupport` entry point and adapter LUID before `d3d12x::real::init()` adopts the device vtable, then verifies both point to the same adapter and that vtable slot `#13` is intercepted by XCL. - Verifies exact PC-sized queries (`D3D12_OPTIONS` through `D3D12_OPTIONS13`, `ARCHITECTURE`, `ARCHITECTURE1`, `GPU_VIRTUAL_ADDRESS_SUPPORT`, `SHADER_MODEL`, `ROOT_SIGNATURE`, `SHADER_CACHE`, `EXISTING_HEAPS`, `FORMAT_SUPPORT`, `MULTISAMPLE_QUALITY_LEVELS`, and `FORMAT_INFO`) return the same `HRESULT` and payload bytes as the host driver. - Verifies oversized console-sized structs (`pc_size + 8`, as titles such as XDefiant pass) fail on the raw host driver, succeed through XCL with the host driver's prefix bytes, and zero the trailing console bytes. - Verifies console-only formats (`116..=120`) return the host driver's answers for their mapped PC formats (`10`, `45`, `46`, `47`) while restoring the caller's console format field. **Tested** - Adapter: AMD Radeon RX 7600 (8133 MiB VRAM, RDNA3, Adrenalin 26.11.2 / driver 32.0.32029.2010), Windows 11 x64. - `cargo test -p xcl --test d3d12_check_feature_support -- --nocapture`: 3 passed, 0 failed, 0 ignored (RX 7600). - `XCL_ADAPTER=warp cargo test -p xcl --test d3d12_check_feature_support -- --nocapture`: 3 passed, 0 failed, 0 ignored (WARP software renderer). - `cargo test --workspace -- --test-threads=4`: 680 passed, 0 failed, 41 ignored, 0 `SKIPPED`. **Not tested** - Retail Xbox games (`scripts/smoke.ps1` not run; test-only PR with no changes under `crates/xcl/src/`). - Non-AMD GPUs (NVIDIA / Intel hardware) and non-default `XCL_RAYTRACING` overrides. **AI use** Written and verified with Antigravity (Gemini 4 Carbon); all commands and tests were run locally on this machine's RX 7600 and WARP adapter.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:25:18 +00:00
github manually merged commit 0810130964 into gh-pr/547/base 2026-11-26 04:25:19 +00:00
Author
Owner

@⁠arcwiser on GitHub · 2026-11-24 01:39 UTC · original

Tested exact head 08101309649d1badb2281e541908f6627886c8c0 on the previously untested NVIDIA path, with XCL_ADAPTER=4070.

  • With XCL_REQUIRE_GPU=1, cargo test -p xcl --test d3d12_check_feature_support -- --nocapture: 3 passed, 0 failed, 0 ignored. The test identified NVIDIA GeForce RTX 4070 SUPER (11997 MiB VRAM) and passed the PC-sized query, oversized console-struct, and console-format mapping comparisons against the host driver.
  • With XCL_ADAPTER=4070, .\scripts\test.ps1: workspace build passed; 680 passed, 0 failed, 41 ignored.
  • GPU tests reported 2 skips (both no wave64): gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware. These skips are not counted as coverage.
  • XCL_SAMPLE_* variables were unset, so optional game-data tests did not run.

Machine: Windows 11 Home build 26200; AMD Ryzen 5 7500F; NVIDIA GeForce RTX 4070 SUPER 12 GB, driver 610.88; Rust 1.100.0 MSVC; DXC 1.9.2602.17 from Windows SDK 10.0.28000.0; debug profile.

AI use: OpenAI Codex with GPT-5 selected the verification scope, ran the commands, and drafted this report; I am posting only the measured results above.

**@⁠arcwiser** on GitHub · 2026-11-24 01:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/547#issuecomment-7119323771) Tested exact head `08101309649d1badb2281e541908f6627886c8c0` on the previously untested NVIDIA path, with `XCL_ADAPTER=4070`. - With `XCL_REQUIRE_GPU=1`, `cargo test -p xcl --test d3d12_check_feature_support -- --nocapture`: **3 passed, 0 failed, 0 ignored**. The test identified `NVIDIA GeForce RTX 4070 SUPER (11997 MiB VRAM)` and passed the PC-sized query, oversized console-struct, and console-format mapping comparisons against the host driver. - With `XCL_ADAPTER=4070`, `.\scripts\test.ps1`: workspace build passed; **680 passed, 0 failed, 41 ignored**. - GPU tests reported **2 skips** (both `no wave64`): `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`. These skips are not counted as coverage. - `XCL_SAMPLE_*` variables were unset, so optional game-data tests did not run. Machine: Windows 11 Home build 26200; AMD Ryzen 5 7500F; NVIDIA GeForce RTX 4070 SUPER 12 GB, driver 610.88; Rust 1.100.0 MSVC; DXC 1.9.2602.17 from Windows SDK 10.0.28000.0; debug profile. AI use: OpenAI Codex with GPT-5 selected the verification scope, ran the commands, and drafted this report; I am posting only the measured results above.
Author
Owner

@⁠caua-an on GitHub · 2026-11-24 02:12 UTC · original

Tested — Clean PR head 08101309649d1badb2281e541908f6627886c8c0, debug build. Windows 11 Home build 26200, Core Ultra 9 185H, 32 GiB RAM, RTX 4070 Laptop GPU (7948 MiB reported), NVIDIA driver 616.92, Rust 1.100.0 MSVC x64, DXC 1.9.2602.17. Both runs used XCL_ADAPTER=nvidia.

  • cargo test --locked -p xcl --test d3d12_check_feature_support -- --nocapture: 3 passed, 0 failed, 0 ignored. The test confirmed the RTX 4070 Laptop and passed all three comparisons: PC-sized queries, oversized console structures, and console-format mappings.
  • .\scripts\test.ps1 --show-output: build and suite exited 0; 680 passed, 0 failed, 41 ignored. The pass count includes four reported early returns: two tests requiring native Wave64 and two requiring the D3D12 debug layer.

Not tested: Release builds, other adapters, native Wave64, D3D12 debug-layer checks, retail titles, or game-data tests (XCL_SAMPLE_* unset).

AI use: OpenCode with GPT-6.2 Sol ran the local tests and drafted this report. No code changes.

**@⁠caua-an** on GitHub · 2026-11-24 02:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/547#issuecomment-7119868473) **Tested** — Clean PR head `08101309649d1badb2281e541908f6627886c8c0`, debug build. Windows 11 Home build 26200, Core Ultra 9 185H, 32 GiB RAM, RTX 4070 Laptop GPU (7948 MiB reported), NVIDIA driver 616.92, Rust 1.100.0 MSVC x64, DXC 1.9.2602.17. Both runs used `XCL_ADAPTER=nvidia`. - `cargo test --locked -p xcl --test d3d12_check_feature_support -- --nocapture`: **3 passed, 0 failed, 0 ignored**. The test confirmed the RTX 4070 Laptop and passed all three comparisons: PC-sized queries, oversized console structures, and console-format mappings. - `.\scripts\test.ps1 --show-output`: build and suite exited 0; **680 passed, 0 failed, 41 ignored**. The pass count includes four reported early returns: two tests requiring native Wave64 and two requiring the D3D12 debug layer. **Not tested:** Release builds, other adapters, native Wave64, D3D12 debug-layer checks, retail titles, or game-data tests (`XCL_SAMPLE_*` unset). **AI use:** OpenCode with GPT-6.2 Sol ran the local tests and drafted this report. No code changes.
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 03:04 UTC · original

Test run of 08101309649d1badb2281e541908f6627886c8c0 on AMD RDNA4. I merged it onto current main dd2ae9a locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 693 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 650 passed, 0 failed, 21 ignored
  • 0 SKIPPED; the three d3d12_check_feature_support tests pass.

Review: This adds the first AMD run (NVIDIA and Intel above). The fixture captures the unadopted CheckFeatureSupport and the adapter LUID before real::init(), so both sides answer from the same adapter, and it skips through skip_test when no device can be made. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

**@⁠MesshM** on GitHub · 2026-11-24 03:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/547#issuecomment-7120741014) Test run of `08101309649d1badb2281e541908f6627886c8c0` on AMD RDNA4. I merged it onto current `main` `dd2ae9a` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **693 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 650 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; the three `d3d12_check_feature_support` tests pass. **Review:** This adds the first AMD run (NVIDIA and Intel above). The fixture captures the unadopted `CheckFeatureSupport` and the adapter LUID before `real::init()`, so both sides answer from the same adapter, and it skips through `skip_test` when no device can be made. I found nothing to change. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-24 03:50 UTC · original

Test report: #547 under Wine with vkd3d-proton as the host driver (Linux, NVIDIA)

The other runs here are native Windows drivers. Under Wine, the host driver this test compares XCL with is vkd3d-proton (D3D12 on Vulkan), and the test passes there as well.

Setup

  • CachyOS, kernel 7.3.3-1-cachyos, Intel i5-10400F, 16 GB RAM, NVIDIA GeForce RTX 3060 12 GB, driver 620.70.06
  • Proton Experimental experimental-11.0-20261112 (wine-11.0), vkd3d-proton v3.1 (4522cc1a) + the patch from #257, DXVK from Proton, DXVK_CONFIG="dxgi.hideNvidiaGpu = False"
  • Rust 1.100.0, x86_64-pc-windows-gnu (mingw-w64-gcc 16.2.0), debug build of this PR's head 0810130

Result: d3d12_check_feature_support test binary under Wine, --test-threads=1: 3 passed, 0 failed, 0 ignored (one run).

  • console_only_formats_match_mapped_pc_formats_and_restore_format, oversized_console_structs_match_host_and_zero_tail, pc_sized_feature_queries_match_host_driver: ok
  • For the oversized structs vkd3d-proton logs d3d12_device_CheckFeatureSupport: Invalid size 68.; the test passes with it.

Not tested

  • Windows, AMD, other Wine / vkd3d-proton versions; the rest of the suite on this branch; a title run (test-only PR)

AI use: Claude Code (Claude Opus 5.5) built the test, ran it on the machine above and wrote this report. The results are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one.

**@⁠JoaoPauluu** on GitHub · 2026-11-24 03:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/547#issuecomment-7121472359) ### Test report: #547 under Wine with vkd3d-proton as the host driver (Linux, NVIDIA) The other runs here are native Windows drivers. Under Wine, the host driver this test compares XCL with is vkd3d-proton (D3D12 on Vulkan), and the test passes there as well. **Setup** - CachyOS, kernel 7.3.3-1-cachyos, Intel i5-10400F, 16 GB RAM, NVIDIA GeForce RTX 3060 12 GB, driver 620.70.06 - Proton Experimental `experimental-11.0-20261112` (wine-11.0), vkd3d-proton v3.1 (`4522cc1a`) + the patch from #257, DXVK from Proton, `DXVK_CONFIG="dxgi.hideNvidiaGpu = False"` - Rust 1.100.0, `x86_64-pc-windows-gnu` (mingw-w64-gcc 16.2.0), debug build of this PR's head `0810130` **Result:** `d3d12_check_feature_support` test binary under Wine, `--test-threads=1`: 3 passed, 0 failed, 0 ignored (one run). - `console_only_formats_match_mapped_pc_formats_and_restore_format`, `oversized_console_structs_match_host_and_zero_tail`, `pc_sized_feature_queries_match_host_driver`: ok - For the oversized structs vkd3d-proton logs `d3d12_device_CheckFeatureSupport: Invalid size 68.`; the test passes with it. **Not tested** - Windows, AMD, other Wine / vkd3d-proton versions; the rest of the suite on this branch; a title run (test-only PR) **AI use:** Claude Code (Claude Opus 5.5) built the test, ran it on the machine above and wrote this report. The results are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 06:53 UTC · original

Empirical test report (08101309)

Independent Intel Arc A770 D3D12 verification of PR #547 at detached head 08101309649d1badb2281e541908f6627886c8c0 (clean worktree).

Hardware / environment

  • Intel Arc A770 Graphics (16,258 MiB VRAM, driver 32.0.101.9175), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation x64 build 26200.9974.
  • rustc 1.100.0 (0ef1bc386 2026-11-09) (x86_64-pc-windows-msvc), DXC 1.9.2609.5 (01b62ad47), unoptimized Cargo test profile with debug info and incremental compilation disabled.

Commands and results

  • Located prebuilt integration test binary via cargo test -p xcl --tests --no-run --message-format=json outside the GPU lock.
  • Ran inside Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1:
    • check_feature_support_parity.exe --nocapture --test-threads=1 (exit 0, 0.35s).
  • 3 passed, 0 failed, 0 ignored, 0 skipped.

Observed behavior

  • pc_sized_feature_queries_match_host_driver, oversized_console_structs_match_host_and_zero_tail, and console format mapping checks all passed against the real Intel Arc A770 D3D12 driver (reporting RaytracingTier 11 and matching oversized console struct tail zeroing across feature IDs 3–42).

Not tested

  • Full GPU workspace suite and game smoke runs were omitted.

AI use

Verified and published with T3 Code / Antigravity (gemini-4-neon).

**@⁠JJAutoCompare** on GitHub · 2026-11-25 06:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/547#issuecomment-7155272055) ### Empirical test report (08101309) Independent Intel Arc A770 D3D12 verification of PR #547 at detached head `08101309649d1badb2281e541908f6627886c8c0` (clean worktree). **Hardware / environment** - Intel Arc A770 Graphics (16,258 MiB VRAM, driver `32.0.101.9175`), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation x64 build `26200.9974`. - `rustc 1.100.0 (0ef1bc386 2026-11-09)` (`x86_64-pc-windows-msvc`), DXC `1.9.2609.5 (01b62ad47)`, unoptimized Cargo test profile with debug info and incremental compilation disabled. **Commands and results** - Located prebuilt integration test binary via `cargo test -p xcl --tests --no-run --message-format=json` outside the GPU lock. - Ran inside `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`: - `check_feature_support_parity.exe --nocapture --test-threads=1` (exit 0, 0.35s). - **3 passed, 0 failed, 0 ignored, 0 skipped.** **Observed behavior** - `pc_sized_feature_queries_match_host_driver`, `oversized_console_structs_match_host_and_zero_tail`, and console format mapping checks all passed against the real Intel Arc A770 D3D12 driver (reporting `RaytracingTier 11` and matching oversized console struct tail zeroing across feature IDs 3–42). **Not tested** - Full GPU workspace suite and game smoke runs were omitted. **AI use** Verified and published with T3 Code / Antigravity (gemini-4-neon).
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 13:30 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 13:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/547#issuecomment-7163875896) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠ivall on GitHub · 2026-11-25 19:20 UTC · original

Merging: CheckFeatureSupport against the host driver.

Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug, main 2898511 with 27 test PRs merged locally, this one included: the whole suite 3 times, 1419 passed, 2 failed, 46 ignored each time (fuzz_validate_and_gpu_1 and _3, which fail the same way on main); hle::d3d12x on 16 threads 5 times, no failure. This file alone 8 times: no failure.

AI use: Claude Code (Claude Opus 5.5) reviewed and tested this and wrote the comment on the maintainer's behalf.

**@⁠ivall** on GitHub · 2026-11-25 19:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/547#issuecomment-7172150218) Merging: `CheckFeatureSupport` against the host driver. Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug, `main` `2898511` with 27 test PRs merged locally, this one included: the whole suite 3 times, 1419 passed, 2 failed, 46 ignored each time (`fuzz_validate_and_gpu_1` and `_3`, which fail the same way on `main`); `hle::d3d12x` on 16 threads 5 times, no failure. This file alone 8 times: no failure. AI use: Claude Code (Claude Opus 5.5) reviewed and tested this and wrote the comment on the maintainer's behalf.
This discussion has been locked. Commenting is limited to contributors.
No description provided.