Tests: verify D3D12.X CreateHeap, QueryInterface, and IDXGIDevice parity #1820

Open
github-bot wants to merge 1 commit from github-bot/gh-1820 into main AGit
Owner

@⁠Vadson159 on GitHub · 2026-11-24 21:18 UTC · original
Vadson159:tests/d3d12-heaps-and-qi → main · +402 −0 · 1 files · 1 commits · open

Part of #480. Adds standalone integration tests in crates/xcl/tests/d3d12_heaps_and_qi.rs verifying XCL's ID3D12Device::CreateHeap (#28), ID3D12Device4::CreateHeap1 (#54), QueryInterface (#0), and synthetic IDXGIDevice/1/2 hooks against the unhooked host D3D12 driver (real::orig_fn) and DXGI adapter without console game files; zero runtime files under crates/xcl/src/ are modified.

What is in it

  • crates/xcl/tests/d3d12_heaps_and_qi.rs:
    • create_heap_and_heap1_match_host_driver_and_console_fallbacks: compares CreateHeap (#28) and CreateHeap1 (#54) HRESULTs and GetDesc() against real::orig_fn across DEFAULT (ALLOW_ONLY_BUFFERS, ALLOW_ONLY_NON_RT_DS_TEXTURES, ALLOW_ONLY_RT_DS_TEXTURES, ALLOW_ALL_BUFFERS_AND_TEXTURES, 4 MiB MSAA), UPLOAD, READBACK, CUSTOM (WRITE_BACK / L0), zero-size failure, and null ppvHeap capability probes (S_FALSE when debug layer is inactive); verifies console fallbacks for unrecognized heap flags (0x2 / 0x10 outside PC_HEAP_FLAGS = 0x3FED), non-standard alignments (4096 -> 64 KiB, 0x2_0000 -> 4 MiB), unknown heap type (99 -> DEFAULT), unaligned size rounding (0x1_2340 -> 128 KiB), and unknown console IID fallback to ID3D12Heap.
    • query_interface_splits_dxgi_device_between_title_and_pc_callers: uses a synthetic MappedModule caller (title_qi) vs a host caller (pc_qi, kept distinct under /OPT:ICF) to verify standard D3D12 / unknown IID QueryInterface parity with real::orig_fn, confirm host callers get E_NOINTERFACE for DXGI device IIDs while title callers get XCL's dxgi_device, and validate IDXGIDevice2 (ID3D12Device COM identity, GetAdapter / GetParent LUID parity, SetPrivateData forwarding, GPU thread priority bounds [-7, 7], frame latency defaults/reset/clamp [1, 16], QueryResourceResidency, OfferResources/ReclaimResources, CreateSurface/EnqueueSetEvent, and E_POINTER checks).

Tested

  • Hardware & OS: AMD Ryzen 7 9800X3D 8-Core Processor, AMD Radeon RX 9070 XT (driver 32.0.32029.2010), AMD Radeon(TM) Graphics (driver 32.0.21045.29003), and WARP (XCL_ADAPTER=warp); Microsoft Windows 11 Pro build 26300 (x64); rustc 1.100.0 (0ef1bc386 2026-11-09).
  • .\scripts\test.ps1 (cargo build --workspace && cargo test --workspace -- --test-threads=4, debug, RX 9070 XT): 894 passed, 0 failed, 42 ignored (GPU tests skipped on this adapter: 1 (no heap windows); SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows; XCL_SAMPLE_* suites skipped as env vars are unset); includes tests\d3d12_heaps_and_qi.rs (2 passed, 0 failed, 0 ignored).
  • cargo test -p xcl --test d3d12_heaps_and_qi -- --test-threads=4 (debug, RX 9070 XT): 2 passed, 0 failed, 0 ignored.
  • XCL_ADAPTER=warp cargo test -p xcl --test d3d12_heaps_and_qi -- --test-threads=1 (debug, WARP): 2 passed, 0 failed, 0 ignored.
  • XCL_ADAPTER="Radeon(TM)" cargo test -p xcl --test d3d12_heaps_and_qi -- --test-threads=1 (debug, AMD Radeon(TM) Graphics): 2 passed, 0 failed, 0 ignored.
  • XCL_D3D12_DEBUG=1 cargo test -p xcl --test d3d12_heaps_and_qi -- --test-threads=1 (debug, RX 9070 XT): 2 passed, 0 failed, 0 ignored.
  • cargo test -p xcl --release --test d3d12_heaps_and_qi -- --test-threads=4 (release, RX 9070 XT): 2 passed, 0 failed, 0 ignored.
  • python -B -m unittest discover -s scripts -p "test_*.py" -v: Ran 16 tests, OK.

Regression run
main:

PR:

Not tested

  • Retail Xbox Series X|S titles and XCL_SAMPLE_* game-data suites (no game files on this machine; no runtime files under crates/xcl/src/ were modified).
  • NVIDIA and Intel GPUs, Linux/Wine, and non-Windows hosts (XCL builds and runs on Windows x64 only).

AI use

  • Antigravity (Gemini 4 Hydrogen): selected the uncovered #480 scope, wrote crates/xcl/tests/d3d12_heaps_and_qi.rs, ran the test commands above, and drafted this PR description.
**@⁠Vadson159** on GitHub · 2026-11-24 21:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/1820) `Vadson159:tests/d3d12-heaps-and-qi` → `main` · +402 −0 · 1 files · 1 commits · open Part of #480. Adds standalone integration tests in `crates/xcl/tests/d3d12_heaps_and_qi.rs` verifying XCL's `ID3D12Device::CreateHeap` (#28), `ID3D12Device4::CreateHeap1` (#54), `QueryInterface` (#0), and synthetic `IDXGIDevice`/`1`/`2` hooks against the unhooked host D3D12 driver (`real::orig_fn`) and DXGI adapter without console game files; zero runtime files under `crates/xcl/src/` are modified. **What is in it** - `crates/xcl/tests/d3d12_heaps_and_qi.rs`: - `create_heap_and_heap1_match_host_driver_and_console_fallbacks`: compares `CreateHeap` (#28) and `CreateHeap1` (#54) HRESULTs and `GetDesc()` against `real::orig_fn` across `DEFAULT` (`ALLOW_ONLY_BUFFERS`, `ALLOW_ONLY_NON_RT_DS_TEXTURES`, `ALLOW_ONLY_RT_DS_TEXTURES`, `ALLOW_ALL_BUFFERS_AND_TEXTURES`, 4 MiB MSAA), `UPLOAD`, `READBACK`, `CUSTOM` (`WRITE_BACK` / `L0`), zero-size failure, and null `ppvHeap` capability probes (`S_FALSE` when debug layer is inactive); verifies console fallbacks for unrecognized heap flags (`0x2` / `0x10` outside `PC_HEAP_FLAGS = 0x3FED`), non-standard alignments (`4096` -> 64 KiB, `0x2_0000` -> 4 MiB), unknown heap type (`99` -> `DEFAULT`), unaligned size rounding (`0x1_2340` -> 128 KiB), and unknown console IID fallback to `ID3D12Heap`. - `query_interface_splits_dxgi_device_between_title_and_pc_callers`: uses a synthetic `MappedModule` caller (`title_qi`) vs a host caller (`pc_qi`, kept distinct under `/OPT:ICF`) to verify standard D3D12 / unknown IID `QueryInterface` parity with `real::orig_fn`, confirm host callers get `E_NOINTERFACE` for DXGI device IIDs while title callers get XCL's `dxgi_device`, and validate `IDXGIDevice2` (`ID3D12Device` COM identity, `GetAdapter` / `GetParent` LUID parity, `SetPrivateData` forwarding, GPU thread priority bounds `[-7, 7]`, frame latency defaults/reset/clamp `[1, 16]`, `QueryResourceResidency`, `OfferResources`/`ReclaimResources`, `CreateSurface`/`EnqueueSetEvent`, and `E_POINTER` checks). **Tested** - Hardware & OS: `AMD Ryzen 7 9800X3D 8-Core Processor`, `AMD Radeon RX 9070 XT` (driver `32.0.32029.2010`), `AMD Radeon(TM) Graphics` (driver `32.0.21045.29003`), and `WARP` (`XCL_ADAPTER=warp`); `Microsoft Windows 11 Pro` build `26300` (x64); `rustc 1.100.0 (0ef1bc386 2026-11-09)`. - `.\scripts\test.ps1` (`cargo build --workspace && cargo test --workspace -- --test-threads=4`, debug, RX 9070 XT): 894 passed, 0 failed, 42 ignored (`GPU tests skipped on this adapter: 1 (no heap windows)`; `SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows`; `XCL_SAMPLE_*` suites skipped as env vars are unset); includes `tests\d3d12_heaps_and_qi.rs` (2 passed, 0 failed, 0 ignored). - `cargo test -p xcl --test d3d12_heaps_and_qi -- --test-threads=4` (debug, RX 9070 XT): 2 passed, 0 failed, 0 ignored. - `XCL_ADAPTER=warp cargo test -p xcl --test d3d12_heaps_and_qi -- --test-threads=1` (debug, WARP): 2 passed, 0 failed, 0 ignored. - `XCL_ADAPTER="Radeon(TM)" cargo test -p xcl --test d3d12_heaps_and_qi -- --test-threads=1` (debug, AMD Radeon(TM) Graphics): 2 passed, 0 failed, 0 ignored. - `XCL_D3D12_DEBUG=1 cargo test -p xcl --test d3d12_heaps_and_qi -- --test-threads=1` (debug, RX 9070 XT): 2 passed, 0 failed, 0 ignored. - `cargo test -p xcl --release --test d3d12_heaps_and_qi -- --test-threads=4` (release, RX 9070 XT): 2 passed, 0 failed, 0 ignored. - `python -B -m unittest discover -s scripts -p "test_*.py" -v`: Ran 16 tests, OK. **Regression run** main: PR: **Not tested** - Retail Xbox Series X|S titles and `XCL_SAMPLE_*` game-data suites (no game files on this machine; no runtime files under `crates/xcl/src/` were modified). - NVIDIA and Intel GPUs, Linux/Wine, and non-Windows hosts (XCL builds and runs on Windows x64 only). **AI use** - Antigravity (Gemini 4 Hydrogen): selected the uncovered #480 scope, wrote `crates/xcl/tests/d3d12_heaps_and_qi.rs`, ran the test commands above, and drafted this PR description.
Add standalone integration tests (Part of #480) comparing XCL's CreateHeap (#28), CreateHeap1 (#54), and QueryInterface (#0) hooks against the unhooked host D3D12 driver (real::orig_fn) and verifying XCL's console heap fallbacks and synthetic IDXGIDevice2 adapter surface without console game files.

Assisted-by: Antigravity (Gemini 4 Hydrogen)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:06:20 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 22:38 UTC · original · edited 2026-11-24 22:46 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 8d84ee2 (on its base e9e94ce).

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, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: 893 passed, 0 failed, 42 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: create_heap_and_heap1_match_host_driver_and_console_fallbacks, query_interface_splits_dxgi_device_between_title_and_pc_callers.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 894 passed, 0 failed, 42 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • On NVIDIA, --skip leaves out five tests where this PR's base has them. They fail on main 689f2db too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns their skips into failures. These are heap_window_out_of_memory_falls_back_to_the_switch_form (#1651) and the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests (follow-up on #1651). The AMD run does not set XCL_REQUIRE_GPU.

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.
**@⁠futurepro62** on GitHub · 2026-11-24 22:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/1820#issuecomment-7146471213) · edited 2026-11-24 22:46 UTC Full-suite run, since this PR has no test report yet. Tested exact head `8d84ee2` (on its base `e9e94ce`). **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, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu`: **893 passed, 0 failed, 42 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `create_heap_and_heap1_match_host_driver_and_console_fallbacks`, `query_interface_splits_dxgi_device_between_title_and_pc_callers`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **894 passed, 0 failed, 42 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - On NVIDIA, `--skip` leaves out five tests where this PR's base has them. They fail on main `689f2db` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns their skips into failures. These are `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651) and the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests ([follow-up on #1651](https://git.gtahub.st/github/xcl-dev--xcl/issues/1651)). The AMD run does not set `XCL_REQUIRE_GPU`. **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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 00:39 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 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 00:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/1820#issuecomment-7148741980) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 03:09 UTC · original

PR #1820 compatibility verification

Commit 8d84ee26477573f62a8cce2e220a0b83f7b0d698

Environment. STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X. Intel Arc A770 16 GiB, driver 32.0.101.9175, wave range 8–32, DoublePrecisionFloatShaderOps=0. DXC/DXIL 1.9.2609.5, Rust 1.100.0 (0ef1bc386 2026-11-09), unoptimized dev and test profiles with debug info disabled. d3d12SDKLayers.dll was absent.

Tested. cargo build --workspace and cargo test --workspace --no-run both succeeded. GPU runs used the shared Arc lock with XCL_ADAPTER=A770.

cargo test -p xcl --test d3d12_heaps_and_qi -- --nocapture reported 2 passed, 0 failed, 0 ignored, and 0 skips. The log identified the real D3D12.X backend on the Arc A770. Both tests passed again in the workspace run.

  • CreateHeap and CreateHeap1 passed host-driver parity checks and XCL fallback checks. The log confirmed the unknown-IID fallback ran on both methods.
  • QueryInterface passed the PC versus synthetic title caller checks. The returned IDXGIDevice2 passed checks for COM identity, adapter LUID, private data, GPU priority, frame latency, residency, and method return codes.

cargo test --workspace --no-fail-fast -- --test-threads=4 exited 101. Across 21 harness summaries in pr1820-suite.log, Cargo reported 876 passed, 18 failed, 42 ignored. The pass total includes 4 explicit skips, which provide no coverage.

  • 17 GPU unit failures. Thirteen hit CreateComputePipelineState with 0x80070057. Four had result mismatches in FMA overflow, mip sampling, FP16 lane preservation, and pixel-wave reduction.
  • One test-title failure. The dynamic depth bias check for RSSetDepthBiasX (#94) read blue where it expected green.
  • Skips. Two lacked wave64, one lacked heap windows, and one could not disable the driver cache (Windows Developer Mode required, 0x887A002D).

Not tested. Baseline on main, AMD or NVIDIA GPUs, D3D12 debug-layer behavior, retail-title smoke, and optional sample-backed checks (XCL_SAMPLE_* unset).

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1820-suite.log and published this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 03:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/1820#issuecomment-7151647476) # PR #1820 compatibility verification Commit `8d84ee26477573f62a8cce2e220a0b83f7b0d698` **Environment.** STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X. Intel Arc A770 16 GiB, driver 32.0.101.9175, wave range 8–32, `DoublePrecisionFloatShaderOps=0`. DXC/DXIL 1.9.2609.5, Rust 1.100.0 (0ef1bc386 2026-11-09), unoptimized dev and test profiles with debug info disabled. `d3d12SDKLayers.dll` was absent. **Tested.** `cargo build --workspace` and `cargo test --workspace --no-run` both succeeded. GPU runs used the shared Arc lock with `XCL_ADAPTER=A770`. `cargo test -p xcl --test d3d12_heaps_and_qi -- --nocapture` reported 2 passed, 0 failed, 0 ignored, and 0 skips. The log identified the real D3D12.X backend on the Arc A770. Both tests passed again in the workspace run. - `CreateHeap` and `CreateHeap1` passed host-driver parity checks and XCL fallback checks. The log confirmed the unknown-IID fallback ran on both methods. - `QueryInterface` passed the PC versus synthetic title caller checks. The returned `IDXGIDevice2` passed checks for COM identity, adapter LUID, private data, GPU priority, frame latency, residency, and method return codes. `cargo test --workspace --no-fail-fast -- --test-threads=4` exited 101. Across 21 harness summaries in `pr1820-suite.log`, Cargo reported **876 passed, 18 failed, 42 ignored**. The pass total includes **4 explicit skips**, which provide no coverage. - 17 GPU unit failures. Thirteen hit `CreateComputePipelineState` with `0x80070057`. Four had result mismatches in FMA overflow, mip sampling, FP16 lane preservation, and pixel-wave reduction. - One test-title failure. The dynamic depth bias check for `RSSetDepthBiasX` (#94) read blue where it expected green. - Skips. Two lacked wave64, one lacked heap windows, and one could not disable the driver cache (Windows Developer Mode required, `0x887A002D`). **Not tested.** Baseline on `main`, AMD or NVIDIA GPUs, D3D12 debug-layer behavior, retail-title smoke, and optional sample-backed checks (`XCL_SAMPLE_*` unset). T3 Code / Codex (`gpt-6.2-sol`, `reasoningEffort: high`) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, `gemini-4-neon`) verified counts against `pr1820-suite.log` and published this report.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1820/head:github-bot/gh-1820'
git switch 'github-bot/gh-1820'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1820'
git switch 'github-bot/gh-1820'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1820'
git switch 'github-bot/gh-1820'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1820'
git switch 'main'
git merge --squash 'github-bot/gh-1820'
git switch 'main'
git merge --ff-only 'github-bot/gh-1820'
git switch 'main'
git merge 'github-bot/gh-1820'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.