Skip to content

dxgi_device, dxgi_swapchain: skip what needs a desktop when the process has no interactive window station - #6301

Merged
shayderrr merged 1 commit into
ItsNotRexed:mainfrom
kour0:fix/dxgi-tests-no-desktop
Nov 23, 2026
Merged

shayderrr merged 1 commit into
ItsNotRexed:mainfrom
kour0:fix/dxgi-tests-no-desktop

Conversation

@kour0

@kour0 kour0 commented Nov 23, 2026

Copy link
Copy Markdown

Claimed in the coordination issue as: new finding, #6089 (comment)

What and why

Run from a process without an interactive window station (an SSH session, a service), dxgi_device and dxgi_swapchain fail instead of skipping. There the host DXGI answers DXGI_ERROR_NOT_CURRENTLY_AVAILABLE (0x887a0022):

  • dxgi_device: the host WARP pass stops at (output_hr == S_OK && output.p) || (output_hr == DXGI_ERROR_NOT_FOUND && !output.p), because EnumOutputs(0) returns 0x887a0022.
  • dxgi_swapchain: every host CreateSwapChainForHwnd returns 0x887a0022, so 40 of 45 descriptions "differ from the host runtime".

Both pass from a desktop session on the same machine, and both already declare SKIP_RETURN_CODE 77.

Changes (tests only, no runtime change):

  • dxgi_swapchain skips without an interactive window station, as d3d12_present_test does since TEST-200 ([TEST-200] Make M1 CTest skips accurate #1391).
  • dxgi_device accepts DXGI_ERROR_NOT_CURRENTLY_AVAILABLE from EnumOutputs only there, with no output, and keeps its other checks. From a desktop the check is as strict as before.
  • has_interactive_window_station() moves from d3d12_present_test.cpp to runtime/test/window_station.h, shared by the three tests. Its body is unchanged.

Merges cleanly with #6078, which also touches d3d12_present_test.cpp.

Tested

Windows 11 (build 26300), MSVC RelWithDebInfo (scripts/build_runtime.ps1), NVIDIA GeForce RTX 4070 Ti SUPER, driver 621.01, at 42d9f698e on main 561b65a83:

main this branch
SSH session (no desktop) dxgi_device fails, dxgi_swapchain fails, d3d12_present skipped dxgi_device passes, dxgi_swapchain skipped, d3d12_present skipped
Desktop session (scheduled task with /it) all three pass all three pass

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable: no translator change.)

🤖 Generated with Claude Code

…ss has no interactive window station

From an SSH session or a service the host DXGI answers DXGI_ERROR_NOT_CURRENTLY_AVAILABLE (0x887a0022) to
EnumOutputs and to every CreateSwapChainForHwnd, so dxgi_device failed its EnumOutputs check on the host pass and
dxgi_swapchain reported 40 of 45 descriptions as differing from the host. Both pass from a desktop session.

dxgi_swapchain now skips (exit 77) without an interactive window station, as d3d12_present_test does since TEST-200;
dxgi_device accepts DXGI_ERROR_NOT_CURRENTLY_AVAILABLE from EnumOutputs only there and keeps its other checks. The
check moves from d3d12_present_test.cpp to window_station.h, shared by the three tests.
@milas6669

Copy link
Copy Markdown

Tested head 42d9f698e on Windows 11 (build 26200), NVIDIA GeForce RTX 3070 (driver 32.0.16.2124), MSVC 19.44 RelWithDebInfo, clean worktree.

Interactive desktop session results:

  • dxgi_device: Passed (0.70s) — 3 backends passed (WARP, host hardware RTX 3070, Vulkan layer)
  • dxgi_swapchain: Passed (1.52s) — 45 descriptions compared with host runtime, 0 mismatches, 0 validation errors
  • d3d12_present: Passed (1.41s) — 70 frames presented through Xbox-ABI proxy on Vulkan, resize/out-of-date recoveries verified

All 3/3 tests pass with full strictness in interactive desktop mode. Code review confirms has_interactive_window_station() cleanly consolidated into runtime/test/window_station.h without modifying the runtime proper. Synthetic inputs only, no game files. AI-assisted.

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Reviewed change in PR #6301: dxgi_device, dxgi_swapchain: skip what needs a desktop when the process has no interactive window station.

Scope: runtime/test/d3d12_present_test.cpp, runtime/test/dxgi_device_test.cpp, runtime/test/dxgi_swapchain_test.cpp, +1 more
Diff: +27 / -10 across 4 file(s).

The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.

Reviewed by shayderrr via automated batch review.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Head 42d9f698e, based on main 561b65a83 (0 behind); git diff --check clean.

Built dxgi_device_test dxgi_swapchain_test d3d12_present_test with VS 2022 BuildTools + Ninja, RelWithDebInfo, Vulkan 1.4.363, BUILD_TESTING=ON, LEONIDA_BUILD_WINDOWS_RUNTIME=ON.

  • dxgi_device_test.exe: 3 backend(s) passed, exit 0
  • dxgi_swapchain_test.exe: 45 descriptions compared ... 0 mismatches, PASS, exit 0
  • d3d12_present_test.exe: 70 frames ..., exit 0
  • Temporarily forced the new helper false: dxgi_swapchain_test prints SKIP: the process has no interactive window station, exit 77; dxgi_device_test still passes.

Test-only (no runtime change); the header refactor is shared by the three tests. First-frame impact: none. LGTM.

@shayderrr

Copy link
Copy Markdown
Collaborator

Thanks @kour0 - I went through this change and the diff around runtime/test/d3d12_present_test.cpp. The change is tight, the rationale matches the code, and nothing here needs another pass from my side. Approved and squash-merging it into main now. Nice work.

@shayderrr
shayderrr merged commit 55200be into ItsNotRexed:main Nov 23, 2026
@kour0
kour0 deleted the fix/dxgi-tests-no-desktop branch November 23, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants