Skip to content

Tests: compare CreatePlacedResource against the host D3D12 driver - #1608

Merged
ivall merged 1 commit into
xcl-dev:mainfrom
OtavioTadeu:tests/d3d12-placed-resource-parity-480
Nov 25, 2026
Merged

ivall merged 1 commit into
xcl-dev:mainfrom
OtavioTadeu:tests/d3d12-placed-resource-parity-480

Conversation

@OtavioTadeu

@OtavioTadeu OtavioTadeu commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

What is in it

  • Add host D3D12 parity tests for ID3D12Device::CreatePlacedResource (slot 29), Part of Tests: compare the D3D12 answers with the host driver on the same machine (no console files needed) #480:
    • Compares placed buffers in DEFAULT, UPLOAD, and READBACK heaps (including Map/Unmap round-trip) against the unhooked host driver.
    • Compares placed R8G8B8A8_UNORM, BC1_UNORM, RTV, and DSV textures against the host driver.
    • Verifies misaligned/out-of-bounds offset and null descriptor error parity, plus unknown console IID fallback to ID3D12Resource.

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release: NVIDIA GeForce GTX 1660 SUPER (driver 32.0.16.1088, Turing wave32), AMD Ryzen 5 5600G, Windows 11 26200, rustc 1.100.0, debug
  • cargo test -p xcl --test d3d12_create_placed_resource -- --test-threads=1: 3 passed, 0 failed
  • cargo test --workspace -- --test-threads=4: 779 passed, 0 failed, 41 ignored (SKIPPED GPU tests: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask [no wave64], gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware [no wave64], heap_window_out_of_memory_falls_back_to_the_switch_form [no heap windows])

Not tested

  • Retail title execution via scripts/smoke.ps1 (test-only PR, no retail game files on this machine).

AI use

  • Antigravity (Gemini 4 Neon) wrote the integration test cases and commit message; human reviewed.

Add host D3D12 parity integration tests for ID3D12Device::CreatePlacedResource
(slot 29), extending xcl-dev#480 without requiring retail game files or console DLLs:

- Compare DEFAULT/UPLOAD/READBACK placed buffers (with Upload Map/Unmap write-read)
  against the unhooked PC driver on the same adapter.
- Compare non-RT/DS textures (R8G8B8A8, BC1) and RT/DS textures (RTV/DSV with clear
  values) against the host driver.
- Verify misaligned/out-of-bounds offset and null descriptor error parity, plus
  unknown console IID fallback to ID3D12Resource.

Verified locally with:
cargo test -p xcl --test d3d12_create_placed_resource -- --test-threads=1
(3 passed, 0 failed)

Assisted-by: Antigravity (Gemini 4 Neon)

@gut0to gut0to left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The targeted parity tests are clear. One CONTRIBUTING.md requirement is still missing from Tested: the full workspace test suite on a GPU, with pass/fail/ignored and skipped-test details. This is a test-only PR, so the retail-title smoke run is waived, but the suite requirement still applies. Please add its result before merge; if it was not run, say so under Not tested. AI-assisted review; I checked this against the project guide.

@futurepro62

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head 19a7416 (on its base 9e3831e).

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: 778 passed, 0 failed, 41 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_placed_buffers_match_host_driver, create_placed_textures_match_host_driver, create_placed_errors_and_console_iid_fallback.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 779 passed, 0 failed, 41 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • heap_window_out_of_memory_falls_back_to_the_switch_form was skipped with --skip. It fails on main 9e3831e too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (XCL_HEAP_WINDOWS unset). Reported as Tests: heap_window_out_of_memory_falls_back_to_the_switch_form fails under XCL_REQUIRE_GPU=mesh (opt-in skip counted as missing coverage) #1651.

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.

@JoaoPauluu

Copy link
Copy Markdown

With vkd3d-proton as the host, the error test ends the test process: vkd3d-proton crashes on the null-descriptor call.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 (4522cc1a) from Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257 as the host D3D12. Release, cross-built for x86_64-pc-windows-gnu. 19a7416 as it is (based on 9e3831e), no uncommitted changes. d3d12_create_placed_resource runs under Wine, one test per process (--exact).
  • create_placed_buffers_match_host_driver: ok. create_placed_textures_match_host_driver: ok.
  • create_placed_errors_and_console_iid_fallback: the process ends with no result line (exit 5, about 1 s).
  • Where, from temporary prints I reverted afterwards: the two bad offsets (0x100 and 0x400000) return 0x80070057 from both the hook and the host, as the test expects. The process ends during CreatePlacedResource with a null pDesc. With the host called first, it ends in the host's call, before XCL's hook is reached. So it is vkd3d-proton that dereferences the null descriptor, and on this host the null-desc step cannot run. The console-IID fallback part after it was not reached.

Not tested

  • native Windows; the console-IID fallback step on this host; the rest of the suite on this head.

AI use

  • Claude Code (Claude Opus 5.5) built the head, ran the tests, made and reverted the diagnostic prints, and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.

Thanks!

@ivall ivall added the off-goal Does not bear on the current goal (world loading); waits until it is reached label Nov 24, 2026
@JJAutoCompare

Copy link
Copy Markdown

Empirical test report (19a7416)

Hardware / environment

  • Windows 11 Enterprise Evaluation x64, build 26200.9974. AMD Ryzen 7 3800X. Intel Arc A770 16 GiB, driver 32.0.101.9175. The test log identified Intel(R) Arc(TM) A770 Graphics (16258 MiB VRAM) and the real D3D12 backend.
  • Commit 19a7416ff2e3b8bb2cebdac785da06ef6dfc6de7. Unoptimized Rust test profile.
  • rustc 1.100.0 (0ef1bc386 2026-11-09)
  • DXC reported dxcompiler.dll: 1.9(5512-01b62ad4)(1.9.2609.5) - 1.9.2609.5 (01b62ad47).

Commands and results

  • cargo test --workspace --no-run exited 0 and built the workspace test targets.
  • cargo test -p xcl --test d3d12_create_placed_resource --no-run exited 0 and confirmed the focused executable was ready before acquiring the shared Arc lock.
  • The focused run used Invoke-ArcTest.ps1 -Test with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1. Inside the lock, cargo test -p xcl --test d3d12_create_placed_resource -- --nocapture --test-threads=1 exited 0 with 3 passed / 0 failed / 0 ignored / 0 skipped. Libtest reported 0 filtered out and 0.69 s. The log contained no SKIPPED lines.

Observed behavior

  • The hooked and unhooked host paths returned matching creation results and descriptors for placed DEFAULT, UPLOAD, and READBACK buffers. GPU virtual addresses were nonzero on both paths, and the hooked UPLOAD buffer passed the map/write/read assertion.
  • Placed RGBA8 and BC1 textures and the render-target and depth-stencil cases with clear values passed the host comparisons.
  • Both paths rejected the misaligned offset, out-of-bounds offset, and null descriptor. For the unknown interface IID, the host returned E_NOINTERFACE and XCL returned an ID3D12Resource with the expected descriptor.

Not tested

Only the focused integration target ran after workspace compilation. The full GPU workspace suite and game smoke runs were omitted.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1608-focused.log and published.

@ivall
ivall merged commit 8545a24 into xcl-dev:main Nov 25, 2026
4 checks passed
@ivall

ivall commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Merging: CreatePlacedResource 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

ivall commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

I merged this without acting on the Wine report above, sorry. vkd3d-proton dereferences the null description and the test process ends; #2466 runs that step on Windows only.

AI use: Claude Code (Claude Opus 5.5) wrote this on the maintainer's behalf.

mikebuckets171 pushed a commit to mikebuckets171/xcl that referenced this pull request Nov 25, 2026
The host-driver tests of xcl-dev#1612, xcl-dev#1578 and xcl-dev#1613 required the driver to
refuse invalid descriptions. vkd3d-proton accepts some of them, and XCL
answers as it does, so the tests failed under Wine on the driver's answer
and not on XCL's. They now compare XCL with the driver, and still require
the refusal on Windows. The null-description step of xcl-dev#1608 does not run
under Wine, where vkd3d-proton dereferences it and the process ends.

The console heap tests of xcl-dev#1687 returned in silence without unified
memory; they report a skip now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants