Tests: verify CreateHeap console fallback and IID retry against host driver #564

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

@⁠GustavoEllwanger on GitHub · 2026-11-24 01:51 UTC · original
GustavoEllwanger:test/d3d12-create-heap-fallback → main · +281 −0 · 1 files · 1 commits · merged 2026-11-25 19:20 UTC

What is in it
Adds a standalone integration test (crates/xcl/tests/d3d12_create_heap.rs) that verifies XCL's CreateHeap vtable hook (d3d12x::real::dev_create_heap) and creator! E_NOINTERFACE fallback directly against the host PC D3D12 driver on the same adapter, with no console files or game data required:

  • Captures the unadopted ID3D12Device::CreateHeap entry point and adapter LUID before d3d12x::real::init() adopts the device vtable, then verifies both target the same adapter and that the CreateHeap vtable slot is intercepted by XCL.
  • Verifies standard PC heap descriptions (DEFAULT, UPLOAD, READBACK) succeed through both the host driver and XCL with matching ID3D12Heap::GetDesc() values.
  • Verifies console-only heap descriptions refused by the raw host driver (console flag bits such as 0x2 / 0x10 / high bits, unknown heap types outside 1..=5, unaligned sizes, non-64 KiB alignments, and a combined console heap) succeed through XCL with normalized PC heap descriptors (known flags only, DEFAULT type, 64 KiB rounded size, and 64 KiB / 4 MiB alignment).
  • Verifies an unknown console IID fails on the raw host driver with E_NOINTERFACE and succeeds through XCL's creator! fallback returning a usable ID3D12Heap.

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_create_heap -- --nocapture: 3 passed, 0 failed, 0 ignored (RX 7600).
  • XCL_ADAPTER=warp cargo test -p xcl --test d3d12_create_heap -- --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).

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:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/564) `GustavoEllwanger:test/d3d12-create-heap-fallback` → `main` · +281 −0 · 1 files · 1 commits · merged 2026-11-25 19:20 UTC **What is in it** Adds a standalone integration test (`crates/xcl/tests/d3d12_create_heap.rs`) that verifies XCL's `CreateHeap` vtable hook (`d3d12x::real::dev_create_heap`) and `creator!` `E_NOINTERFACE` fallback directly against the host PC D3D12 driver on the same adapter, with no console files or game data required: - Captures the unadopted `ID3D12Device::CreateHeap` entry point and adapter LUID before `d3d12x::real::init()` adopts the device vtable, then verifies both target the same adapter and that the `CreateHeap` vtable slot is intercepted by XCL. - Verifies standard PC heap descriptions (`DEFAULT`, `UPLOAD`, `READBACK`) succeed through both the host driver and XCL with matching `ID3D12Heap::GetDesc()` values. - Verifies console-only heap descriptions refused by the raw host driver (console flag bits such as `0x2` / `0x10` / high bits, unknown heap types outside `1..=5`, unaligned sizes, non-64 KiB alignments, and a combined console heap) succeed through XCL with normalized PC heap descriptors (known flags only, `DEFAULT` type, 64 KiB rounded size, and 64 KiB / 4 MiB alignment). - Verifies an unknown console `IID` fails on the raw host driver with `E_NOINTERFACE` and succeeds through XCL's `creator!` fallback returning a usable `ID3D12Heap`. **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_create_heap -- --nocapture`: 3 passed, 0 failed, 0 ignored (RX 7600). - `XCL_ADAPTER=warp cargo test -p xcl --test d3d12_create_heap -- --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). **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:50 +00:00
github manually merged commit c7b7ebe0c1 into gh-pr/564/base 2026-11-26 04:25:51 +00:00
Author
Owner

@⁠CryingLaughing on GitHub · 2026-11-24 01:56 UTC · original

The exact head 73cf88915070b7b7c239459068fcca91a9aae889 passed the three CreateHeap driver comparisons on an RTX 4080. This adds native NVIDIA coverage to the RX 7600 and WARP runs.

Tested

  • RTX 4080, NVIDIA driver 621.01, Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC x64, debug. XCL_ADAPTER=4080, XCL_REQUIRE_GPU=1, and all XCL_SAMPLE_* variables unset. The fixture identified the RTX 4080 and checked the matching adapter LUIDs.
  • cargo test -p xcl --test d3d12_create_heap --locked -j 4 -- --show-output --test-threads=1: 3 passed, 0 failed, 0 ignored, 0 capability skips.
  • The default, upload, and readback descriptors matched the host. All five console descriptor cases were rejected by the raw driver and accepted with the expected normalization by XCL. The unknown-IID test passed its native rejection and XCL fallback checks.

Not tested

  • The full workspace for this head, other adapters on this machine, release builds, or retail titles.

AI use

  • OpenAI Codex (GPT-6 family, exact variant unavailable) ran the tests and drafted this report.
**@⁠CryingLaughing** on GitHub · 2026-11-24 01:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/564#issuecomment-7119600203) The exact head `73cf88915070b7b7c239459068fcca91a9aae889` passed the three CreateHeap driver comparisons on an RTX 4080. This adds native NVIDIA coverage to the RX 7600 and WARP runs. **Tested** - RTX 4080, NVIDIA driver 621.01, Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC x64, debug. `XCL_ADAPTER=4080`, `XCL_REQUIRE_GPU=1`, and all `XCL_SAMPLE_*` variables unset. The fixture identified the RTX 4080 and checked the matching adapter LUIDs. - `cargo test -p xcl --test d3d12_create_heap --locked -j 4 -- --show-output --test-threads=1`: **3 passed, 0 failed, 0 ignored, 0 capability skips**. - The default, upload, and readback descriptors matched the host. All five console descriptor cases were rejected by the raw driver and accepted with the expected normalization by XCL. The unknown-IID test passed its native rejection and XCL fallback checks. **Not tested** - The full workspace for this head, other adapters on this machine, release builds, or retail titles. **AI use** - OpenAI Codex (GPT-6 family, exact variant unavailable) ran the tests and drafted this report.
Author
Owner

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

Tested: Clean head 73cf88915070b7b7c239459068fcca91a9aae889; Windows 11 Home build 26200, Core Ultra 9 185H, Rust 1.100.0 MSVC x64, debug build, XCL_REQUIRE_GPU=1. Intel Arc integrated graphics driver 32.0.101.8860.

With XCL_ADAPTER=intel, cargo test --offline --locked -p xcl --test d3d12_create_heap -- --test-threads=1 --nocapture: 3 passed, 0 failed, 0 ignored, no skips. The fixture identified Intel Arc and verified matching adapter LUIDs for the host and XCL devices. PC heap parity, console descriptor normalization, and the unknown-IID fallback all passed.

Not tested: Full workspace suite, release builds, retail titles, or game-data samples (XCL_SAMPLE_* unset).

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

**@⁠caua-an** on GitHub · 2026-11-24 02:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/564#issuecomment-7120481090) **Tested:** Clean head `73cf88915070b7b7c239459068fcca91a9aae889`; Windows 11 Home build 26200, Core Ultra 9 185H, Rust 1.100.0 MSVC x64, debug build, `XCL_REQUIRE_GPU=1`. Intel Arc integrated graphics driver 32.0.101.8860. With `XCL_ADAPTER=intel`, `cargo test --offline --locked -p xcl --test d3d12_create_heap -- --test-threads=1 --nocapture`: **3 passed, 0 failed, 0 ignored, no skips**. The fixture identified Intel Arc and verified matching adapter LUIDs for the host and XCL devices. PC heap parity, console descriptor normalization, and the unknown-IID fallback all passed. **Not tested:** Full workspace suite, release builds, retail titles, or game-data samples (`XCL_SAMPLE_*` unset). **AI use:** OpenCode with GPT-6.2 Sol ran the tests and drafted this report.
Author
Owner

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

Test run of 73cf88915070b7b7c239459068fcca91a9aae889 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_create_heap tests pass.

Review: AMD RDNA4 next to the RX 7600, WARP, RTX 4080 and Intel runs above. The test captures the driver's own CreateHeap before real::init() adopts the vtable and compares both on one adapter; when there is no device it calls skip_test. 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/564#issuecomment-7120740350) Test run of `73cf88915070b7b7c239459068fcca91a9aae889` 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_create_heap` tests pass. **Review:** AMD RDNA4 next to the RX 7600, WARP, RTX 4080 and Intel runs above. The test captures the driver's own `CreateHeap` before `real::init()` adopts the vtable and compares both on one adapter; when there is no device it calls `skip_test`. 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

@⁠GustavoEllwanger on GitHub · 2026-11-25 12:08 UTC · original

Thanks @⁠JoaoPauluu for the Wine/vkd3d-proton report! Updated head \c7b7ebe\ (rebased on \main\ \1a0bbe3): when a permissive host driver accepts a console heap desc directly, the test verifies XCL matches the host instead of requiring a host refusal, while still asserting that at least 4 of the 5 console cases (including \combined_console_heap) are refused by the host and normalized by XCL. Re-verified 3/3 passing on both NVIDIA RTX 5060 and AMD Radeon RDNA2.

**@⁠GustavoEllwanger** on GitHub · 2026-11-25 12:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/564#issuecomment-7161962471) Thanks @⁠JoaoPauluu for the Wine/vkd3d-proton report! Updated head \c7b7ebe\ (rebased on \main\ \1a0bbe3\): when a permissive host driver accepts a console heap desc directly, the test verifies XCL matches the host instead of requiring a host refusal, while still asserting that at least 4 of the 5 console cases (including \combined_console_heap\) are refused by the host and normalized by XCL. Re-verified 3/3 passing on both NVIDIA RTX 5060 and AMD Radeon RDNA2.
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-24 03:49 UTC · original · edited 2026-11-25 12:51 UTC

Update, c7b7ebe: all 3 tests pass under Wine with vkd3d-proton now, in 3 runs of the whole binary plus one run of each test on its own process, none skipped. Same setup as below, except a release build of c7b7ebe (based on 1a0bbe3, no uncommitted changes).

  • console_heap_descs_refused_by_host_are_normalized_by_xcl: vkd3d-proton still accepts console_flags_0xC2_and_high_bits (no refusal in the log). The other four cases are refused (0x80070057) and come back normalized, for example CreateHeap(0x10001 bytes, type 9, alignment 0x4000, flags 0x200000d2) refused (0x80070057); as type 1, alignment 0x0, flags 0xc0: 0x0. That matches the new "at least 4 of 5 refused, combined_console_heap included" check.
  • pc_heap_descs_match_host_driver and unknown_console_iid_falls_back_to_pc_heap_interface: ok.

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

The other runs are native Windows drivers (RX 7600, WARP, RTX 4080, Intel Arc, RX 9060 XT). Under Wine the "host driver" is vkd3d-proton, and there one case of console_heap_descs_refused_by_host_are_normalized_by_xcl fails: vkd3d-proton accepts the console flags 0x100000C2, so the test's hr_host < 0 precondition doesn't hold. The other two tests pass.

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 73cf889

Result (d3d12_create_heap test binary under Wine, --test-threads=1, three runs): 2 passed, 1 failed, every time.

  • pc_heap_descs_match_host_driver: ok
  • unknown_console_iid_falls_back_to_pc_heap_interface: ok
  • console_heap_descs_refused_by_host_are_normalized_by_xcl: console_flags_0xC2_and_high_bits: host driver unexpectedly accepted console heap desc (line 232)

To see the other cases, I changed the hr_host < 0 assert locally into a print plus continue (not kept, file restored):

case vkd3d-proton CreateHeap
console_flags_0xC2_and_high_bits 0x0 (accepted)
unknown_console_heap_type 0x80070057
unaligned_size_and_small_non_pc_alignment 0x80070057
alignment_above_64k_promoted_to_4m 0x80070057
combined_console_heap 0x80070057

With that change the test passes: the four refused cases go through XCL's retry and come back normalized.

When the assert is only turned into a print (no continue), the next assert fails: console-only heap flag bits remained: 0x100000c2. dev_create_heap only normalizes after the host refuses, so on vkd3d-proton the title's heap keeps the console bits in its GetDesc(). I don't know whether anything reads them back; GTA VI ran without device removals on this setup (see my reports on #257 / #632).

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 everything above 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 and has not reviewed this one.

**@⁠JoaoPauluu** on GitHub · 2026-11-24 03:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/564#issuecomment-7121455846) · edited 2026-11-25 12:51 UTC **Update, `c7b7ebe`:** all 3 tests pass under Wine with vkd3d-proton now, in 3 runs of the whole binary plus one run of each test on its own process, none skipped. Same setup as below, except a release build of `c7b7ebe` (based on `1a0bbe3`, no uncommitted changes). - `console_heap_descs_refused_by_host_are_normalized_by_xcl`: vkd3d-proton still accepts `console_flags_0xC2_and_high_bits` (no refusal in the log). The other four cases are refused (`0x80070057`) and come back normalized, for example `CreateHeap(0x10001 bytes, type 9, alignment 0x4000, flags 0x200000d2) refused (0x80070057); as type 1, alignment 0x0, flags 0xc0: 0x0`. That matches the new "at least 4 of 5 refused, `combined_console_heap` included" check. - `pc_heap_descs_match_host_driver` and `unknown_console_iid_falls_back_to_pc_heap_interface`: ok. --- ### Test report: #564 under Wine with vkd3d-proton as the host driver (Linux, NVIDIA) The other runs are native Windows drivers (RX 7600, WARP, RTX 4080, Intel Arc, RX 9060 XT). Under Wine the "host driver" is vkd3d-proton, and there one case of `console_heap_descs_refused_by_host_are_normalized_by_xcl` fails: vkd3d-proton **accepts** the console flags `0x100000C2`, so the test's `hr_host < 0` precondition doesn't hold. The other two tests pass. **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 `73cf889` **Result** (`d3d12_create_heap` test binary under Wine, `--test-threads=1`, three runs): 2 passed, 1 failed, every time. - `pc_heap_descs_match_host_driver`: ok - `unknown_console_iid_falls_back_to_pc_heap_interface`: ok - `console_heap_descs_refused_by_host_are_normalized_by_xcl`: `console_flags_0xC2_and_high_bits: host driver unexpectedly accepted console heap desc` (line 232) To see the other cases, I changed the `hr_host < 0` assert locally into a print plus `continue` (not kept, file restored): | case | vkd3d-proton `CreateHeap` | |---|---| | `console_flags_0xC2_and_high_bits` | `0x0` (accepted) | | `unknown_console_heap_type` | `0x80070057` | | `unaligned_size_and_small_non_pc_alignment` | `0x80070057` | | `alignment_above_64k_promoted_to_4m` | `0x80070057` | | `combined_console_heap` | `0x80070057` | With that change the test passes: the four refused cases go through XCL's retry and come back normalized. When the assert is only turned into a print (no `continue`), the next assert fails: `console-only heap flag bits remained: 0x100000c2`. `dev_create_heap` only normalizes after the host refuses, so on vkd3d-proton the title's heap keeps the console bits in its `GetDesc()`. I don't know whether anything reads them back; GTA VI ran without device removals on this setup (see my reports on #257 / #632). **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 everything above 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 and has not reviewed this one.
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/564#issuecomment-7163873073) 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: CreateHeap, its console fallback and the IID retry 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/564#issuecomment-7172156167) Merging: `CreateHeap`, its console fallback and the IID retry 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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 03:00 UTC · original

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

**@⁠DavidM1911** on GitHub · 2026-11-26 03:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/564#issuecomment-7181306699) 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
This discussion has been locked. Commenting is limited to contributors.
No description provided.