Tests: pin the IDXGIDevice answers() contract #2472

Open
github-bot wants to merge 1 commit from github-bot/gh-2472 into main AGit
Owner

@⁠amazedturnip on GitHub · 2026-11-25 19:39 UTC · original
amazedturnip:xcl/tests-dxgi-device-answers-contract-030352 → main · +25 −0 · 1 files · 1 commits · open

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).
**@⁠amazedturnip** on GitHub · 2026-11-25 19:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/2472) `amazedturnip:xcl/tests-dxgi-device-answers-contract-030352` → `main` · +25 −0 · 1 files · 1 commits · open 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).
The console IDXGIDevice object is the title's way to reach DXGI; pin its answers() contract: exactly the four DXGI GUIDs (IDXGIObject / IDXGIDevice / IDXGIDevice1 / IDXGIDevice2) are answered, ID3D12Device, IDXGIFactory4, ID3D12Resource and a zero GUID are not. The vtable contract is not reachable from an integration test without touching the runtime source (out of scope in this non_runtime_only mode), so only answers() is pinned.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:31:33 +00:00
Author
Owner

@⁠fromthemoonx on GitHub · 2026-11-25 20:25 UTC · original

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.

**@⁠fromthemoonx** on GitHub · 2026-11-25 20:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/2472#issuecomment-7173659282) **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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 20:34 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-25 20:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/2472#issuecomment-7173869027) 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!
Author
Owner

@⁠SlopTart on GitHub · 2026-11-25 20:37 UTC · original

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.

**@⁠SlopTart** on GitHub · 2026-11-25 20:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/2472#issuecomment-7173937973) `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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2472/head:github-bot/gh-2472'
git switch 'github-bot/gh-2472'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2472'
git switch 'github-bot/gh-2472'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2472'
git switch 'github-bot/gh-2472'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2472'
git switch 'main'
git merge --squash 'github-bot/gh-2472'
git switch 'main'
git merge --ff-only 'github-bot/gh-2472'
git switch 'main'
git merge 'github-bot/gh-2472'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.