Skip to content

Tests: compare CheckFeatureSupport hook against host D3D12 driver - #547

Merged
ivall merged 1 commit into
xcl-dev:mainfrom
GustavoEllwanger:test/d3d12-check-feature-support-host
Nov 25, 2026
Merged

ivall merged 1 commit into
xcl-dev:mainfrom
GustavoEllwanger:test/d3d12-check-feature-support-host

Conversation

@GustavoEllwanger

Copy link
Copy Markdown
Contributor

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.

@arcwiser

Copy link
Copy Markdown

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.

@towiice towiice left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested PR head 0810130 on NVIDIA GeForce GTX 1650 SUPER (Turing / TU116, driver 610.88), Windows 11 build 10.0.26300 (26H2), Rust 1.100.0 (stable-x86_64-pc-windows-gnullvm), DXC v1.9.2609:

  • cargo test -p xcl --test d3d12_check_feature_support -- --test-threads=4: 3 passed, 0 failed (1.47 s):
    • console_only_formats_match_mapped_pc_formats_and_restore_format
    • pc_sized_feature_queries_match_host_driver
    • oversized_console_structs_match_host_and_zero_tail

All CheckFeatureSupport host-driver comparison tests pass on NVIDIA Turing.

@caua-an

caua-an commented Nov 24, 2026

Copy link
Copy Markdown

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.

@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

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.

@JoaoPauluu

Copy link
Copy Markdown

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

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.

@JJAutoCompare

Copy link
Copy Markdown

Empirical test report (0810130)

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).

@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

@ivall
ivall merged commit 661373a into xcl-dev:main Nov 25, 2026
3 checks passed
@ivall

ivall commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants