Tests: compare GetResourceAllocationInfo and GetCustomHeapProperties against host D3D12 driver #1132
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1132
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1132/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@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 UTCPart of #480. Adds host-driver parity integration tests for
ID3D12Device::GetResourceAllocationInfo(slot 25) andID3D12Device::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):modules::register_mapped) soguard::make_splitdispatches to XCL's real console hooks (get_resource_allocation_info_xandget_custom_heap_properties_x), while comparing directly againstreal::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: comparesDEFAULT,UPLOAD, andREADBACKheap 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,RGBA8with mips,BC7) agree bit-for-bit across C++ and C ABIs with valid non-zero sizes and power-of-two alignments.xcl::gpu::recomp::runner::skip_test("no GPU").Tested
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).bf84c59(same tree as0dc18fe, basecb868b2), same GPU (driver 32.0.16.1088), Rust 1.100.0x86_64-pc-windows-gnullvm, debug, run with Claude Code:cargo build --workspace, thencargo 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(xcllib, which this PR does not touch;mainwas 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
crates/xcl/tests/d3d12_allocation_and_heap_info.rs). No runtime code touched; no retail game files used.Not tested
AI use
@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.
@jesuarchive on GitHub · 2026-11-24 12:36 UTC · original
Test report for head
b0658d0, merged locally ontomain47efa2e(clean merge, nothing pushed).Tested
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.main47efa2eon the same machine: 741 passed, 0 failed, 41 ignored; the 3 extra are this PR's tests.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
cb868b2(only the merge onto47efa2e); release build; retail titles.AI use
@towiice on GitHub · 2026-11-24 22:49 UTC · original
Thanks @JoaoPauluu for running this under Wine /
vkd3d-proton! Updated in0dc18feto compare XCL'sSizeInBytes(and non-errorAlignment) for the zero-width buffer directly against the host driver's answer rather than assumingUINT64_MAX, so both native Windows D3D12 andvkd3d-protonpass cleanly. Re-tested on NVIDIA GeForce GTX 1650 SUPER (3/3 passed).@towiice on GitHub · 2026-11-25 02:01 UTC · original
Squashed the two commits into one (
bf84c59). The tree is identical to0dc18fe. (Posted with Claude Code, Claude Sonnet 5.5.)@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_abiok,custom_heap_properties_match_host_in_cpp_and_c_abiok,texture_allocation_info_agrees_across_cpp_and_c_abiok. 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
x86_64-pc-windows-gnu.b0658d0as it is (merge basecb868b2), 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 atd3d12_allocation_and_heap_info.rs:295,host should reject zero-width buffer,left: 0. vkd3d-proton does not returnSizeInBytes = UINT64_MAXfor aWidth == 0buffer.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.Not tested
AI use
@anderson7z on GitHub · 2026-11-25 04:45 UTC · original
bom!
@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!
@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,
main2898511with 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_1and_3, which fail the same way onmain);hle::d3d12xon 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.