Tests: pin the IDXGIDevice answers() contract #2462

Open
amazedturnip wants to merge 1 commit from upstream-pr/2472 into main
amazedturnip commented 2026-11-25 19:39:22 +00:00 (Migrated from github.com)

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


Pin the console IDXGIDevice answers() contract: answers() is true exactly for IDXGIObject / IDXGIDevice / IDXGIDevice1 / IDXGIDevice2, and false for ID3D12Device, IDXGIFactory4, ID3D12Resource, and a zero GUID — tested through the public xcl API with no GPU dependence. The vtable layout contract (17-slot ordering) is not reachable from an integration test in non_runtime_only mode, so it is explicitly left out of scope rather than asserted incorrectly.

What is in it

  • crates/xcl/tests/dxgi_device.rs: 2 integration tests pinning the console IDXGIDevice answers() contract through the public API.
  • answers() is true exactly for the four DXGI GUIDs (IDXGIObject / IDXGIDevice / IDXGIDevice1 / IDXGIDevice2), equal to the windows crate's GUIDs.
  • answers() is false for ID3D12Device, IDXGIFactory4, ID3D12Resource, and a zero GUID — the same interfaces the surrounding qi path hands back to the device.

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=1 — 1287 passed, 1 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)
  • Verification / negative control: New additive test file — verified deterministic (2 passed each run, 3 consecutive runs); no existing behavior was changed, so no fix had to be verified against an observed failure.

Not tested

  • Full retail runtime run (test/script-only PR; no runtime code modified)
  • NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64)

AI use

  • Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
<!-- greyfinch-sync:ivall/xcl:issue:5497927096 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2472). Originally posted by [amazedturnip](https://github.com/amazedturnip) on 2026-11-25T19:39:22Z. --- Pin the console IDXGIDevice answers() contract: answers() is true exactly for IDXGIObject / IDXGIDevice / IDXGIDevice1 / IDXGIDevice2, and false for ID3D12Device, IDXGIFactory4, ID3D12Resource, and a zero GUID — tested through the public xcl API with no GPU dependence. The vtable layout contract (17-slot ordering) is not reachable from an integration test in non_runtime_only mode, so it is explicitly left out of scope rather than asserted incorrectly. **What is in it** - crates/xcl/tests/dxgi_device.rs: 2 integration tests pinning the console IDXGIDevice `answers()` contract through the public API. - `answers()` is true exactly for the four DXGI GUIDs (IDXGIObject / IDXGIDevice / IDXGIDevice1 / IDXGIDevice2), equal to the windows crate's GUIDs. - `answers()` is false for ID3D12Device, IDXGIFactory4, ID3D12Resource, and a zero GUID — the same interfaces the surrounding `qi` path hands back to the device. **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=1` — 1287 passed, 1 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) - Verification / negative control: New additive test file — verified deterministic (2 passed each run, 3 consecutive runs); no existing behavior was changed, so no fix had to be verified against an observed failure. **Not tested** - Full retail runtime run (test/script-only PR; no runtime code modified) - NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64) **AI use** - Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
fromthemoonx commented 2026-11-25 21:05:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-25T20:25:50Z.


Passes on NVIDIA, merged onto current main; both new tests catch a deliberate break in answers() that the existing dxgi_device lib test does not.

Tested: 6845526 merged onto main 6d12f58 (clean). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug.

result
cargo test --workspace --no-fail-fast -- --test-threads=4 1425 passed, 0 failed, 46 ignored; 25 SKIPPED lines (no wave64, refused per-lane forms)
cargo test -p xcl --test dxgi_device, 3 runs 2 passed, 3 of 3

Deliberate breaks in dxgi_device::answers (scratch):

  • IDXGIDevice2 left out: answers_true_for_the_four_dxgi_guids fails (IDXGIDevice2 must be answered); cargo test -p xcl --lib dxgi_device still passes.
  • ID3D12Device added: answers_false_for_other_interfaces_and_zero_guid fails (ID3D12Device must not be answered); the lib test still passes.

The tests don't use the GPU, so NVIDIA vs AMD makes no difference to them.

Not tested: the full suite at the head itself (only merged), a release build.

AI use: Claude Code (Claude Opus 5.5) ran the tests and the scratch breaks, and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7173659282 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2472#issuecomment-7173659282). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-11-25T20:25:50Z. --- **Passes on NVIDIA, merged onto current `main`; both new tests catch a deliberate break in `answers()` that the existing `dxgi_device` lib test does not.** **Tested:** `6845526` merged onto `main` `6d12f58` (clean). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug. | | result | |---|---| | `cargo test --workspace --no-fail-fast -- --test-threads=4` | 1425 passed, 0 failed, 46 ignored; 25 `SKIPPED` lines (`no wave64`, refused per-lane forms) | | `cargo test -p xcl --test dxgi_device`, 3 runs | 2 passed, 3 of 3 | Deliberate breaks in `dxgi_device::answers` (scratch): - `IDXGIDevice2` left out: `answers_true_for_the_four_dxgi_guids` fails (`IDXGIDevice2 must be answered`); `cargo test -p xcl --lib dxgi_device` still passes. - `ID3D12Device` added: `answers_false_for_other_interfaces_and_zero_guid` fails (`ID3D12Device must not be answered`); the lib test still passes. The tests don't use the GPU, so NVIDIA vs AMD makes no difference to them. **Not tested:** the full suite at the head itself (only merged), a release build. **AI use:** Claude Code (Claude Opus 5.5) ran the tests and the scratch breaks, and wrote this report.
DavidM1911 commented 2026-11-25 21:05:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T20:34:20Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7173869027 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2472#issuecomment-7173869027). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T20:34:20Z. --- 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!
SlopTart commented 2026-11-25 21:05:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T20:37:12Z.


gpu_ suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, and the promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Note gpu_depth_buffer_created_for_unordered_access_is_placed is green on main now, #2466 did its job on this lane.

<!-- greyfinch-sync:ivall/xcl:comment:7173937973 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2472#issuecomment-7173937973). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T20:37:12Z. --- `gpu_` suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, and the promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Note `gpu_depth_buffer_created_for_unordered_access_is_placed` is green on main now, #2466 did its job on this lane.
github-actions[bot] commented 2026-11-30 08:39:52 +00:00 (Migrated from github.com)

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


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:7273188140 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2472#issuecomment-7273188140). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:39:52Z. --- 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:12 +00:00 (Migrated from github.com)

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


Still merges cleanly onto main (d52ff48c) with passing checks; pin the IDXGIDevice answers() contract — waiting on maintainer / post-goal review.

<!-- greyfinch-sync:ivall/xcl:comment:7273278793 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2472#issuecomment-7273278793). Originally posted by [amazedturnip](https://github.com/amazedturnip) on 2026-11-30T08:44:12Z. --- Still merges cleanly onto main (d52ff48c) with passing checks; pin the IDXGIDevice answers() contract — waiting on maintainer / post-goal review.
Foniass commented 2026-12-01 08:08:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:08:40Z.


Triage (#1607) – head 6845526

No open or merged PR adds this test; main has no test of dxgi_device::answers. #3384 extends answers to IDXGIDevice3/IDXGIDevice4 with a unit test of its own. That does not break these assertions, but the file's header ("and nothing else") would then be out of date.
No problems found in the diff: xcl::hle::d3d12x::dxgi_device is public, and the test needs no GPU.
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:7304931121 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2472#issuecomment-7304931121). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:08:40Z. --- **Triage (#1607)** – head 6845526 No open or merged PR adds this test; main has no test of `dxgi_device::answers`. #3384 extends `answers` to IDXGIDevice3/IDXGIDevice4 with a unit test of its own. That does not break these assertions, but the file's header ("and nothing else") would then be out of date. No problems found in the diff: `xcl::hle::d3d12x::dxgi_device` is public, and the test needs no GPU. 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/2472:upstream-pr/2472'
git switch 'upstream-pr/2472'

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/2472'
git switch 'upstream-pr/2472'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2472'
git switch 'upstream-pr/2472'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2472'
git switch 'main'
git merge --squash 'upstream-pr/2472'
git switch 'main'
git merge --ff-only 'upstream-pr/2472'
git switch 'main'
git merge 'upstream-pr/2472'
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!2462
No description provided.