Skip to content

Tests: verify D3D12.X null device, resource, fence, and PSO stream - #2374

Open
amazedturnip wants to merge 1 commit into
xcl-dev:mainfrom
amazedturnip:xcl/tests-d3d12x-null-device-and-pso-stream-contract-015603
Open

amazedturnip wants to merge 1 commit into
xcl-dev:mainfrom
amazedturnip:xcl/tests-d3d12x-null-device-and-pso-stream-contract-015603

Conversation

@amazedturnip

Copy link
Copy Markdown
Contributor

Adds integration contract tests for the D3D12.X null backend (crates/xcl/src/hle/d3d12x/null.rs) in crates/xcl/tests/d3d12x_null_contract.rs. Covers subobject_payload layouts and capture_*_desc pointer/stream guards, exported device/blob/root-signature entry points, device queries and feature support, and ID3D12Resource, ID3D12Fence, ID3D12DeviceChild, and COM refcounting vtable contracts.

What is in it

  • crates/xcl/tests/d3d12x_null_contract.rs: add contract tests for subobject_payload (0..=28 and unknown types), capture_graphics_desc/capture_compute_desc/capture_stream_desc guards, D3D12XboxCreateDevice/D3D10CreateBlob/debug/root-sig entry points, device queries (GetNodeCount, GetAdapterLuid, GetCustomHeapProperties, GetResourceAllocationInfo, GetCopyableFootprints, CheckFeatureSupport OPTIONS5), resource Map/GPU VA/GetDesc/GetHeapProperties, Fence SetEventOnCompletion/Signal, DeviceChild::GetDevice, and COM refcounting.

Tested

Not tested

  • retail Xbox Series X|S title (not available on this host)
  • NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64)

AI use

  • Antigravity CLI (Gemini 4 Hydrogen (Medium)) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).

@throny

throny commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Two contributors checked independently and found that #2006 solves the same problem in a different way: #1607, group D106. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint from the community triage in #1607, not a maintainer decision.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

@emirduran707

Copy link
Copy Markdown
Contributor

Independent AMD RDNA4 (native wave64) test report on exact head e017aa6e01c1751f8cf34ad587f39097f4b79fee (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1292 passed, 3 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • All 5 new integration tests in d3d12x_null_contract.rs passed (entry_points_and_blob_contract, device_queries_and_feature_support, subobject_payload_known_and_unknown_types, resource_fence_device_child_and_refcount, capture_desc_and_stream_guards).
    • The 3 failures are pre-existing on unmodified main 68a284a: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722) and fuzz_validate_and_gpu_3 (seed 1599) on this GPU, plus gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (from 50a9fde / Recompiler: a bridged mask write in the split form meets no barrier #2074).

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: e017aa6e01c1751f8cf34ad587f39097f4b79fee
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1622 (PresentX 1623)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13920 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.

Add integration contract tests for crates/xcl/src/hle/d3d12x/null.rs covering subobject_payload layouts (0..=28 and unknown types), capture_graphics_desc/capture_compute_desc/capture_stream_desc guards, D3D12XboxCreateDevice/D3D10CreateBlob/debug/root-sig entry points, device queries (GetNodeCount, GetAdapterLuid, GetCustomHeapProperties, GetResourceAllocationInfo, GetCopyableFootprints, CheckFeatureSupport OPTIONS5), resource Map/GPU VA/GetDesc/GetHeapProperties, Fence SetEventOnCompletion/Signal, DeviceChild GetDevice, and COM refcounting.
@DavidM1911

Copy link
Copy Markdown
Contributor

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

  • cargo test -p xcl --lib: 1 real failure, deterministic (also fails --test-threads=1, 1219/1):
gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier
  assertion failed: group barriers in the program (lower_dxil.rs:1155)

The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge.

— Devin

@amazedturnip

Copy link
Copy Markdown
Contributor Author

CI failure was the stale base: this PR head predates upstream/main's #2420 fix (c828d8c) that corrects a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier to only count barriers after the entry whole-wave branch. Rebased this PR onto upstream/main (2898511); the test now passes locally (and the 5 new d3d12x_null_contract tests all pass). The one remaining local failure, gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722), is pre-existing on unmodified main per the community report and is unrelated to this PR. On the D106 hint from #1607: this PR adds an integration test file (crates/xcl/tests/d3d12x_null_contract.rs) covering the null backend, device queries, resources, fences, refcounting and stream guards; #2006 pins subobject_payload sizes/alignment in null.rs #[cfg(test)] tests. They overlap on the subobject_payload contract but cover different surfaces (one class-wide integration file vs. a focused table test), so both are needed rather than one replacing the other — happy to trim overlap if the other author prefers.

@amazedturnip
amazedturnip force-pushed the xcl/tests-d3d12x-null-device-and-pso-stream-contract-015603 branch from e017aa6 to 2e503f4 Compare November 25, 2026 19:14
@throny throny added the off-goal Does not bear on the current goal (world loading); waits until it is reached label Nov 26, 2026
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.

4 participants