test(agc): skip submit progress and pipelined metadata pass without a Vulkan device #11638

Merged
dantdmdarealguy merged 1 commit from upstream-pr/11638 into main 2026-10-28 14:29:29 +00:00
dantdmdarealguy commented 2026-10-27 00:43:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by dantdmdarealguy on 2026-10-27T00:43:45Z.


What

On a host without a Vulkan driver, ctest on main skips 770 Vulkan tests but fails these four:

 640 - agc_submit_progress (Failed)
 641 - agc_submit_progress_no_timeline (Failed)
1064 - agc_driver_pipelined_metadata_pass (Failed)
1273 - agc_driver_pipelined_metadata_pass_draw_pipeline (Failed)
vkCreateInstance: Vulkan result -9

There are two causes:

  • PipelinedMetadataPass.cpp does not probe for a device. It goes straight to the driver, so the driver's VulkanDevice constructor throws and the test returns 1. It now opens OpenVulkanTestDevice() first and returns VulkanTestSkipped, as PipelinedFill.cpp, PipelinedPredicationRead.cpp and the other pipelined tests do. Both registrations already have SKIP_RETURN_CODE 77.
  • agc_submit_progress and agc_submit_progress_no_timeline set ANYPS5_REQUIRE_VULKAN=1 in their own ctest ENVIRONMENT. No other test does this. SubmitProgress.cpp already skips through OpenVulkanTestDevice(), but the forced variable makes that helper rethrow, so the skip could never run. The variable is removed from both registrations.

OpenVulkanTestDevice() itself is narrowed so that the skip covers only a missing driver or device:

  • Before, it caught every std::exception from the VulkanDevice constructor. A construction failure on a host that has a device was therefore reported as "no usable Vulkan device" and skipped whenever ANYPS5_REQUIRE_VULKAN was unset.

  • The constructor now throws AgcDriver::VulkanUnavailable, a std::runtime_error, in exactly three cases:

    • the loader library (vulkan-1.dll / libvulkan.so.1) cannot be loaded;
    • vkCreateInstance returns VK_ERROR_INCOMPATIBLE_DRIVER, which the loader returns when it finds no driver;
    • no Vulkan 1.1 device with a graphics and compute queue exists.

    The messages are unchanged.

  • The helper skips only on VulkanUnavailable. Every other failure propagates and fails the test, with or without ANYPS5_REQUIRE_VULKAN. That covers enumeration errors, any other vkCreateInstance result, required features, vkCreateDevice, allocation, and ANYPS5_GPU naming no device. Excluding ANYPS5_GPU follows BdaDevice.cpp (#8167), SampledCacheBudget.cpp and PerformanceOverlay.cpp, which already never skip for an unmatched ANYPS5_GPU.

  • ANYPS5_REQUIRE_VULKAN=1 with no device still fails, as before.

New regression test tests/execution/VulkanTestDevice.cpp, with two registrations:

  • agc_driver_vulkan_test_device:
    • the default device opens, both without and with ANYPS5_REQUIRE_VULKAN=1;
    • with a device present and ANYPS5_GPU naming no device, construction fails and the helper throws the plain error (not VulkanUnavailable) instead of skipping;
    • returns 77 when there is no device, and fails when there is no device and ANYPS5_REQUIRE_VULKAN=1 is set.
  • agc_driver_vulkan_test_device_no_driver: VK_DRIVER_FILES and VK_ICD_FILENAMES point at a missing file. Without ANYPS5_REQUIRE_VULKAN the helper must skip; with it, the helper must throw VulkanUnavailable. This runs on every host, with or without a GPU.

Same shape as #5045 and #2628.

Tested

Rebased onto main 80b209d984 (1 ahead, 0 behind; tools/check_main_sync.py: merge clean). The runs below were on b7105f7285. Since then main changed VulkanDevice.cpp and the driver's CMakeLists only in unrelated places (frame dumps, the keyboard overlay, barycentric built-ins); the three VulkanUnavailable throws are unchanged.

Windows 11 Pro, Intel Core i9-14900K, 128 GB RAM, NVIDIA GeForce RTX 5080 (driver 32.0.16.1742), WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON:

  • Build: cmake --build --parallel 6 and --target libs succeed, with no warnings in the touched files.
  • Focused tests on the GPU: ctest -R "^(agc_driver_vulkan_test_device|agc_driver_vulkan_test_device_no_driver|agc_submit_progress|agc_submit_progress_no_timeline|agc_driver_pipelined_metadata_pass|agc_driver_pipelined_metadata_pass_draw_pipeline|agc_driver_device_selection|patched_libraries)$" passes 8 of 8.
  • Every test that uses OpenVulkanTestDevice(): ctest --parallel 2 -R "^agc|^guest_job_manager_profiler", 1092 tests.
    • On the GPU, 1092 of 1092 pass. The 8 skips are platform or feature limits (udmabuf, Linux comparison mode, VK_EXT_shader_stencil_export, sample locations, a test not built), none of them "no usable Vulkan device".
    • With the ICD hidden (VK_DRIVER_FILES and VK_ICD_FILENAMES pointing at a missing file), 1092 of 1092 pass with 776 skipped. 773 of the skips are "no usable Vulkan device" from vkCreateInstance: Vulkan result -9.
  • The four tests with the ICD hidden:
    • main fails them (vkCreateInstance: Vulkan result -9);
    • with the change they are Skipped;
    • with ANYPS5_REQUIRE_VULKAN=1 they still fail.
  • Device present but construction fails (ANYPS5_GPU="no such device 5c1e0b7a", so the constructor throws after enumerating the RTX 5080 and the Intel UHD 770):
    • With the previous helper (head 489d9354), all four tests are Skipped ("no usable Vulkan device: Vulkan: no usable device whose name contains ANYPS5_GPU=..."), and agc_driver_vulkan_test_device fails: "a device construction failure on a host with NVIDIA GeForce RTX 5080 was reported as a skip".
    • With the change, all four fail with the constructor's error, and agc_driver_vulkan_test_device passes.
  • agc_driver_vulkan_test_device in all four combinations:
    • GPU, ANYPS5_REQUIRE_VULKAN unset or 1: passes.
    • No ICD, variable unset: Skipped.
    • No ICD, ANYPS5_REQUIRE_VULKAN=1: fails ("opening the default device failed: vkCreateInstance: Vulkan result -9").
    • agc_driver_vulkan_test_device_no_driver passes in all four.
  • Validation layer:
    • Setup: run with ctest -V, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1. The layer was a user-local copy loaded through VK_ADD_LAYER_PATH.
    • main: the four tests plus agc_driver_device_selection, 5 of 5 pass.
    • The change: the same five plus agc_driver_vulkan_test_device, 6 of 6 pass.
    • VK_LOADER_DEBUG=layer shows the validation layer inserted in every test process (9 times on main, 14 with the change).
    • Neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS, and neither has any VUID- errors.
  • Checks: tools/check_conventions.py --base origin/main, tools/check_test_registration.py and tools/check_main_sync.py --base origin/main --head HEAD pass.

From the first version of this PR, on Arch Linux on WSL2 with no Vulkan ICD: the four tests failed on main 3 of 3 runs in Release and Debug, and were Skipped with the change. ANYPS5_REQUIRE_VULKAN=1 still failed them. The full ctest passed 2431 of 2431.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 5080, driver 32.0.16.1742, Windows 11 Pro; no device (Vulkan ICD hidden on the same host; Arch Linux WSL2 without a Vulkan ICD for the first version)
  • AI-assisted: yes, some AI assistance was used
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5026826030 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11638). Originally posted by [dantdmdarealguy](https://github.com/dantdmdarealguy) on 2026-10-27T00:43:45Z. --- ### What On a host without a Vulkan driver, `ctest` on `main` skips 770 Vulkan tests but fails these four: ``` 640 - agc_submit_progress (Failed) 641 - agc_submit_progress_no_timeline (Failed) 1064 - agc_driver_pipelined_metadata_pass (Failed) 1273 - agc_driver_pipelined_metadata_pass_draw_pipeline (Failed) vkCreateInstance: Vulkan result -9 ``` There are two causes: - **`PipelinedMetadataPass.cpp` does not probe for a device.** It goes straight to the driver, so the driver's `VulkanDevice` constructor throws and the test returns 1. It now opens `OpenVulkanTestDevice()` first and returns `VulkanTestSkipped`, as `PipelinedFill.cpp`, `PipelinedPredicationRead.cpp` and the other pipelined tests do. Both registrations already have `SKIP_RETURN_CODE 77`. - **`agc_submit_progress` and `agc_submit_progress_no_timeline` set `ANYPS5_REQUIRE_VULKAN=1` in their own ctest `ENVIRONMENT`.** No other test does this. `SubmitProgress.cpp` already skips through `OpenVulkanTestDevice()`, but the forced variable makes that helper rethrow, so the skip could never run. The variable is removed from both registrations. `OpenVulkanTestDevice()` itself is narrowed so that the skip covers only a missing driver or device: - Before, it caught every `std::exception` from the `VulkanDevice` constructor. A construction failure on a host that has a device was therefore reported as "no usable Vulkan device" and skipped whenever `ANYPS5_REQUIRE_VULKAN` was unset. - The constructor now throws `AgcDriver::VulkanUnavailable`, a `std::runtime_error`, in exactly three cases: - the loader library (`vulkan-1.dll` / `libvulkan.so.1`) cannot be loaded; - `vkCreateInstance` returns `VK_ERROR_INCOMPATIBLE_DRIVER`, which the loader returns when it finds no driver; - no Vulkan 1.1 device with a graphics and compute queue exists. The messages are unchanged. - The helper skips only on `VulkanUnavailable`. Every other failure propagates and fails the test, with or without `ANYPS5_REQUIRE_VULKAN`. That covers enumeration errors, any other `vkCreateInstance` result, required features, `vkCreateDevice`, allocation, and `ANYPS5_GPU` naming no device. Excluding `ANYPS5_GPU` follows `BdaDevice.cpp` (#8167), `SampledCacheBudget.cpp` and `PerformanceOverlay.cpp`, which already never skip for an unmatched `ANYPS5_GPU`. - `ANYPS5_REQUIRE_VULKAN=1` with no device still fails, as before. New regression test `tests/execution/VulkanTestDevice.cpp`, with two registrations: - **`agc_driver_vulkan_test_device`**: - the default device opens, both without and with `ANYPS5_REQUIRE_VULKAN=1`; - with a device present and `ANYPS5_GPU` naming no device, construction fails and the helper throws the plain error (not `VulkanUnavailable`) instead of skipping; - returns 77 when there is no device, and fails when there is no device and `ANYPS5_REQUIRE_VULKAN=1` is set. - **`agc_driver_vulkan_test_device_no_driver`**: `VK_DRIVER_FILES` and `VK_ICD_FILENAMES` point at a missing file. Without `ANYPS5_REQUIRE_VULKAN` the helper must skip; with it, the helper must throw `VulkanUnavailable`. This runs on every host, with or without a GPU. Same shape as #5045 and #2628. ### Tested Rebased onto `main` 80b209d984 (1 ahead, 0 behind; `tools/check_main_sync.py`: merge clean). The runs below were on b7105f7285. Since then `main` changed `VulkanDevice.cpp` and the driver's CMakeLists only in unrelated places (frame dumps, the keyboard overlay, barycentric built-ins); the three `VulkanUnavailable` throws are unchanged. Windows 11 Pro, Intel Core i9-14900K, 128 GB RAM, NVIDIA GeForce RTX 5080 (driver 32.0.16.1742), WinLibs GCC 15.2.0, Release, `BUILD_TESTING=ON`: - **Build:** `cmake --build --parallel 6` and `--target libs` succeed, with no warnings in the touched files. - **Focused tests on the GPU:** `ctest -R "^(agc_driver_vulkan_test_device|agc_driver_vulkan_test_device_no_driver|agc_submit_progress|agc_submit_progress_no_timeline|agc_driver_pipelined_metadata_pass|agc_driver_pipelined_metadata_pass_draw_pipeline|agc_driver_device_selection|patched_libraries)$"` passes 8 of 8. - **Every test that uses `OpenVulkanTestDevice()`:** `ctest --parallel 2 -R "^agc|^guest_job_manager_profiler"`, 1092 tests. - On the GPU, 1092 of 1092 pass. The 8 skips are platform or feature limits (udmabuf, Linux comparison mode, `VK_EXT_shader_stencil_export`, sample locations, a test not built), none of them "no usable Vulkan device". - With the ICD hidden (`VK_DRIVER_FILES` and `VK_ICD_FILENAMES` pointing at a missing file), 1092 of 1092 pass with 776 skipped. 773 of the skips are "no usable Vulkan device" from `vkCreateInstance: Vulkan result -9`. - **The four tests with the ICD hidden:** - `main` fails them (`vkCreateInstance: Vulkan result -9`); - with the change they are `Skipped`; - with `ANYPS5_REQUIRE_VULKAN=1` they still fail. - **Device present but construction fails** (`ANYPS5_GPU="no such device 5c1e0b7a"`, so the constructor throws after enumerating the RTX 5080 and the Intel UHD 770): - With the previous helper (head 489d9354), all four tests are `Skipped` ("no usable Vulkan device: Vulkan: no usable device whose name contains ANYPS5_GPU=..."), and `agc_driver_vulkan_test_device` fails: "a device construction failure on a host with NVIDIA GeForce RTX 5080 was reported as a skip". - With the change, all four fail with the constructor's error, and `agc_driver_vulkan_test_device` passes. - **`agc_driver_vulkan_test_device` in all four combinations:** - GPU, `ANYPS5_REQUIRE_VULKAN` unset or `1`: passes. - No ICD, variable unset: `Skipped`. - No ICD, `ANYPS5_REQUIRE_VULKAN=1`: fails ("opening the default device failed: vkCreateInstance: Vulkan result -9"). - `agc_driver_vulkan_test_device_no_driver` passes in all four. - **Validation layer:** - Setup: run with `ctest -V`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1` and `ANYPS5_REQUIRE_VULKAN=1`. The layer was a user-local copy loaded through `VK_ADD_LAYER_PATH`. - `main`: the four tests plus `agc_driver_device_selection`, 5 of 5 pass. - The change: the same five plus `agc_driver_vulkan_test_device`, 6 of 6 pass. - `VK_LOADER_DEBUG=layer` shows the validation layer inserted in every test process (9 times on `main`, 14 with the change). - Neither log contains `was not found but was requested by env var VK_INSTANCE_LAYERS`, and neither has any `VUID-` errors. - **Checks:** `tools/check_conventions.py --base origin/main`, `tools/check_test_registration.py` and `tools/check_main_sync.py --base origin/main --head HEAD` pass. From the first version of this PR, on Arch Linux on WSL2 with no Vulkan ICD: the four tests failed on `main` 3 of 3 runs in Release and Debug, and were `Skipped` with the change. `ANYPS5_REQUIRE_VULKAN=1` still failed them. The full `ctest` passed 2431 of 2431. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 5080, driver 32.0.16.1742, Windows 11 Pro; no device (Vulkan ICD hidden on the same host; Arch Linux WSL2 without a Vulkan ICD for the first version) - [x] AI-assisted: yes, some AI assistance was used
MarcZX10 commented 2026-10-27 01:09:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T01:09:20Z.

Review: APPROVED


Reviewed exact head 489d9354. In PipelinedMetadataPass, OpenVulkanTestDevice is now called before constructing the driver so the test can return the configured skip code when no usable device exists. The two submit-progress CTest registrations no longer force ANYPS5_REQUIRE_VULKAN=1, allowing their existing probe/skip path to work outside the strict CI environment. The target set compiled locally. Execution of the submit-progress binary could not reach test logic on this host: emulator startup rejects the Xeon E5-1620 v2 for lacking LZCNT, BMI1, BMI2, MOVBE, AVX2 and FMA. The author reports repeated no-ICD skip checks in Release/Debug, GPU runs on RTX 5080, and validation-layer runs with no VUIDs; hosted product jobs for this PR are skipped by path policy. The refreshed policy checks pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5661100783 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11638#pullrequestreview-5661100783). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T01:09:20Z. **Review:** APPROVED --- Reviewed exact head 489d9354. In PipelinedMetadataPass, OpenVulkanTestDevice is now called before constructing the driver so the test can return the configured skip code when no usable device exists. The two submit-progress CTest registrations no longer force ANYPS5_REQUIRE_VULKAN=1, allowing their existing probe/skip path to work outside the strict CI environment. The target set compiled locally. Execution of the submit-progress binary could not reach test logic on this host: emulator startup rejects the Xeon E5-1620 v2 for lacking LZCNT, BMI1, BMI2, MOVBE, AVX2 and FMA. The author reports repeated no-ICD skip checks in Release/Debug, GPU runs on RTX 5080, and validation-layer runs with no VUIDs; hosted product jobs for this PR are skipped by path policy. The refreshed policy checks pass.
MarcZX10 commented 2026-10-27 01:41:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T01:41:38Z.

Review: DISMISSED


The no-device skips fix a reproducible test-registration problem, and the author reports extensive no-ICD, GPU, Debug/Release, and validation-layer runs. I’m changing my earlier approval after reviewing the collaborator’s exception-path concern.

OpenVulkanTestDevice() catches every std::exception from the entire VulkanDevice constructor and returns a skip when ANYPS5_REQUIRE_VULKAN is unset. The constructor can throw after instance creation for failures unrelated to device absence (for example, physical-device enumeration, device selection/creation, required feature setup, or allocation). In that case these newly routed tests report “no usable Vulkan device” and pass as skipped on a developer host that does have a Vulkan device, hiding a test/setup regression.

Please make the skip conditional on a specific missing-loader/no-usable-device outcome and allow other initialization failures to fail, with a regression covering device-present initialization failure in addition to no-device and required-device cases. The current ANYPS5_REQUIRE_VULKAN=1 CI behavior protects that CI configuration but does not protect local runs with the variable unset.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5661285968 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11638#pullrequestreview-5661285968). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T01:41:38Z. **Review:** DISMISSED --- The no-device skips fix a reproducible test-registration problem, and the author reports extensive no-ICD, GPU, Debug/Release, and validation-layer runs. I’m changing my earlier approval after reviewing the collaborator’s exception-path concern. `OpenVulkanTestDevice()` catches every `std::exception` from the entire `VulkanDevice` constructor and returns a skip when `ANYPS5_REQUIRE_VULKAN` is unset. The constructor can throw after instance creation for failures unrelated to device absence (for example, physical-device enumeration, device selection/creation, required feature setup, or allocation). In that case these newly routed tests report “no usable Vulkan device” and pass as skipped on a developer host that does have a Vulkan device, hiding a test/setup regression. Please make the skip conditional on a specific missing-loader/no-usable-device outcome and allow other initialization failures to fail, with a regression covering device-present initialization failure in addition to no-device and required-device cases. The current `ANYPS5_REQUIRE_VULKAN=1` CI behavior protects that CI configuration but does not protect local runs with the variable unset.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!11638
No description provided.