Tests: compare GetResourceAllocationInfo and GetCustomHeapProperties against host D3D12 driver #1132

Manually merged
github merged 1 commit from gh-pr/1132/head into gh-pr/1132/base 2026-11-26 04:44:28 +00:00
Owner

@⁠towiice on GitHub · 2026-11-24 12:15 UTC · original
towiice:tests/d3d12-allocation-and-heap-info → main · +403 −0 · 1 files · 1 commits · merged 2026-11-25 19:20 UTC

Part of #480. Adds host-driver parity integration tests for ID3D12Device::GetResourceAllocationInfo (slot 25) and ID3D12Device::GetCustomHeapProperties (slot 26) without requiring console files or game data.

What is in it

  • crates/xcl/tests/d3d12_allocation_and_heap_info.rs (+403 lines, test-only):
    • Registers a small synthetic title-image trampoline (modules::register_mapped) so guard::make_split dispatches to XCL's real console hooks (get_resource_allocation_info_x and get_custom_heap_properties_x), while comparing directly against real::orig_fn() on the same adopted backend device (real::device_raw()).
    • buffer_allocation_info_matches_host_in_cpp_and_c_abi: compares single buffers (256 B to 1 MiB), multi-buffer arrays, and zero-width invalid buffers across host D3D12, XCL C++ ABI (this, ret, ...), and XCL C ABI (ret, this, ...).
    • custom_heap_properties_match_host_in_cpp_and_c_abi: compares DEFAULT, UPLOAD, and READBACK heap properties across host D3D12, XCL C++ ABI, and XCL C ABI (using 8-byte aligned return buffers to avoid #1130).
    • texture_allocation_info_agrees_across_cpp_and_c_abi: checks that standard 2D textures (RGBA8, RGBA8 with mips, BC7) agree bit-for-bit across C++ and C ABIs with valid non-zero sizes and power-of-two alignments.
    • Routes skips through xcl::gpu::recomp::runner::skip_test("no GPU").

Tested

  • Hardware: NVIDIA GeForce GTX 1650 SUPER (Turing TU116, 4 GB VRAM, wave32, driver 610.88), Windows 11 x64 (26H2 / build 26300), DXC v1.9.2609 (01b62ad4), rustc 1.100.0 (stable-x86_64-pc-windows-gnullvm, llvm-mingw 23.1.6), debug build.
  • cargo test -p xcl --test d3d12_allocation_and_heap_info -- --test-threads=1: 3 passed, 0 failed, 0 ignored (no skips).
  • Full suite on commit bf84c59 (same tree as 0dc18fe, base cb868b2), same GPU (driver 32.0.16.1088), Rust 1.100.0 x86_64-pc-windows-gnullvm, debug, run with Claude Code: cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4: 685 passed, 3 failed, 41 ignored. Failed: placed_title_textures_share_vram_and_preserve_pixels, transitions_apply_when_their_list_is_submitted, d32s8_targets_take_their_own_size_of_video_memory (xcl lib, which this PR does not touch; main was not rerun this time). SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware. The 3 new tests passed.

Regression run

  • Test-only change (crates/xcl/tests/d3d12_allocation_and_heap_info.rs). No runtime code touched; no retail game files used.

Not tested

  • AMD, Intel, WARP, release builds, and retail titles.

AI use

  • Antigravity (Gemini 4 Neon) wrote the integration tests, ran the focused tests on the local GTX 1650 SUPER, and drafted the original description. Claude Code (Claude Sonnet 5.5) later squashed the commits, ran the full suite and updated this description.
**@⁠towiice** on GitHub · 2026-11-24 12:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1132) `towiice:tests/d3d12-allocation-and-heap-info` → `main` · +403 −0 · 1 files · 1 commits · merged 2026-11-25 19:20 UTC Part of #480. Adds host-driver parity integration tests for `ID3D12Device::GetResourceAllocationInfo` (slot 25) and `ID3D12Device::GetCustomHeapProperties` (slot 26) without requiring console files or game data. **What is in it** - `crates/xcl/tests/d3d12_allocation_and_heap_info.rs` (+403 lines, test-only): - Registers a small synthetic title-image trampoline (`modules::register_mapped`) so `guard::make_split` dispatches to XCL's real console hooks (`get_resource_allocation_info_x` and `get_custom_heap_properties_x`), while comparing directly against `real::orig_fn()` on the same adopted backend device (`real::device_raw()`). - `buffer_allocation_info_matches_host_in_cpp_and_c_abi`: compares single buffers (256 B to 1 MiB), multi-buffer arrays, and zero-width invalid buffers across host D3D12, XCL C++ ABI `(this, ret, ...)`, and XCL C ABI `(ret, this, ...)`. - `custom_heap_properties_match_host_in_cpp_and_c_abi`: compares `DEFAULT`, `UPLOAD`, and `READBACK` heap properties across host D3D12, XCL C++ ABI, and XCL C ABI (using 8-byte aligned return buffers to avoid #1130). - `texture_allocation_info_agrees_across_cpp_and_c_abi`: checks that standard 2D textures (`RGBA8`, `RGBA8` with mips, `BC7`) agree bit-for-bit across C++ and C ABIs with valid non-zero sizes and power-of-two alignments. - Routes skips through `xcl::gpu::recomp::runner::skip_test("no GPU")`. **Tested** - Hardware: NVIDIA GeForce GTX 1650 SUPER (Turing TU116, 4 GB VRAM, wave32, driver 610.88), Windows 11 x64 (26H2 / build 26300), DXC v1.9.2609 (`01b62ad4`), `rustc 1.100.0` (`stable-x86_64-pc-windows-gnullvm`, llvm-mingw 23.1.6), debug build. - `cargo test -p xcl --test d3d12_allocation_and_heap_info -- --test-threads=1`: **3 passed, 0 failed, 0 ignored** (no skips). - Full suite on commit `bf84c59` (same tree as `0dc18fe`, base `cb868b2`), same GPU (driver 32.0.16.1088), Rust 1.100.0 `x86_64-pc-windows-gnullvm`, debug, run with Claude Code: `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4`: **685 passed, 3 failed, 41 ignored**. Failed: `placed_title_textures_share_vram_and_preserve_pixels`, `transitions_apply_when_their_list_is_submitted`, `d32s8_targets_take_their_own_size_of_video_memory` (`xcl` lib, which this PR does not touch; `main` was not rerun this time). SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. The 3 new tests passed. **Regression run** - Test-only change (`crates/xcl/tests/d3d12_allocation_and_heap_info.rs`). No runtime code touched; no retail game files used. **Not tested** - AMD, Intel, WARP, release builds, and retail titles. **AI use** - Antigravity (Gemini 4 Neon) wrote the integration tests, ran the focused tests on the local GTX 1650 SUPER, and drafted the original description. Claude Code (Claude Sonnet 5.5) later squashed the commits, ran the full suite and updated this description.
Covers GetResourceAllocationInfo (slot 25) and GetCustomHeapProperties
(slot 26) through both the C++ and C ABIs, using a synthetic title-image
caller so the console hooks are reached. The zero-width buffer is compared
with the host's answer rather than UINT64_MAX, which vkd3d-proton does not
return.

Part of #480.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:44:27 +00:00
github manually merged commit bf84c59e36 into gh-pr/1132/base 2026-11-26 04:44:28 +00:00
Author
Owner

@⁠jmal423 on GitHub · 2026-11-24 12:31 UTC · original · edited 2026-11-24 12:32 UTC

AMD hardware check on unchanged head b0658d0, Windows 11 build 26200, RX 9070 XT, Rust 1.99.1 MSVC, debug. With XCL_ADAPTER=9070 and XCL_REQUIRE_GPU=wave64, the log confirmed the real RX 9070 XT backend. Running cargo test --locked -p xcl --test d3d12_allocation_and_heap_info -- --test-threads=1 --nocapture gave 3 passed, 0 failed, 0 ignored, with no skips. Buffer allocation info and custom heap properties matched the host checks. The texture test checks agreement between the two XCL calling conventions. Focused suite only. AI use: Codex ran the tests and prepared this report.

Full workspace follow-up on the same unmodified head and machine: scripts/test.ps1 exited 0 in debug. Cargo totals: 703 passed, 0 failed, 41 ignored. All three new tests and the synthetic title integration test passed. External samples were unset, so some tests counted as passed returned early.

**@⁠jmal423** on GitHub · 2026-11-24 12:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/1132#issuecomment-7131558757) · edited 2026-11-24 12:32 UTC AMD hardware check on unchanged head b0658d0, Windows 11 build 26200, RX 9070 XT, Rust 1.99.1 MSVC, debug. With XCL_ADAPTER=9070 and XCL_REQUIRE_GPU=wave64, the log confirmed the real RX 9070 XT backend. Running cargo test --locked -p xcl --test d3d12_allocation_and_heap_info -- --test-threads=1 --nocapture gave 3 passed, 0 failed, 0 ignored, with no skips. Buffer allocation info and custom heap properties matched the host checks. The texture test checks agreement between the two XCL calling conventions. Focused suite only. AI use: Codex ran the tests and prepared this report. Full workspace follow-up on the same unmodified head and machine: scripts/test.ps1 exited 0 in debug. Cargo totals: 703 passed, 0 failed, 41 ignored. All three new tests and the synthetic title integration test passed. External samples were unset, so some tests counted as passed returned early.
Author
Owner

@⁠jesuarchive on GitHub · 2026-11-24 12:36 UTC · original

Test report for head b0658d0, merged locally onto main 47efa2e (clean merge, nothing pushed).

Tested

  • NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.1088; AMD Ryzen 7 5800XT; Windows 11 Pro build 26300; rustc 1.95.0 stable-x86_64-pc-windows-msvc (MSVC 14.44); DXC 1.9.2602.17 from the Windows SDK; debug.
  • cargo test -p xcl --test d3d12_allocation_and_heap_info -- --test-threads=1 --nocapture: 3 passed, 0 failed, 0 ignored. None skipped: all three ran against the real adapter.
  • cargo test --workspace -- --test-threads=4: 744 passed, 0 failed, 41 ignored. main 47efa2e on the same machine: 741 passed, 0 failed, 41 ignored; the 3 extra are this PR's tests.
  • SKIPPED on this adapter, the same two on main: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64).

This adds an MSVC-toolchain run on Ampere next to the description's gnullvm run on Turing.

Not tested

  • AMD and Intel GPUs; the head on its own base cb868b2 (only the merge onto 47efa2e); release build; retail titles.

AI use

  • Claude Code with Claude Opus 5.5: merged the branch, ran the commands above on this machine and wrote this report.
**@⁠jesuarchive** on GitHub · 2026-11-24 12:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/1132#issuecomment-7131681161) Test report for head `b0658d0`, merged locally onto `main` `47efa2e` (clean merge, nothing pushed). **Tested** - NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.1088; AMD Ryzen 7 5800XT; Windows 11 Pro build 26300; rustc 1.95.0 `stable-x86_64-pc-windows-msvc` (MSVC 14.44); DXC 1.9.2602.17 from the Windows SDK; debug. - `cargo test -p xcl --test d3d12_allocation_and_heap_info -- --test-threads=1 --nocapture`: 3 passed, 0 failed, 0 ignored. None skipped: all three ran against the real adapter. - `cargo test --workspace -- --test-threads=4`: 744 passed, 0 failed, 41 ignored. `main` `47efa2e` on the same machine: 741 passed, 0 failed, 41 ignored; the 3 extra are this PR's tests. - SKIPPED on this adapter, the same two on `main`: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64). This adds an MSVC-toolchain run on Ampere next to the description's gnullvm run on Turing. **Not tested** - AMD and Intel GPUs; the head on its own base `cb868b2` (only the merge onto `47efa2e`); release build; retail titles. **AI use** - Claude Code with Claude Opus 5.5: merged the branch, ran the commands above on this machine and wrote this report.
Author
Owner

@⁠towiice on GitHub · 2026-11-24 22:49 UTC · original

Thanks @⁠JoaoPauluu for running this under Wine / vkd3d-proton! Updated in 0dc18fe to compare XCL's SizeInBytes (and non-error Alignment) for the zero-width buffer directly against the host driver's answer rather than assuming UINT64_MAX, so both native Windows D3D12 and vkd3d-proton pass cleanly. Re-tested on NVIDIA GeForce GTX 1650 SUPER (3/3 passed).

**@⁠towiice** on GitHub · 2026-11-24 22:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/1132#issuecomment-7146683395) Thanks @⁠JoaoPauluu for running this under Wine / `vkd3d-proton`! Updated in `0dc18fe` to compare XCL's `SizeInBytes` (and non-error `Alignment`) for the zero-width buffer directly against the host driver's answer rather than assuming `UINT64_MAX`, so both native Windows D3D12 and `vkd3d-proton` pass cleanly. Re-tested on NVIDIA GeForce GTX 1650 SUPER (3/3 passed).
Author
Owner

@⁠towiice on GitHub · 2026-11-25 02:01 UTC · original

Squashed the two commits into one (bf84c59). The tree is identical to 0dc18fe. (Posted with Claude Code, Claude Sonnet 5.5.)

**@⁠towiice** on GitHub · 2026-11-25 02:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/1132#issuecomment-7150237196) Squashed the two commits into one (`bf84c59`). The tree is identical to `0dc18fe`. (Posted with Claude Code, Claude Sonnet 5.5.)
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-24 13:45 UTC · original · edited 2026-11-25 02:10 UTC

Update, bf84c59: all three tests pass under Wine with vkd3d-proton now, the zero-width buffer case included. I ran them with the same setup as below, release, one test per process, no uncommitted changes: buffer_allocation_info_matches_host_in_cpp_and_c_abi ok, custom_heap_properties_match_host_in_cpp_and_c_abi ok, texture_allocation_info_agrees_across_cpp_and_c_abi ok. Claude Code (Claude Opus 5.5) ran this rerun.


A run with vkd3d-proton as the host D3D12: one of the three tests fails here, on the host's own answer, not on XCL's.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257 (DXIL → SPIR-V through dxil-spirv), DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. b0658d0 as it is (merge base cb868b2), no uncommitted changes. The test binary runs under Wine, one test per process.
  • custom_heap_properties_match_host_in_cpp_and_c_abi: ok. texture_allocation_info_agrees_across_cpp_and_c_abi: ok.
  • buffer_allocation_info_matches_host_in_cpp_and_c_abi: fails at d3d12_allocation_and_heap_info.rs:295, host should reject zero-width buffer, left: 0. vkd3d-proton does not return SizeInBytes = UINT64_MAX for a Width == 0 buffer.
  • To see the rest, I changed the test locally for two runs and reverted it (the results above are from the unchanged head). Printing the three results gave host [0, 65536] cpp [0, 65536] c [0, 65536]. So both XCL ABIs return the host's answer there. With the three zero-width assertions removed, the test passes, the single-buffer and multi-buffer comparisons included.
  • So on this host the zero-width check tests the driver's behaviour rather than XCL's. Comparing XCL's result with the host's there, as the other cases do, would pass on both.

Not tested

  • native Windows (the earlier reports here cover it); AMD; the rest of the suite on this head.

AI use

  • Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
**@⁠JoaoPauluu** on GitHub · 2026-11-24 13:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1132#issuecomment-7133285317) · edited 2026-11-25 02:10 UTC **Update, `bf84c59`:** all three tests pass under Wine with vkd3d-proton now, the zero-width buffer case included. I ran them with the same setup as below, release, one test per process, no uncommitted changes: `buffer_allocation_info_matches_host_in_cpp_and_c_abi` ok, `custom_heap_properties_match_host_in_cpp_and_c_abi` ok, `texture_allocation_info_agrees_across_cpp_and_c_abi` ok. Claude Code (Claude Opus 5.5) ran this rerun. --- A run with vkd3d-proton as the host D3D12: one of the three tests fails here, on the host's own answer, not on XCL's. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257 (DXIL → SPIR-V through dxil-spirv), DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `b0658d0` as it is (merge base `cb868b2`), no uncommitted changes. The test binary runs under Wine, one test per process. - `custom_heap_properties_match_host_in_cpp_and_c_abi`: ok. `texture_allocation_info_agrees_across_cpp_and_c_abi`: ok. - `buffer_allocation_info_matches_host_in_cpp_and_c_abi`: **fails** at `d3d12_allocation_and_heap_info.rs:295`, `host should reject zero-width buffer`, `left: 0`. vkd3d-proton does not return `SizeInBytes = UINT64_MAX` for a `Width == 0` buffer. - To see the rest, I changed the test locally for two runs and reverted it (the results above are from the unchanged head). Printing the three results gave `host [0, 65536] cpp [0, 65536] c [0, 65536]`. So both XCL ABIs return the host's answer there. With the three zero-width assertions removed, the test passes, the single-buffer and multi-buffer comparisons included. - So on this host the zero-width check tests the driver's behaviour rather than XCL's. Comparing XCL's result with the host's there, as the other cases do, would pass on both. **Not tested** - native Windows (the earlier reports here cover it); AMD; the rest of the suite on this head. **AI use** - Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
Author
Owner

@⁠anderson7z on GitHub · 2026-11-25 04:45 UTC · original

bom!

**@⁠anderson7z** on GitHub · 2026-11-25 04:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1132#issuecomment-7153143720) bom!
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 08:02 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 08:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1132#issuecomment-7156533712) 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: allocation info and custom heap properties against the host driver, through both ABIs.

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/1132#issuecomment-7172162176) Merging: allocation info and custom heap properties against the host driver, through both ABIs. 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.