Skip to content

[upstream #1820] Tests: verify D3D12.X CreateHeap, QueryInterface, and IDXGIDevice parity - #317

Open
ufoptg wants to merge 7 commits into
mainfrom
upstream-pr/1820
Open

ufoptg wants to merge 7 commits into
mainfrom
upstream-pr/1820

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Part of xcl-dev#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 ([upstream #1134] PE loader: reject unreadable export forwarders #28) and CreateHeap1 ([upstream #1104] D3D12.X: return title address in Map before calling PC Map (#940) #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


Mirror of xcl-dev#1820 (auto-synced, do not edit).

grahamster2 and others added 7 commits November 23, 2026 22:30
The `title:` line of an xcl-smoke block printed the game folder's name,
and folder names are whatever people called their copy, so PR
descriptions ended up naming specific copies of a commercial game
(xcl-dev#677). It now prints the first 8 hex digits of the SHA-256 of the
folder name (trimmed, UTF-8). pr_check.py only compares the main and PR
blocks' titles for equality, so the check is unchanged, and two
different folders still get different titles. Existing blocks can be
converted with the same function (Python:
hashlib.sha256(name.strip().encode()).hexdigest()[:8]).

-Title <label> prints a label of your choice instead. Control, format
and line/paragraph separator characters and backticks are refused:
pr_check.py splits lines with str.splitlines(), so a U+2028 in a label
would otherwise add keys such as `commit:` to the block.

scripts/smoke-title.tests.ps1 checks hashes of ASCII, accented, CJK and
emoji names against Python's, a trailing backslash, -Title, and the
refused labels, with a stand-in for xcl.exe.

Fixes xcl-dev#677
…v#1307)

The structured form wraps the items that follow a forward jump in a guard
that lists every pending skip flag, and reopens it whenever the set
changes. With many flags pending at once that grows with the square of
the flags. Since b8b1f49 one compute program of the retail pack reaches
it: 148 MB of HLSL from 334 KB of code (3 861 flags, guards of up to 597
terms, 99 MB in guard lines), against 14 MB as pc blocks. DXC on that
fits the host's commit growing about 1 GB/s until it runs out, seen with
b8b1f49 and not without it.

Structured code longer than 128 bytes per byte of program is now
translated as pc blocks. Over the whole pack (CPU-side translation of
every program, macOS), only that program changes, to 13.8 MB. The next
largest structured program is at 61 bytes per byte. Every other program
comes out as it does on main, so b8b1f49's gain stays (1 670 -> 170
programs as pc blocks).

oversized_structured_code_falls_back_to_pc_blocks: 200 conditional
forward jumps whose targets all follow them, in order, cross the bound;
50 do not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-oom

dxil: eliminate giant-shader IR and CFG blowup in FormatLoad and multi-window memory
Scripts: smoke blocks name the game folder by a hash, not its name
Add standalone integration tests (Part of xcl-dev#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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants