test(agc): skip the MSAA retirement storage promotion without shaderStorageImageMultisample #8604

Merged
GiannisG1 merged 2 commits from upstream-pr/8604 into main 2026-11-01 06:46:35 +00:00
GiannisG1 commented 2026-10-20 18:09:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by GiannisG1 on 2026-10-20T18:09:08Z.


What

agc_driver_multisample_retirement fails on devices without shaderStorageImageMultisample:

AGC graphics: the device cannot write the multisampled color target's format as a storage image at its sample count

StorageRemap asks for a storage view of the 4x target, and MultisampleTarget.cpp:383 refuses it. The test checks only framebufferColorSampleCounts for 4x.

The idle, recorded and sampled remap cases still run on such a device. Only the storage promotion is skipped, and the test then returns 77, so ctest reports it as skipped rather than passed. The check is context.storageImageMultisample, the same feature PlaceholderImageShapeForDevice gates multisampled storage on.

The skip return comes after the storage case, not before it, so a case added later still runs on these devices. A case that needs a storage view goes inside the guard; one that doesn't goes between it and the skip. run.StorageSrgbTwin() and run.OrderRemap() skip their own cases on such a device, and run.StorageTwin() runs only with context.storageImageMultisample, so those lines stay as they are, in main's order. #9455 (merged) changed lines inside StorageRemap, which this PR doesn't touch.

Tested

Linux Mint 22.3, kernel 7.0.0-38, GCC 13.3.0, Release, BUILD_TESTING=ON, rebased on main 750cf6cf4. The PR changes only this test's source, so every other test binary is the same as main's.

agc_driver_multisample_retirement:

Device main 750cf6cf4 this PR, 3 runs
Intel HD Graphics 630, Mesa 25.2.8 (shaderStorageImageMultisample false) fails in 4 of 4 runs (3 full ctest -j4 runs, 1 alone) skipped 3/3; StorageSrgbTwin and OrderRemap skip their own cases
NVIDIA GTX 1050 Ti, 580.178.04 passes passes 3/3, all storage cases run
llvmpipe, Mesa 25.2.8 passes passes 3/3, all storage cases run

With VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (layers 1.3.275), ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, ctest -V: no was not found but was requested by env var VK_INSTANCE_LAYERS; VUIDs the same on main 750cf6cf4 and this PR (none on the HD 630, VUID-VkDeviceCreateInfo-pNext-pNext on the other two). tools/check_skips.py accepts the skip (exit 0 on each HD 630 run's JUnit file).

Independently confirmed on Windows with an Intel Arc (Meteor Lake) GPU without shaderStorageImageMultisample by @BKlaasWerkman (comment above, on an earlier base).

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: Intel HD Graphics 630 (Mesa 25.2.8 ANV), NVIDIA GeForce GTX 1050 Ti (580.178.04), llvmpipe (Mesa 25.2.8); Linux Mint 22.3, kernel 7.0.0-38
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4940227172 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8604). Originally posted by [GiannisG1](https://github.com/GiannisG1) on 2026-10-20T18:09:08Z. --- ### What `agc_driver_multisample_retirement` fails on devices without `shaderStorageImageMultisample`: ``` AGC graphics: the device cannot write the multisampled color target's format as a storage image at its sample count ``` `StorageRemap` asks for a storage view of the 4x target, and `MultisampleTarget.cpp:383` refuses it. The test checks only `framebufferColorSampleCounts` for 4x. The idle, recorded and sampled remap cases still run on such a device. Only the storage promotion is skipped, and the test then returns 77, so ctest reports it as skipped rather than passed. The check is `context.storageImageMultisample`, the same feature `PlaceholderImageShapeForDevice` gates multisampled storage on. The skip return comes after the storage case, not before it, so a case added later still runs on these devices. A case that needs a storage view goes inside the guard; one that doesn't goes between it and the skip. `run.StorageSrgbTwin()` and `run.OrderRemap()` skip their own cases on such a device, and `run.StorageTwin()` runs only with `context.storageImageMultisample`, so those lines stay as they are, in `main`'s order. #9455 (merged) changed lines inside `StorageRemap`, which this PR doesn't touch. ### Tested Linux Mint 22.3, kernel 7.0.0-38, GCC 13.3.0, Release, `BUILD_TESTING=ON`, rebased on `main` `750cf6cf4`. The PR changes only this test's source, so every other test binary is the same as `main`'s. `agc_driver_multisample_retirement`: | Device | `main` `750cf6cf4` | this PR, 3 runs | |---|---|---| | Intel HD Graphics 630, Mesa 25.2.8 (`shaderStorageImageMultisample` false) | fails in 4 of 4 runs (3 full `ctest -j4` runs, 1 alone) | skipped 3/3; `StorageSrgbTwin` and `OrderRemap` skip their own cases | | NVIDIA GTX 1050 Ti, 580.178.04 | passes | passes 3/3, all storage cases run | | llvmpipe, Mesa 25.2.8 | passes | passes 3/3, all storage cases run | With `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (layers 1.3.275), `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`, `ctest -V`: no `was not found but was requested by env var VK_INSTANCE_LAYERS`; VUIDs the same on `main` `750cf6cf4` and this PR (none on the HD 630, `VUID-VkDeviceCreateInfo-pNext-pNext` on the other two). `tools/check_skips.py` accepts the skip (exit 0 on each HD 630 run's JUnit file). Independently confirmed on Windows with an Intel Arc (Meteor Lake) GPU without `shaderStorageImageMultisample` by @BKlaasWerkman (comment above, on an earlier base). ### 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: Intel HD Graphics 630 (Mesa 25.2.8 ANV), NVIDIA GeForce GTX 1050 Ti (580.178.04), llvmpipe (Mesa 25.2.8); Linux Mint 22.3, kernel 7.0.0-38 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
oneandonlydean commented 2026-10-20 18:13:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T18:13:40Z.


The skip line doesn't match tools/check_skips.py's DEVICE_LIMITATION pattern, which needs skipped, (with the comma) before the device reason on the same line. "skipped the storage promotion, the device has no shaderStorageImageMultisample" has no skipped,, so a Linux CI job on a device without the feature would fail the skip check even though ctest reports 77. Reordering the words is enough, for example:

std::puts("storage promotion skipped, the device has no shaderStorageImageMultisample");

(Checked against main's pattern: the current text doesn't match, and this one does.) Everything else looks right to me: the skip comes after the three cases that still run, and the gate is the same storageImageMultisample that MultisampleTarget.cpp:258 refuses on.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6297870453 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8604#issuecomment-6297870453). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T18:13:40Z. --- The skip line doesn't match `tools/check_skips.py`'s `DEVICE_LIMITATION` pattern, which needs `skipped,` (with the comma) before the device reason on the same line. "skipped the storage promotion, the device has no shaderStorageImageMultisample" has no `skipped,`, so a Linux CI job on a device without the feature would fail the skip check even though ctest reports 77. Reordering the words is enough, for example: ```cpp std::puts("storage promotion skipped, the device has no shaderStorageImageMultisample"); ``` (Checked against main's pattern: the current text doesn't match, and this one does.) Everything else looks right to me: the skip comes after the three cases that still run, and the gate is the same `storageImageMultisample` that `MultisampleTarget.cpp:258` refuses on.
GiannisG1 commented 2026-10-20 20:40:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by GiannisG1 on 2026-10-20T20:40:22Z.


Thanks, you're right. With the old text, tools/check_skips.py exits 1 on the JUnit file from an HD 630 run; with yours it exits 0. Changed in cdf6c2857, as a separate commit so the change is easy to see (happy to squash).

Rerun after the change: skipped 3/3 on the HD 630, passed 3/3 on the GTX 1050 Ti and llvmpipe with the storage case running.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6300993631 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8604#issuecomment-6300993631). Originally posted by [GiannisG1](https://github.com/GiannisG1) on 2026-10-20T20:40:22Z. --- Thanks, you're right. With the old text, `tools/check_skips.py` exits 1 on the JUnit file from an HD 630 run; with yours it exits 0. Changed in cdf6c2857, as a separate commit so the change is easy to see (happy to squash). Rerun after the change: skipped 3/3 on the HD 630, passed 3/3 on the GTX 1050 Ti and llvmpipe with the storage case running.
jotitadev commented 2026-10-21 22:34:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-21T22:34:05Z.

Review: COMMENTED


This guard covers the feature-absent case (no shaderStorageImageMultisample, the "the device cannot write the multisampled color target's format as a storage image at its sample count" throw). There is a sibling failure it does not cover: a device that has shaderStorageImageMultisample but whose MSAA color target is born storable.

On a device with programmable sample locations but only a 1x1 location grid, MayReorderSamples is true, so MultisampleTarget creates the 4x color target with VK_IMAGE_USAGE_STORAGE_BIT from the start (to write the guest's sample order back). MultisampleTargetStorageView then returns that already-storable image, makeStorable is a no-op, the owner's generation does not change, and StorageRemap fails its promoted.generation != old.generation assertion:

AGC graphics: MSAA storage promotion did not retain its source image

context.storageImageMultisample is true on such a device, so const bool storage = context.storageImageMultisample; if (storage) run.StorageRemap(); still runs StorageRemap and the test still fails. OrderRemap already handles exactly this device: its own guard is MayReorderSamples && SampleOrderStorageFormat != VK_FORMAT_UNDEFINED, which is the born-storable condition. Guarding the storage-promotion case the same way (in addition to the feature guard here) would skip it on born-storable devices too, where there is no promotion to retire.

This is Mesa-dependent, which is why your llvmpipe run (Mesa 25.2.8) passed: on Mesa 26.0.3 lavapipe advertises a 1x1 sample-location grid at every count and the target is born storable, so it fails on main and with this PR applied.

Tested

Ubuntu 26.04, i7-8700, Release, BUILD_TESTING=ON, ANYPS5_NO_SHADER_CACHE=1, device selected with VK_ICD_FILENAMES, run as ./agc_driver_multisample_retirement_tests. I applied this PR's change to agc_driver_multisample_retirement on top of current main a6dcea927.

agc_driver_multisample_retirement NVIDIA RTX 3070 (595.99.02) lavapipe (Mesa 26.0.3, LLVM 21.1.8)
main a6dcea927 pass 3/3 fail 3/3 (MSAA storage promotion did not retain its source image)
this PR on a6dcea927 pass 3/3 (storage case runs) fail 3/3 (same assertion; storageImageMultisample is true, so StorageRemap still runs)

Driver log confirms the mechanism:

  • NVIDIA: 4 samples 2x2 → MayReorderSamples false → target born color-only → StorageRemap promotes and passes.
  • lavapipe: 4 samples 1x1, 8 samples 1x1 → MayReorderSamples true → target born storable → makeStorable is a no-op → StorageRemap assertion fails.

GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux) and lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5607052081 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8604#pullrequestreview-5607052081). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-21T22:34:05Z. **Review:** COMMENTED --- This guard covers the feature-absent case (no `shaderStorageImageMultisample`, the "the device cannot write the multisampled color target's format as a storage image at its sample count" throw). There is a sibling failure it does not cover: a device that *has* `shaderStorageImageMultisample` but whose MSAA color target is *born storable*. On a device with programmable sample locations but only a 1x1 location grid, `MayReorderSamples` is true, so `MultisampleTarget` creates the 4x color target with `VK_IMAGE_USAGE_STORAGE_BIT` from the start (to write the guest's sample order back). `MultisampleTargetStorageView` then returns that already-storable image, `makeStorable` is a no-op, the owner's generation does not change, and `StorageRemap` fails its `promoted.generation != old.generation` assertion: ``` AGC graphics: MSAA storage promotion did not retain its source image ``` `context.storageImageMultisample` is true on such a device, so `const bool storage = context.storageImageMultisample; if (storage) run.StorageRemap();` still runs `StorageRemap` and the test still fails. `OrderRemap` already handles exactly this device: its own guard is `MayReorderSamples && SampleOrderStorageFormat != VK_FORMAT_UNDEFINED`, which is the born-storable condition. Guarding the storage-promotion case the same way (in addition to the feature guard here) would skip it on born-storable devices too, where there is no promotion to retire. This is Mesa-dependent, which is why your llvmpipe run (Mesa 25.2.8) passed: on Mesa 26.0.3 lavapipe advertises a 1x1 sample-location grid at every count and the target is born storable, so it fails on `main` and with this PR applied. ### Tested Ubuntu 26.04, i7-8700, Release, `BUILD_TESTING=ON`, `ANYPS5_NO_SHADER_CACHE=1`, device selected with `VK_ICD_FILENAMES`, run as `./agc_driver_multisample_retirement_tests`. I applied this PR's change to `agc_driver_multisample_retirement` on top of current `main` `a6dcea927`. | `agc_driver_multisample_retirement` | NVIDIA RTX 3070 (595.99.02) | lavapipe (Mesa 26.0.3, LLVM 21.1.8) | |---|---|---| | `main` `a6dcea927` | pass 3/3 | **fail 3/3** (`MSAA storage promotion did not retain its source image`) | | this PR on `a6dcea927` | pass 3/3 (storage case runs) | **fail 3/3** (same assertion; `storageImageMultisample` is true, so `StorageRemap` still runs) | Driver log confirms the mechanism: - NVIDIA: `4 samples 2x2` → `MayReorderSamples` false → target born color-only → `StorageRemap` promotes and passes. - lavapipe: `4 samples 1x1, 8 samples 1x1` → `MayReorderSamples` true → target born storable → `makeStorable` is a no-op → `StorageRemap` assertion fails. GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux) and lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
GiannisG1 commented 2026-10-22 11:42:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by GiannisG1 on 2026-10-22T11:42:25Z.


Thanks, confirmed in the code on main 4777caca3: with MayReorderSamples and a sample-order storage format the target gets VK_IMAGE_USAGE_STORAGE_BIT at creation (MultisampleTarget.cpp:89-91), makeStorable returns early (:192), so the generation doesn't change and MultisampleRetirement.cpp:478 fails.

#9455 covers that case separately, which keeps each PR to one device condition, and the two merge cleanly. With both applied I ran the test on the three devices I have; results are on #9455, where the HD 630 is the 1x1-grid device without shaderStorageImageMultisample that its description lists as not run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6339882498 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8604#issuecomment-6339882498). Originally posted by [GiannisG1](https://github.com/GiannisG1) on 2026-10-22T11:42:25Z. --- Thanks, confirmed in the code on `main` `4777caca3`: with `MayReorderSamples` and a sample-order storage format the target gets `VK_IMAGE_USAGE_STORAGE_BIT` at creation (`MultisampleTarget.cpp:89-91`), `makeStorable` returns early (`:192`), so the generation doesn't change and `MultisampleRetirement.cpp:478` fails. #9455 covers that case separately, which keeps each PR to one device condition, and the two merge cleanly. With both applied I ran the test on the three devices I have; results are on #9455, where the HD 630 is the 1x1-grid device without `shaderStorageImageMultisample` that its description lists as not run.
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!8604
No description provided.