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

Open
amazedturnip wants to merge 1 commit from upstream-pr/2374 into main
amazedturnip commented 2026-11-25 17:09:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by amazedturnip on 2026-11-25T17:09:58Z.


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

  • Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build
  • AMD (AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64), XCL_ADAPTER=radeon): cargo test --workspace -- --test-threads=2 — 1218 passed, 2 failed, 26 ignored (SKIPPED GPU tests: 1 (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), 1 (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), 1 (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), 1 (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), 1 (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), 1 (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), 1 (cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)); pre-existing upstream/main failures excluded: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier)
  • Verification / negative control: new test suite — verified 3x deterministic

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).
<!-- greyfinch-sync:ivall/xcl:issue:5495755027 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2374). Originally posted by [amazedturnip](https://github.com/amazedturnip) on 2026-11-25T17:09:58Z. --- 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** - Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build - AMD (`AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64)`, `XCL_ADAPTER=radeon`): `cargo test --workspace -- --test-threads=2` — 1218 passed, 2 failed, 26 ignored (SKIPPED GPU tests: 1 (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), 1 (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), 1 (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), 1 (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), 1 (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), 1 (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), 1 (cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)); pre-existing upstream/main failures excluded: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier) - Verification / negative control: new test suite — verified 3x deterministic **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 commented 2026-11-25 18:04:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-25T17:58:41Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7170265436 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2374#issuecomment-7170265436). Originally posted by [throny](https://github.com/throny) on 2026-11-25T17:58:41Z. --- <!-- xcl-1607-hint:D106 --> 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 commented 2026-11-25 19:08:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T18:13:27Z.


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 / #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.
<!-- greyfinch-sync:ivall/xcl:comment:7170613250 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2374#issuecomment-7170613250). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T18:13:27Z. --- 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` / #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.
DavidM1911 commented 2026-11-25 20:08:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T19:12:01Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7171956946 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2374#issuecomment-7171956946). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T19:12:01Z. --- 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 commented 2026-11-25 20:08:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by amazedturnip on 2026-11-25T19:14:31Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7172017574 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2374#issuecomment-7172017574). Originally posted by [amazedturnip](https://github.com/amazedturnip) on 2026-11-25T19:14:31Z. --- 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.
github-actions[bot] commented 2026-11-30 08:41:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:41:15Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7273217786 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2374#issuecomment-7273217786). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:41:15Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
amazedturnip commented 2026-11-30 08:44:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by amazedturnip on 2026-11-30T08:44:15Z.


Still merges cleanly onto main (d52ff48c) with passing checks; verify D3D12.X null device, resource, fence, and PSO stream — waiting on maintainer / post-goal review.

<!-- greyfinch-sync:ivall/xcl:comment:7273279945 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2374#issuecomment-7273279945). Originally posted by [amazedturnip](https://github.com/amazedturnip) on 2026-11-30T08:44:15Z. --- Still merges cleanly onto main (d52ff48c) with passing checks; verify D3D12.X null device, resource, fence, and PSO stream — waiting on maintainer / post-goal review.
Foniass commented 2026-12-01 07:57:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:57:25Z.


Triage (#1607) – head 2e503f4

#2006 (merged as 17d22c18) already pins the subobject_payload table in null.rs's unit tests, so subobject_payload_known_and_unknown_types here repeats it; the other tests (capture guards, entry-point HRESULTs, blob, device queries, resource/fence/refcount contracts of the null device) are not covered on main or by another open PR.
Consider dropping the repeated subobject test. The remaining tests address vtable slots by raw index (slot(dev, 43) etc.), which is how the existing contract tests do it.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7304691469 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2374#issuecomment-7304691469). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:57:25Z. --- **Triage (#1607)** – head 2e503f4 #2006 (merged as 17d22c18) already pins the `subobject_payload` table in `null.rs`'s unit tests, so `subobject_payload_known_and_unknown_types` here repeats it; the other tests (capture guards, entry-point HRESULTs, blob, device queries, resource/fence/refcount contracts of the null device) are not covered on main or by another open PR. Consider dropping the repeated subobject test. The remaining tests address vtable slots by raw index (`slot(dev, 43)` etc.), which is how the existing contract tests do it. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2374:upstream-pr/2374'
git switch 'upstream-pr/2374'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2374'
git switch 'upstream-pr/2374'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2374'
git switch 'upstream-pr/2374'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2374'
git switch 'main'
git merge --squash 'upstream-pr/2374'
git switch 'main'
git merge --ff-only 'upstream-pr/2374'
git switch 'main'
git merge 'upstream-pr/2374'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2364
No description provided.