Skip to content

Tests: pin the IDXGIDevice answers() contract - #2472

Open
amazedturnip wants to merge 1 commit into
xcl-dev:mainfrom
amazedturnip:xcl/tests-dxgi-device-answers-contract-030352
Open

amazedturnip wants to merge 1 commit into
xcl-dev:mainfrom
amazedturnip:xcl/tests-dxgi-device-answers-contract-030352

Conversation

@amazedturnip

Copy link
Copy Markdown
Contributor

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

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.
@fromthemoonx

Copy link
Copy Markdown

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.

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

Copy link
Copy Markdown
Contributor

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

Thanks!

@SlopTart

Copy link
Copy Markdown

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.

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.

5 participants