test(agc): honor ANYPS5_GPU in the fixtures that open their own Vulkan device #9253

Merged
SandstromPL merged 1 commit from upstream-pr/9253 into main 2026-10-24 04:11:24 +00:00
SandstromPL commented 2026-10-21 16:34:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-21T16:34:22Z.


What

Seven AGC fixtures create their own Vulkan instance and pick a device without reading ANYPS5_GPU: PresentationPass, DepthPlaneGuestLayers, DepthStorage, DepthSurfaceLastWriter and PartiallyResidentSnapshot take the first enumerated device, OversizedDescriptorSets the first discrete one, and SparseBufferHoles ranks by device type. On a machine with more than one Vulkan device, a run meant for one GPU can report results from another: #5271 reports agc_driver_sparse_buffer_holes logging the RTX with ANYPS5_GPU=Radeon on a machine with both. With a name that matches no device, all of them still pass on main.

#6225, #7104, #7570, #7602 and #8167 fixed this one fixture at a time, each with its own copy of the selection. These seven now share one header, tests/execution/FixtureDeviceSelection.hpp, with the driver's rule from VulkanDevice.cpp:

  • among Vulkan 1.1 devices, the first whose name contains ANYPS5_GPU, ignoring case;
  • without a request, the first of the highest-ranked type (discrete, integrated, virtual, then the rest).

A name that matches nothing throws no Vulkan 1.1 device whose name contains ANYPS5_GPU="…"; devices: …. The fixtures keep their existing handling of that: a skip, or a failure under ANYPS5_REQUIRE_VULKAN. A new CPU test, agc_driver_fixture_device_selection, covers the ranking, the name matching, ANYPS5_GPU itself and the error text.

Two other fixtures read ANYPS5_GPU but match it case-sensitively: PooledBufferRange (#7104) and NativeMultisampleDepth. #10050 moves them onto this header. The other four that select their own device (Recorder, PerformanceOverlay, SampledCacheBudget, BdaDevice) already follow the driver's rule with their own copies, so this PR doesn't touch them.

Tested

Linux (Ubuntu 24.04, GCC 13.3), NVIDIA GeForce RTX 3050 Ti Laptop GPU (driver 580.178.04), on main cecb540a6 and on this PR. The 9 tests these fixtures run are agc_driver_presentation_pass, agc_driver_depth_plane_guest_layers, agc_driver_depth_storage, agc_driver_depth_surface_last_writer, agc_driver_oversized_descriptor_sets, agc_driver_partially_resident_snapshot, agc_driver_partially_resident_pending_stores, agc_driver_large_tracked_snapshot and agc_driver_sparse_buffer_holes.

  • With VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1 (ctest -V), all 9 pass on main and on this PR. The layer loads in both logs, and neither has a VUID- line.
  • With ANYPS5_GPU="no such device 1d3d154f" and ANYPS5_REQUIRE_VULKAN=1:
    • main: all 9 pass on the NVIDIA GPU.
    • This PR: all 9 fail with no Vulkan 1.1 device whose name contains ANYPS5_GPU="no such device 1d3d154f"; devices: NVIDIA GeForce RTX 3050 Ti Laptop GPU.
  • With ANYPS5_GPU="geforce rtx", all 9 pass.
  • agc_driver_fixture_device_selection passes, and tools/check_test_registration.py passes on the build.

This machine has one GPU, so the multi-device cases are covered only by the CPU test.

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 3050 Ti Laptop GPU (driver 580.178.04), Ubuntu 24.04
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4954970209 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9253). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-21T16:34:22Z. --- ### What Seven AGC fixtures create their own Vulkan instance and pick a device without reading `ANYPS5_GPU`: `PresentationPass`, `DepthPlaneGuestLayers`, `DepthStorage`, `DepthSurfaceLastWriter` and `PartiallyResidentSnapshot` take the first enumerated device, `OversizedDescriptorSets` the first discrete one, and `SparseBufferHoles` ranks by device type. On a machine with more than one Vulkan device, a run meant for one GPU can report results from another: #5271 reports `agc_driver_sparse_buffer_holes` logging the RTX with `ANYPS5_GPU=Radeon` on a machine with both. With a name that matches no device, all of them still pass on `main`. #6225, #7104, #7570, #7602 and #8167 fixed this one fixture at a time, each with its own copy of the selection. These seven now share one header, `tests/execution/FixtureDeviceSelection.hpp`, with the driver's rule from `VulkanDevice.cpp`: - among Vulkan 1.1 devices, the first whose name contains `ANYPS5_GPU`, ignoring case; - without a request, the first of the highest-ranked type (discrete, integrated, virtual, then the rest). A name that matches nothing throws `no Vulkan 1.1 device whose name contains ANYPS5_GPU="…"; devices: …`. The fixtures keep their existing handling of that: a skip, or a failure under `ANYPS5_REQUIRE_VULKAN`. A new CPU test, `agc_driver_fixture_device_selection`, covers the ranking, the name matching, `ANYPS5_GPU` itself and the error text. Two other fixtures read `ANYPS5_GPU` but match it case-sensitively: `PooledBufferRange` (#7104) and `NativeMultisampleDepth`. #10050 moves them onto this header. The other four that select their own device (`Recorder`, `PerformanceOverlay`, `SampledCacheBudget`, `BdaDevice`) already follow the driver's rule with their own copies, so this PR doesn't touch them. ### Tested Linux (Ubuntu 24.04, GCC 13.3), NVIDIA GeForce RTX 3050 Ti Laptop GPU (driver 580.178.04), on `main` cecb540a6 and on this PR. The 9 tests these fixtures run are `agc_driver_presentation_pass`, `agc_driver_depth_plane_guest_layers`, `agc_driver_depth_storage`, `agc_driver_depth_surface_last_writer`, `agc_driver_oversized_descriptor_sets`, `agc_driver_partially_resident_snapshot`, `agc_driver_partially_resident_pending_stores`, `agc_driver_large_tracked_snapshot` and `agc_driver_sparse_buffer_holes`. - With `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1` and `ANYPS5_REQUIRE_VULKAN=1` (`ctest -V`), all 9 pass on `main` and on this PR. The layer loads in both logs, and neither has a `VUID-` line. - With `ANYPS5_GPU="no such device 1d3d154f"` and `ANYPS5_REQUIRE_VULKAN=1`: - `main`: all 9 pass on the NVIDIA GPU. - This PR: all 9 fail with `no Vulkan 1.1 device whose name contains ANYPS5_GPU="no such device 1d3d154f"; devices: NVIDIA GeForce RTX 3050 Ti Laptop GPU`. - With `ANYPS5_GPU="geforce rtx"`, all 9 pass. - `agc_driver_fixture_device_selection` passes, and `tools/check_test_registration.py` passes on the build. This machine has one GPU, so the multi-device cases are covered only by the CPU test. ### Checklist - [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 3050 Ti Laptop GPU (driver 580.178.04), Ubuntu 24.04 - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!9253
No description provided.