Skip to content

test(vulkan): fail explicit setup errors in copy tests - #4902

Open
editrice wants to merge 1 commit into
ItsNotRexed:mainfrom
editrice:test/copy-setup-status
Open

editrice wants to merge 1 commit into
ItsNotRexed:mainfrom
editrice:test/copy-setup-status

Conversation

@editrice

Copy link
Copy Markdown

Claimed as a new TEST item: #4816 (comment)

What and why

d3d12_copy_xfmt_test and d3d12_stencil_copy_test used the boolean vktest::Device::create() wrapper. That conflates an unavailable Vulkan device with a setup failure, so an explicitly unmatched LEONIDA_VK_DEVICE filter prints an error but exits 77 and CTest reports a skip. Use the existing DeviceStatus result: skip only unavailable, fail on other non-ready states. This is limited to the two whole-resource copy tests and is separate from #4852's presenter test.

Tested

  • Windows 11, RTX 5070 / NVIDIA 621.01, MSVC 19.44 Release, Vulkan SDK 1.4.363.1: focused d3d12_copy_xfmt and d3d12_stencil_copy CTests passed 2/2 normally (46 cross-format comparisons, 0 differences; 24 stencil cases matched both planes against WARP).
  • With LEONIDA_VK_DEVICE=__codex_no_such_gpu__, the patched binaries fail 2/2 and CTest exits 8. An independent rebuild from the parent source incorrectly skipped both with CTest exit 0. Reapplying the fix reproduced the failed status.
  • Independent pre-push code review approved the two-file scope. git diff --check passed.

Synthetic tests only; no game files or game-derived content. AI-assisted (Codex daybreak-blue implementation and independent review).

Checklist

  • No game data, keys or decryption, including in logs or reports quoted here.
  • Translator contract entry: not applicable; this changes Vulkan test exit classification only.

@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 9e885f8 on Windows 11. Both copy tests pass on the NVIDIA GeForce RTX 4090 (driver 32.0.16.2101) and AMD Radeon(TM) Graphics (driver 32.0.21043.5001). The device lines confirm each Vulkan adapter. CTest selects WARP for the native comparison.

I built the two changed targets with MSVC 14.51 in RelWithDebInfo. I ran ctest --test-dir build -C RelWithDebInfo -R "^(d3d12_copy_xfmt|d3d12_stencil_copy)$" -V with three values for LEONIDA_VK_DEVICE:

Value Result
4090 2 passed. CTest exits 0.
Radeon 2 passed. CTest exits 0.
__no_adapter_4902__ Both tests report the unmatched filter. CTest records 2 failures and exits 8.

With the same unmatched filter at merge base d974c88, CTest skips both tests and exits 0. This check covers the two changed tests.

AI-assisted.

@tupacfan04

Copy link
Copy Markdown
Contributor

APPROVE. git merge-tree vs d974c88 clean, diff --check clean. Built Release/Ninja with MSVC 19.51 on an RTX 5070 (SDK 1.4.363): zero warnings for d3d12_copy_xfmt_test, d3d12_stencil_copy_test, d3d12_sparse_queue_family_test.

  • Patched: d3d12_copy_xfmt passed (10.56 s), d3d12_stencil_copy passed (0.48 s), ctest exit 0.
  • Patched with LEONIDA_VK_DEVICE=__codex_no_such_gpu__: both failed, ctest exit 8, matching the PR's claim.
  • Negative control with runtime/test/d3d12_{copy_xfmt,stencil_copy}_test.cpp reverted to origin/main: both skipped, ctest exit 0 - the bug is real.
  • LEONIDA_VK_VALIDATION=1: passed in 8.25 s.

The fix follows the existing DeviceStatus{ready,unavailable,failed} convention (runtime/test/vk_test_device.h), as used by 60+ tests.

Non-blocking notes: runtime/test/queue_proxy_test.cpp:729 still uses the old create(), and a missing validation layer is now exit 1 rather than 77 for these two tests - intended, but it is a changed CI skip contract.

AI-assisted review, synthetic data only, local GPU.

@gertify

gertify commented Nov 23, 2026

Copy link
Copy Markdown

Tested 9e885f8 on NVIDIA GeForce RTX 4080 (driver 617.42), Windows 11, test programs cross-built with clang-cl + xwin: pass on the normal runs, judged by each program's printed result lines.

  • d3d12_copy_xfmt_test: 46 compared, 0 differ (BC <-> uncompressed, controls), 0 depth <-> colour differ.
  • d3d12_stencil_copy_test (device: NVIDIA GeForce RTX 4080): 24 depth/stencil copy cases matched host and upload patterns on both planes.

The unmatched LEONIDA_VK_DEVICE case (fail instead of skip) was not run here.

AI-assisted.

@ricardotanaka

Copy link
Copy Markdown

Also tested 9e885f8b merged onto main 3faac557 on an AMD Radeon RX 7600 (RDNA3, AMD 26.11.2), Windows 11 26200, MSVC 19.44, RelWithDebInfo: pass, with and without LEONIDA_VK_VALIDATION=1 (no validation messages). The checks above are NVIDIA; this one uses AMD's own D3D12 driver as the host reference.

  • d3d12_copy_xfmt: 46 compared, 0 differ (BC <-> uncompressed, controls), 0 depth <-> colour differ; 22 lines print matches AMD Radeon RX 7600 and 24 print matches WARP.
  • d3d12_stencil_copy: 24 cases matched host and upload patterns on both planes.

AI-assisted (Claude Code).

@memorypressure

Copy link
Copy Markdown

Verified against main 3faac55: clean merge; the change makes the two copy tests use vktest::Device::initialize() with DeviceStatus (runtime/test/vk_test_device.h:62), matching the pattern the other d3d12_* tests already use, so a real setup failure exits 1 instead of silently skipping as 77. Main still has the old !vk.create() line in both files. Binaries not built or run here (no GPU/Wine/cmake on this verifier) — and note this branch currently reports no CI checks at all, so nothing has validated it on the GitHub side yet. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

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.

6 participants