test(agc): load the Vulkan loader with portability enumeration on macOS #7886

Merged
jotitadev merged 1 commit from upstream-pr/7886 into main 2026-10-24 16:36:44 +00:00
jotitadev commented 2026-10-19 12:25:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-19T12:25:28Z.


What

Nine AGC test fixtures create their own Vulkan instance instead of going through VulkanDevice: PresentationPass.cpp, PerformanceOverlay.cpp and, under tests/execution/, DepthPlaneGuestLayers.cpp, DepthStorage.cpp, DepthSurfaceLastWriter.cpp, NativeMultisampleDepth.cpp, PartiallyResidentSnapshot.cpp, PooledBufferRange.cpp and SparseBufferHoles.cpp. On macOS they load libvulkan.so.1, which doesn't exist there, so they print skipped, no usable Vulkan device: AGC graphics: cannot load Vulkan and ctest counts them as skipped. A libvulkan.so.1 symlink isn't enough: without VK_KHR_portability_enumeration the loader doesn't list MoltenVK and vkCreateInstance returns -9 (VK_ERROR_INCOMPATIBLE_DRIVER).

On __APPLE__ they now load libvulkan.1.dylib and create the instance with VK_KHR_portability_enumeration and VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR. This is the same change mugurc's macOS series makes to BdaDevice.cpp, Recorder.cpp, OversizedDescriptorSets.cpp and SampledCacheBudget.cpp (#1, branch ci/macos-series-2, commit 20ee39de9a). These nine fixtures aren't covered there, and the current head of #7332 doesn't cover them either. Windows and Linux are unchanged.

I noticed this while validating #6557: its new test case in NativeMultisampleDepth.cpp never ran on macOS.

Tested

Apple M2 Max, macOS 27.2, x86-64 build under Rosetta 2, Xcode 27. main doesn't build on macOS yet, so the tree is main a373e85e5 + mugurc's ci/macos-series-2 91e4eccaf + #6667, #6668, #7524 and #6969, + two files of #7332 (DirectMemory/Jit.cpp, tests/GuestMemoryLifetimeSupport.hpp), with this commit's diff applied cleanly on top. Drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0), and MoltenVK main + SPIRV-Cross #2704. Run with -j1 --timeout 30.

11 ctest entries use these fixtures. Before this change all 11 were skipped. With it:

test before after
agc_driver_presentation_pass skipped passes
agc_performance_overlay_device_selection skipped passes
agc_driver_depth_plane_guest_layers skipped passes
agc_driver_depth_storage skipped passes
agc_driver_depth_surface_last_writer skipped passes
agc_driver_native_multisample_depth skipped passes (8 cases checked, 4 unavailable: no 8x depth on this GPU)
agc_driver_partially_resident_snapshot skipped passes
agc_driver_partially_resident_pending_stores skipped passes
agc_driver_sparse_buffer_holes skipped passes
agc_performance_overlay skipped fails: the process's private memory cannot be read
agc_driver_pooled_buffer_range skipped fails: a robust read of word 28 of a 100-byte pooled buffer returned 0xabababab, the bytes a 256-byte earlier user left in its memory

Results are the same on both drivers, and 3 of 3 with --repeat until-fail:3 on MoltenVK 1.4.2.

The two failures were already there; the tests just weren't running:

  • agc_performance_overlay fails the same way agc_performance_overlay_statistics already fails on macOS. ReadProcessPrivateBytes reads /proc/self/status on every host that isn't Windows. Locally, reading task_info(TASK_VM_INFO).phys_footprint on macOS made it pass. #7332 already has that fix, so it is left out of this PR.
  • agc_driver_pooled_buffer_range: MoltenVK reports robustBufferAccess, but the read past the end of a 100-byte buffer still returns bytes from the pooled memory behind it. So the test catches the stale data on Apple. This is MoltenVK behaviour and isn't changed here.

python3 tools/check_conventions.py --base origin/main passes.

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 (only builds on macOS together with the macOS series, #1)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: Apple M2 Max (MoltenVK 1.4.2; MoltenVK main + SPIRV-Cross #2704), macOS 27.2
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4920893397 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7886). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-19T12:25:28Z. --- ### What Nine AGC test fixtures create their own Vulkan instance instead of going through `VulkanDevice`: `PresentationPass.cpp`, `PerformanceOverlay.cpp` and, under `tests/execution/`, `DepthPlaneGuestLayers.cpp`, `DepthStorage.cpp`, `DepthSurfaceLastWriter.cpp`, `NativeMultisampleDepth.cpp`, `PartiallyResidentSnapshot.cpp`, `PooledBufferRange.cpp` and `SparseBufferHoles.cpp`. On macOS they load `libvulkan.so.1`, which doesn't exist there, so they print `skipped, no usable Vulkan device: AGC graphics: cannot load Vulkan` and ctest counts them as skipped. A `libvulkan.so.1` symlink isn't enough: without `VK_KHR_portability_enumeration` the loader doesn't list MoltenVK and `vkCreateInstance` returns -9 (`VK_ERROR_INCOMPATIBLE_DRIVER`). On `__APPLE__` they now load `libvulkan.1.dylib` and create the instance with `VK_KHR_portability_enumeration` and `VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR`. This is the same change mugurc's macOS series makes to `BdaDevice.cpp`, `Recorder.cpp`, `OversizedDescriptorSets.cpp` and `SampledCacheBudget.cpp` (#1, branch `ci/macos-series-2`, commit 20ee39de9a). These nine fixtures aren't covered there, and the current head of #7332 doesn't cover them either. Windows and Linux are unchanged. I noticed this while validating #6557: its new test case in `NativeMultisampleDepth.cpp` never ran on macOS. ### Tested Apple M2 Max, macOS 27.2, x86-64 build under Rosetta 2, Xcode 27. `main` doesn't build on macOS yet, so the tree is `main` a373e85e5 + mugurc's `ci/macos-series-2` 91e4eccaf + #6667, #6668, #7524 and #6969, + two files of #7332 (`DirectMemory/Jit.cpp`, `tests/GuestMemoryLifetimeSupport.hpp`), with this commit's diff applied cleanly on top. Drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0), and MoltenVK main + SPIRV-Cross #2704. Run with `-j1 --timeout 30`. 11 ctest entries use these fixtures. Before this change all 11 were skipped. With it: | test | before | after | |---|---|---| | `agc_driver_presentation_pass` | skipped | passes | | `agc_performance_overlay_device_selection` | skipped | passes | | `agc_driver_depth_plane_guest_layers` | skipped | passes | | `agc_driver_depth_storage` | skipped | passes | | `agc_driver_depth_surface_last_writer` | skipped | passes | | `agc_driver_native_multisample_depth` | skipped | passes (8 cases checked, 4 unavailable: no 8x depth on this GPU) | | `agc_driver_partially_resident_snapshot` | skipped | passes | | `agc_driver_partially_resident_pending_stores` | skipped | passes | | `agc_driver_sparse_buffer_holes` | skipped | passes | | `agc_performance_overlay` | skipped | fails: `the process's private memory cannot be read` | | `agc_driver_pooled_buffer_range` | skipped | fails: `a robust read of word 28 of a 100-byte pooled buffer returned 0xabababab, the bytes a 256-byte earlier user left in its memory` | Results are the same on both drivers, and 3 of 3 with `--repeat until-fail:3` on MoltenVK 1.4.2. The two failures were already there; the tests just weren't running: - `agc_performance_overlay` fails the same way `agc_performance_overlay_statistics` already fails on macOS. `ReadProcessPrivateBytes` reads `/proc/self/status` on every host that isn't Windows. Locally, reading `task_info(TASK_VM_INFO).phys_footprint` on macOS made it pass. #7332 already has that fix, so it is left out of this PR. - `agc_driver_pooled_buffer_range`: MoltenVK reports `robustBufferAccess`, but the read past the end of a 100-byte buffer still returns bytes from the pooled memory behind it. So the test catches the stale data on Apple. This is MoltenVK behaviour and isn't changed here. `python3 tools/check_conventions.py --base origin/main` passes. ### 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 (only builds on macOS together with the macOS series, #1) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: Apple M2 Max (MoltenVK 1.4.2; MoltenVK main + SPIRV-Cross #2704), macOS 27.2 - [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!7886
No description provided.