Skip to content

d3d12_geometry: skip with 77 when no Vulkan device is available - #3360

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
al3xar:fix/d3d12-geometry-test-nogpu-skip
Nov 23, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
al3xar:fix/d3d12-geometry-test-nogpu-skip

Conversation

@al3xar

@al3xar al3xar commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Updates runtime/test/d3d12_geometry_test.cpp to call vktest::Device::initialize() instead of EXPECT(d.create()):
    • Returns 77 when DeviceStatus::unavailable (no Vulkan loader / no Vulkan GPU, e.g. hosted Windows CI runners), matching runtime/CMakeLists.txt's SKIP_RETURN_CODE 77 on d3d12_geometry and the rest of the d3d12_* test suite.
    • Keeps EXPECT(device_status == vktest::DeviceStatus::ready) so real device creation or validation-layer failures (DeviceStatus::failed) still fail the test instead of silently skipping.
  • Disjoint from d3d12_msaa_draw, d3d12_translated_draw: skip with 77 when there is no Vulkan device (TEST-652) #3301 (TEST-652, which covers d3d12_msaa_draw_test.cpp and d3d12_translated_draw_test.cpp) and Register three self-checking Vulkan tests with CTest (TEST-514) #2931 (TEST-514). This was the last remaining CTest-registered d3d12_* test calling EXPECT(d.create()).

Verification

  • Built d3d12_geometry_test on Windows 11 (MSVC 19.44, Vulkan SDK 1.4.363.0, NVIDIA GeForce RTX 3060, driver 621.24).
  • Ran d3d12_geometry_test.exe with LEONIDA_VK_VALIDATION=1: passed (exit 0, 0 validation errors, all 4,096 pixels matched).
  • Ran ctest -R "^d3d12_geometry$" --output-on-failure: 1/1 Test #120: d3d12_geometry ... Passed.
  • Verified real failure path with LEONIDA_VK_DEVICE=__nonexistent_gpu_for_skip_check__: exits 1 (DeviceStatus::failed does not silently skip).
  • No game data used or included.

AI-assisted.

@0xTehuti 0xTehuti 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.

Tested \72fb353f\ on NVIDIA GeForce RTX 2070 SUPER (TU104, Turing), driver 595.79, Windows 11 Pro x64, Vulkan 1.4.329. Built with MSVC 19.44 (VS 2022 Community), Ninja 1.13, CMake 4.4, RelWithDebInfo.

  • Physical GPU execution: \d3d12_geometry_test.exe\ passed in 0.29s (exit code 0). All 4,096 pixels matched across both VS+GS+PS quad draw and VS+PS control, with line topology refused as expected.
  • Simulated headless / no-GPU runner: Setting \VK_LOADER_DRIVERS_SELECT=nonexistent\ returned clean exit code \77\ (\DeviceStatus::unavailable), matching \SKIP_RETURN_CODE 77\ in CTest.
  • CTest: \ctest -R d3d12_geometry\ passed 1/1 (0.30s).

Clean fix that eliminates the spurious red CI check on hosted Windows runners without a Vulkan GPU while preserving genuine initialization assertions (\DeviceStatus::ready). LGTM.

@kotorvr

kotorvr commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 72fb353 on NVIDIA GeForce RTX 4090, 621.14, Windows 11 (26200): pass, including the skip path, which I could reach here by hiding every Vulkan driver from the loader.

MSVC 19.44 (VS 2022), Ninja, RelWithDebInfo; the branch is one commit on main f847748, built the same way for comparison.

d3d12_geometry_test main f847748 72fb353
normal run exit 0 exit 0, "all 4096 pixels matched; a GS with a line topology refused"
ctest -R "^d3d12_geometry$" --repeat until-fail:5 Passed (one run) Passed 5/5
LEONIDA_VK_VALIDATION=1 (output says validation on) exit 0
VK_LOADER_DRIVERS_DISABLE=* (no Vulkan device) exit 1, line 43: d.create() exit 77; ctest reports ***Skipped
LEONIDA_VK_DEVICE=no_such_gpu_name exit 1, the "no Vulkan 1.3 device ... matches" message, then line 45: device_status == vktest::DeviceStatus::ready

So a machine without a Vulkan device now skips instead of failing, and a device filter that matches nothing still fails. No new compiler warnings. No game files. AI-assisted check (Claude Code).

@Vonsek

Vonsek commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 72fb353 on Windows 11, RTX 5080 (driver 616.92) and AMD Radeon iGPU gfx1036 (driver 26.10.1): ctest -R d3d12_geometry (MSVC, RelWithDebInfo, LEONIDA_VK_DEVICE set per run, device line confirmed) — pass on both, 1/1 each, all 4096 pixels matched.

  • RTX 5080: passed.
  • AMD Radeon (gfx1036): passed.
    Skip path: with VK_DRIVER_FILES pointing at a nonexistent driver manifest (no Vulkan device available), d3d12_geometry_test.exe exits 77.

AI-assisted.

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

Note

🤖 Gemini 4 Neon responding on behalf of Jolymmiles

Static code review of 72fb353f against main (f847748c) (macOS host, no Windows/Vulkan execution rerun here): looks good, with one non-blocking follow-up note.

  • runtime/test/d3d12_geometry_test.cpp:43 replaces EXPECT(d.create()) with d.initialize(), returning 77 only on vktest::DeviceStatus::unavailable (matching SKIP_RETURN_CODE 77 at runtime/CMakeLists.txt:1708) while preserving failure on DeviceStatus::failed via EXPECT(device_status == vktest::DeviceStatus::ready). The subsequent if (!d.enabled.geometryShader) return 77; check remains intact.
  • Together with #3301, this closes all three remaining EXPECT(d.create()) CTest entries among the 74 SKIP_RETURN_CODE 77 tests on f847748c.
  • Non-blocking follow-up (pre-existing on main, out of scope here): lines 56-59 of runtime/test/d3d12_geometry_test.cpp still pass raw LEONIDA_TEST_{VS,GS,PS}_SPV paths to std::filesystem::copy_file instead of wrapping them in vktest::shader_fixture_path(...).

@dandasma

Copy link
Copy Markdown
Contributor

Tested 72fb353 on AMD Radeon RX 9070 (RDNA4), AMD 26.10.1 (LLPC), Vulkan 1.4.359, Windows 11 26300 (MSVC build of main f847748 + this PR, Vulkan SDK 1.4.363.0): pass.

  • ctest -R "^d3d12_geometry$" --output-on-failure with LEONIDA_VK_DEVICE=9070: Passed, 3 runs out of 3.
  • Same with LEONIDA_VK_VALIDATION=1: Passed.
  • LEONIDA_VK_DEVICE set to a name no GPU has: Failed, as the PR wants: "no Vulkan 1.3 device ... with a graphics queue matches", then line 45: device_status == vktest::DeviceStatus::ready.
  • Skip path reproduced without hiding the GPU: loader pointed at no driver (VK_DRIVER_FILES and VK_ICD_FILENAMES set to a nonexistent manifest, LEONIDA_VK_DEVICE unset): ***Skipped with this PR (2 runs out of 2), ***Failed on main (line 43: d.create()), which is the case the PR is for.

AI-assisted (Claude Code).

@oVolkra

oVolkra commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 72fb353 (merged onto main f847748) on RTX 3060 (Ampere), driver 617.14, Windows 11, MSVC 14.44, RelWithDebInfo: pass

  • ctest: 140/140 pass, also with LEONIDA_VK_VALIDATION=1 (140/140).
  • scripts/run_gpu_tests.py: native 153/199 (46 skipped), with LEONIDA_W64_EMULATE=1 184/199 (15 skipped). Same as main at f847748.
  • Not run: the *_test.exe programs that ctest does not register. No game files used.

AI-assisted: this check was run and written with Claude Code (Anthropic) on my machine; the numbers above are its unedited output.

@ItsNotRexed
ItsNotRexed merged commit 609d5f1 into ItsNotRexed:main Nov 23, 2026
3 of 10 checks passed
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.

8 participants