Skip to content

tests: fail explicit Vulkan setup errors in remaining CTests - #4956

Open
editrice wants to merge 1 commit into
ItsNotRexed:mainfrom
editrice:test/vulkan-device-status-batch
Open

editrice wants to merge 1 commit into
ItsNotRexed:mainfrom
editrice:test/vulkan-device-status-batch

Conversation

@editrice

Copy link
Copy Markdown

Claimed in the coordination issue as: Vulkan CTest status batch (carried into #4933).

What and why

The remaining eight test programs treated every failed Vulkan initialization as an unavailable device. This hid explicit setup failures, including an unmatched LEONIDA_VK_DEVICE, as CTest skips or successful host-backend fallbacks. Use vktest::Device::initialize() at all 10 sites so failed exits 1, while unavailable keeps the existing skip/fallback behavior. The queue_proxy_test diff child also distinguishes the two statuses. This does not overlap #4852 or #4902.

Tested

Windows, NVIDIA GeForce RTX 5070, driver 621.01, MSVC 19.44 Release. Built all eight changed targets. Normal device: 7/7 registered CTests passed; standalone vk_queue_test exited 0. Unmatched selector: all seven CTests failed as intended and vk_queue_test exited 1, including proxy tests after their host backends passed. Missing ICD with selector unset: four Vulkan-only CTests skipped (77), three proxy tests passed using host fallback, and vk_queue_test exited 77. The queue_proxy_test --diff vulkan 0 real child returned 77 for an unavailable ICD and 1 for the unmatched selector. git diff --check passed. The build used explicit Vulkan SDK and Python paths because default CMake discovery missed them on this host.

AI-assisted: yes, Codex daybreak-blue worker; contributor reviewed the diff.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • Translator rule: n/a (no translator change).

@SphyserX

Copy link
Copy Markdown

Tested f40ce7d on Arch Linux (in a VM), GCC, Ninja, RelWithDebInfo, Mesa llvmpipe: pass. Of the eight programs, the four Vulkan ones that build on Linux are covered here:

program normal LEONIDA_VK_DEVICE=nomatch-xyz no ICD (VK_DRIVER_FILES/VK_ICD_FILENAMES → missing file)
vk_bc_zero_init_test 0 1 77
vk_fence_dispatcher_sync_test 0 1 77
vk_queue_query_sync_test 0 1 77
vk_queue_test 0 1 77

With the runtime of main 03b09a0, the unmatched selector gives 77 for all four, which is the hidden failure described. Full Linux CTest on the PR: 50 of 50 pass. The proxy, DXGI and present tests are Windows-only and not covered here.

@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested f40ce7d on Windows 11 with an NVIDIA GeForce RTX 4090 (32.0.16.2101) and AMD Radeon(TM) Graphics (32.0.21043.5001). The setup status checks pass on both adapters. I built all eight changed executables with MSVC in RelWithDebInfo. I ran each executable directly. The device lines confirm the selected adapters.

Executable RTX 4090 Radeon Unmatched selector Missing ICD
vk_bc_zero_init_test, vk_fence_dispatcher_sync_test, vk_queue_query_sync_test, vk_queue_test 0 0 1 77
allocator_proxy_test, dxgi_device_test, queue_proxy_test 0 0 1 0
xbox_present_test 1 1 1 77
queue_proxy_test --diff vulkan 0 real 0 0 1 77

For the unmatched selector, I set LEONIDA_VK_DEVICE=no-such-review-adapter. For the missing ICD, I removed that variable and set VK_DRIVER_FILES to a missing JSON file.

Two checks on merge base 3faac557:

  • With the unmatched selector, vk_bc_zero_init_test exits with 77. The PR exits with 1.
  • On each real adapter, xbox_present_test fails the same frame width and height check on both revisions (line 1104 on the base, line 1106 on the PR). This occurs after device setup.

AI-assisted.

@Exopus-0x65f7ad0

Copy link
Copy Markdown
Contributor

Tested f40ce7dc on Windows 11 (26300), RTX 5060 Ti / 621.14, MSVC 14.51 (VS 2026), Vulkan SDK 1.4.363.0, RelWithDebInfo, clean build with -DLEONIDA_LLVM_MC. Full LEONIDA_VK_VALIDATION=1 ctest -j4: 167/167 pass, 0 VUIDs. The eight changed programs (allocator_proxy, dxgi_device, queue_proxy, vk_bc_zero_init, vk_fence_dispatcher_sync, vk_queue_query_sync, vk_queue, xbox_present) all run on the GPU and pass; none skipped or fell back. I did not try the unmatched LEONIDA_VK_DEVICE case.

AI-assisted (Claude Code). Synthetic data only, no game files.

@gertify

gertify commented Nov 23, 2026

Copy link
Copy Markdown

Tested f40ce7d on Intel UHD 770 (driver 32.0.101.7088), Windows 11, MSVC 19.44: three of the PR's tests pass, and dxgi_device_test stops before the PR's Vulkan hunk on this GPU.

Native MSVC build, session without an interactive window station, LEONIDA_VK_VALIDATION=1:

  • allocator_proxy_test: exit 0, "allocator_proxy_test: 3 backend(s) passed". queue_proxy_test: exit 0, all host WARP and Vulkan sections print their summary lines. vk_queue_test: exit 0, "device: Intel(R) UHD Graphics 770 (validation on)", "validation errors: 0" (the test's own counter), "vk_queue_test: OK".
  • dxgi_device_test: exit 1 at "host WARP line 136" ((output_hr == S_OK && output.p) || (output_hr == DXGI_ERROR_NOT_FOUND && !output.p)). The same exit 1 at the same line on main 3faac55 in the same slot and build, so it does not come from this PR. EXPECT returns at the first failure, so the PR's dxgi_device_test hunk (the failed-device return near line 308) never runs here and is not verified on this GPU.

The PR's negative cases (unmatched LEONIDA_VK_DEVICE exits 1, missing ICD exits 77), vk_bc_zero_init_test, vk_fence_dispatcher_sync_test, vk_queue_query_sync_test and xbox_present_test were not run.

AI-assisted.

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.

5 participants