Skip to content

test(agc): skip the MSAA storage-promotion remap on sample-order devices - #9455

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
jotitadev:fix/agc-multisample-storage-remap-reorderable-skip
Oct 27, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
jotitadev:fix/agc-multisample-storage-remap-reorderable-skip

Conversation

@jotitadev

@jotitadev jotitadev commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

agc_driver_multisample_retirement fails deterministically on some devices with MSAA storage promotion did not retain its source image (MultisampleRetirement.cpp, in StorageRemap). This happens on a device with programmable sample locations but only a 1x1 location grid (for example lavapipe): MayReorderSamples is true there, so the driver creates the multisampled color target with storage usage from the start to write the guest's sample order back. MultisampleTargetStorageView then returns that already-storable image and makeStorable is a no-op, so storage access does not allocate a new image and the owner's generation does not change. StorageRemap asserted the opposite (promoted.generation != old.generation), which only holds when the target is not born storable.

The fix skips StorageRemap on exactly those devices, mirroring OrderRemap, which uses the same MayReorderSamples && SampleOrderStorageFormat != VK_FORMAT_UNDEFINED condition and already runs only there. No coverage is lost: the born-storable target's retirement lifetime is covered by OrderRemap on those devices, and StorageRemap still exercises the promotion path (a storable image allocated on first storage access, retiring the color-only owner) on every device whose MSAA targets are not born storable — for example NVIDIA, whose 4x sample-location grid is 2x2, so MayReorderSamples is false and the target is created color-only.

StorageTwin (added to main in 4375cf06a, fix(agc): resolve and render a multisampled target through its sRGB twin format) makes the same assumption: it requires the storage view to be a new image (MSAA storage promotion kept the rendered image). On the same born-storable devices it now fails there once StorageRemap is skipped. The second commit makes that check expect the same image when the target is born storable (same condition), and a new image everywhere else; the twin-view checks of that case still run on every device.

Tested

This branch rebased onto main a8bc4474c (2026-10-27); the main and first-commit-only arms were run on main 4297464b1, which has the same MultisampleRetirement.cpp and MultisampleTarget.cpp. Ubuntu 26.04, GCC 15.2, Release, same command and the three variables, layer 1.4.341, RTX 3070 (595.99.02) and lavapipe (Mesa 26.0.3), 3 runs each:

agc_driver_multisample_retirement RTX 3070 lavapipe
main (4297464b1) pass fail MSAA storage promotion did not retain its source image (StorageRemap)
first commit only (eb6f3f94e) pass fail MSAA storage promotion kept the rendered image (StorageTwin)
this branch pass pass, StorageRemap skipped, StorageTwin runs

0 VUID- in every run, no missing-layer message. Both devices run StorageTwin (both have shaderStorageImageMultisample).

The runs below are from before StorageTwin existed:

Ubuntu 26.04, i7-8700, GCC 15.2, Release, BUILD_TESTING=ON. Run as ctest --test-dir build -R ^agc_driver_multisample_retirement -V -j1 --timeout 30 with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (layer 1.4.341, Ubuntu vulkan-validationlayers 1.4.341.0-1), on origin/main d6eafa54d and with this change applied on the same checkout. Two devices on the same host, selected with VK_ICD_FILENAMES: NVIDIA GeForce RTX 3070 (driver 595.99.02) and lavapipe (Mesa 26.0.3, LLVM 21.1.8).

agc_driver_multisample_retirement RTX 3070 lavapipe
main pass, 0 VUID- fail (MSAA storage promotion did not retain its source image), 0 VUID-
this change pass, 0 VUID- pass (StorageRemap skipped: "...born storable with no promotion to retire..."), 0 VUID-

No log reports was not found but was requested by env var VK_INSTANCE_LAYERS; VK_LOADER_DEBUG=layer confirms the validation layer is inserted at instance and device level on both devices. No VUID- message on main or with this change, so no new VUID-. Full logs are in the review thread.

The earlier runs on a6dcea927 with ANYPS5_NO_SHADER_CACHE=1 gave the same pass/fail table (RTX 3070 2/2 pass both ways; lavapipe 3/3 fail on main, 3/3 pass with this change).

The driver log confirms the mechanism: NVIDIA reports a 2x2 largest sample-location grid at 4 samples (so StorageRemap runs and the promotion allocates a new image), lavapipe reports 1x1 at 4 samples (so the target is born storable and StorageRemap is skipped).

Apple M2 Max (macOS 27.2, x86-64 under Rosetta, on #8658 564e005acb because main does not link on macOS), same command and the three variables, layer 1.4.363 from the LunarG SDK, MoltenVK 1.4.2 and MoltenVK main + SPIRV-Cross #2704: fails identically on the base and with this change (the device cannot write the multisampled color target's format as a storage image at its sample count), only the pre-existing VUID-VkDeviceCreateInfo-pProperties-04451 (portability subset) on both, no new VUID-. MoltenVK has a 1x1 grid but no shaderStorageImageMultisample, so this change's condition is false and StorageRemap throws; that is the case #8604 skips. Logs in the review thread.

Not run: Windows, the full agc suite rebuild.

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
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux) and lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04; Apple M2 Max (MoltenVK 1.4.2 and main, macOS 27.2)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The focused before/after reproduction is useful, but this test is under libSceAgcDriver, and the repository rule requires the same focused test on main and this change with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Please attach both logs, confirm neither reports the requested layer missing, and compare for new VUID- messages. The current report mentions only ANYPS5_NO_SHADER_CACHE=1, so I am holding approval until that required validation evidence is recorded. Hosted full Linux/Windows jobs were skipped; I did not run the Vulkan test locally.

@jotitadev

Copy link
Copy Markdown
Contributor Author

Ran the required validation-layer comparison for agc_driver_multisample_retirement.

  • Machine: Ubuntu 26.04, i7-8700, GCC 15.2, Release, BUILD_TESTING=ON
  • main: d6eafa54d (current main). Change: PR head eb6f3f94e diff applied on the same d6eafa54d checkout (the diff is test-only and applies cleanly; no rebase needed)
  • Devices on the same host, selected with VK_ICD_FILENAMES: NVIDIA GeForce RTX 3070 (595.99.02) and lavapipe (Mesa 26.0.3, LLVM 21.1.8)
  • Layer: VK_LAYER_KHRONOS_validation 1.4.341 (Ubuntu vulkan-validationlayers 1.4.341.0-1, unpacked and added with VK_ADD_LAYER_PATH)
  • Command, identical for all four runs:
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
VK_ADD_LAYER_PATH=$HOME/vvl/layer VK_ICD_FILENAMES=<nvidia_icd.json|lvp_icd.json> \
ctest --test-dir build -R ^agc_driver_multisample_retirement -V -j1 --timeout 30
RTX 3070 lavapipe
main Passed, 0 VUID- Failed (MSAA storage promotion did not retain its source image), 0 VUID-
this change Passed, 0 VUID- Passed (StorageRemap skipped), 0 VUID-
  • None of the four logs contains was not found but was requested by env var VK_INSTANCE_LAYERS.
  • The layer is loaded on both devices: a second run of each case with VK_LOADER_DEBUG=layer shows Insert instance layer "VK_LAYER_KHRONOS_validation" and Inserted device layer "VK_LAYER_KHRONOS_validation". The codebase registers no debug messenger, so the layer reports to stdout with its default callback.
  • VUID- messages: none on main, none with this change, on either device, so no new VUID-. On lavapipe main stops at the failing StorageRemap check, so the subtests after it run only with this change, and they also log no VUID-.
Log: main, RTX 3070
# head: d6eafa54d0464258574fd2f71889754d05a5bc93 (main)
# diff vs origin/main:
# env: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_ADD_LAYER_PATH=/home/jota/vvl/layer VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json
# cmd: ctest --test-dir build -R ^agc_driver_multisample_retirement -V -j1 --timeout 30
UpdateCTestConfiguration  from :/home/jota/anyps5-9455/build/DartConfiguration.tcl
Test project /home/jota/anyps5-9455/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 730
    Start 730: agc_driver_multisample_retirement

730: Test command: /home/jota/anyps5-9455/build/tests/agc_driver_multisample_retirement_tests
730: Working Directory: /home/jota/anyps5-9455
730: Environment variables: 
730:  ANYPS5_NO_SHADER_CACHE=1
730:  APS5_NO_PIPELINE_JOURNAL=1
730: Test timeout computed to be: 30
730: [src/HostCpu.cpp:193 operator()] host CPU Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz: has SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, LZCNT, BMI1, BMI2, MOVBE, CMPXCHG16B, LAHF/SAHF, AVX, AVX2, FMA, F16C, AES, PCLMULQDQ, RDRAND, RDSEED, ADX, CLFLUSHOPT, XSAVEOPT, XSAVEC, PREFETCHW, OS AVX state (XCR0); lacks SHA, CLWB, RDPID, SSE4A, CLZERO
730: [src/VulkanDevice.cpp:1013 VulkanDevice] VulkanDevice constructor window=(nil)
730: [src/VulkanDevice.cpp:1022 VulkanDevice] Vulkan loader loaded library=0x5c470f868010
730: [src/VulkanDevice.cpp:1060 VulkanDevice] Vulkan instance created instance=0x5c470f869000
730: [src/VulkanDevice.cpp:1071 VulkanDevice] Physical device count=1
730: [src/VulkanDevice.cpp:1104 VulkanDevice] Physical device candidate=0x5c4710101970 name=NVIDIA GeForce RTX 3070 api=0x404149 type=2
730: [src/VulkanDevice.cpp:1151 VulkanDevice] Physical device selected physical=0x5c4710101970 queueFamily=0
730: [src/VulkanDevice.cpp:1165 VulkanDevice] Selected GPU name=NVIDIA GeForce RTX 3070 vendor=0x10de device=0x2484 subgroup=32
730: [src/VulkanDevice.cpp:1167 VulkanDevice] Memory heap 0 size=8192.0 MiB flags=0x1
730: [src/VulkanDevice.cpp:1167 VulkanDevice] Memory heap 1 size=23061.5 MiB flags=0x0
730: [src/VulkanDevice.cpp:1167 VulkanDevice] Memory heap 2 size=246.0 MiB flags=0x1
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 0 heap=1 flags=0x0
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 1 heap=0 flags=0x1
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 2 heap=0 flags=0x1
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 3 heap=1 flags=0x6
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 4 heap=1 flags=0xe
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 5 heap=2 flags=0x7
730: [src/VulkanDevice.cpp:1241 VulkanDevice] Shader clock driver=4 narrowSubgroupClock=0
730: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 1 samples 4x4, 2 samples 2x4, 4 samples 2x2, 8 samples 1x2; maxSampleLocationGridSize for every count 1x1
730: [src/VulkanDevice.cpp:1624 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
730: [src/VulkanDevice.cpp:1892 VulkanDevice] Wave32 programs run on subgroups of 32: compute 1, mesh 1
730: [src/VulkanDevice.cpp:2003 VulkanDevice] Vulkan device ready device=0x5c471024ef00 queue=0x5c47103dace0 family=0
730: [write-watch] host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import); imported ranges stay watched
730: 32 idle MSAA remaps: created=32 destroyed=31 live=1
730: retired MSAA allocations stay bounded, recorded clears and storage promotions retain their images, sampled aliases release their parents after the last batch, and sample-order targets keep their retired images until their batch completes
1/1 Test #730: agc_driver_multisample_retirement ...   Passed    0.32 sec

The following tests passed:
	agc_driver_multisample_retirement

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.35 sec
# ctest rc=0
Log: this change, RTX 3070
# head: d6eafa54d0464258574fd2f71889754d05a5bc93 (pr)
# diff vs origin/main:
 .../prx/libSceAgcDriver/tests/execution/MultisampleRetirement.cpp     | 4 ++++
 1 file changed, 4 insertions(+)
# env: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_ADD_LAYER_PATH=/home/jota/vvl/layer VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json
# cmd: ctest --test-dir build -R ^agc_driver_multisample_retirement -V -j1 --timeout 30
UpdateCTestConfiguration  from :/home/jota/anyps5-9455/build/DartConfiguration.tcl
Test project /home/jota/anyps5-9455/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 730
    Start 730: agc_driver_multisample_retirement

730: Test command: /home/jota/anyps5-9455/build/tests/agc_driver_multisample_retirement_tests
730: Working Directory: /home/jota/anyps5-9455
730: Environment variables: 
730:  ANYPS5_NO_SHADER_CACHE=1
730:  APS5_NO_PIPELINE_JOURNAL=1
730: Test timeout computed to be: 30
730: [src/HostCpu.cpp:193 operator()] host CPU Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz: has SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, LZCNT, BMI1, BMI2, MOVBE, CMPXCHG16B, LAHF/SAHF, AVX, AVX2, FMA, F16C, AES, PCLMULQDQ, RDRAND, RDSEED, ADX, CLFLUSHOPT, XSAVEOPT, XSAVEC, PREFETCHW, OS AVX state (XCR0); lacks SHA, CLWB, RDPID, SSE4A, CLZERO
730: [src/VulkanDevice.cpp:1013 VulkanDevice] VulkanDevice constructor window=(nil)
730: [src/VulkanDevice.cpp:1022 VulkanDevice] Vulkan loader loaded library=0x5f34322e8010
730: [src/VulkanDevice.cpp:1060 VulkanDevice] Vulkan instance created instance=0x5f34322e9000
730: [src/VulkanDevice.cpp:1071 VulkanDevice] Physical device count=1
730: [src/VulkanDevice.cpp:1104 VulkanDevice] Physical device candidate=0x5f3432b81d80 name=NVIDIA GeForce RTX 3070 api=0x404149 type=2
730: [src/VulkanDevice.cpp:1151 VulkanDevice] Physical device selected physical=0x5f3432b81d80 queueFamily=0
730: [src/VulkanDevice.cpp:1165 VulkanDevice] Selected GPU name=NVIDIA GeForce RTX 3070 vendor=0x10de device=0x2484 subgroup=32
730: [src/VulkanDevice.cpp:1167 VulkanDevice] Memory heap 0 size=8192.0 MiB flags=0x1
730: [src/VulkanDevice.cpp:1167 VulkanDevice] Memory heap 1 size=23061.5 MiB flags=0x0
730: [src/VulkanDevice.cpp:1167 VulkanDevice] Memory heap 2 size=246.0 MiB flags=0x1
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 0 heap=1 flags=0x0
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 1 heap=0 flags=0x1
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 2 heap=0 flags=0x1
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 3 heap=1 flags=0x6
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 4 heap=1 flags=0xe
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 5 heap=2 flags=0x7
730: [src/VulkanDevice.cpp:1241 VulkanDevice] Shader clock driver=4 narrowSubgroupClock=0
730: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 1 samples 4x4, 2 samples 2x4, 4 samples 2x2, 8 samples 1x2; maxSampleLocationGridSize for every count 1x1
730: [src/VulkanDevice.cpp:1624 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
730: [src/VulkanDevice.cpp:1892 VulkanDevice] Wave32 programs run on subgroups of 32: compute 1, mesh 1
730: [src/VulkanDevice.cpp:2003 VulkanDevice] Vulkan device ready device=0x5f3432ccf2c0 queue=0x5f3432e5e9b0 family=0
730: [write-watch] host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import); imported ranges stay watched
730: 32 idle MSAA remaps: created=32 destroyed=31 live=1
730: retired MSAA allocations stay bounded, recorded clears and storage promotions retain their images, sampled aliases release their parents after the last batch, and sample-order targets keep their retired images until their batch completes
1/1 Test #730: agc_driver_multisample_retirement ...   Passed    0.41 sec

The following tests passed:
	agc_driver_multisample_retirement

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.44 sec
# ctest rc=0
Log: main, lavapipe
# head: d6eafa54d0464258574fd2f71889754d05a5bc93 (main)
# diff vs origin/main:
# env: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_ADD_LAYER_PATH=/home/jota/vvl/layer VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.json
# cmd: ctest --test-dir build -R ^agc_driver_multisample_retirement -V -j1 --timeout 30
UpdateCTestConfiguration  from :/home/jota/anyps5-9455/build/DartConfiguration.tcl
Test project /home/jota/anyps5-9455/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 730
    Start 730: agc_driver_multisample_retirement

730: Test command: /home/jota/anyps5-9455/build/tests/agc_driver_multisample_retirement_tests
730: Working Directory: /home/jota/anyps5-9455
730: Environment variables: 
730:  ANYPS5_NO_SHADER_CACHE=1
730:  APS5_NO_PIPELINE_JOURNAL=1
730: Test timeout computed to be: 30
730: [src/HostCpu.cpp:193 operator()] host CPU Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz: has SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, LZCNT, BMI1, BMI2, MOVBE, CMPXCHG16B, LAHF/SAHF, AVX, AVX2, FMA, F16C, AES, PCLMULQDQ, RDRAND, RDSEED, ADX, CLFLUSHOPT, XSAVEOPT, XSAVEC, PREFETCHW, OS AVX state (XCR0); lacks SHA, CLWB, RDPID, SSE4A, CLZERO
730: [src/VulkanDevice.cpp:1013 VulkanDevice] VulkanDevice constructor window=(nil)
730: [src/VulkanDevice.cpp:1022 VulkanDevice] Vulkan loader loaded library=0x5cf0c153a010
730: [src/VulkanDevice.cpp:1060 VulkanDevice] Vulkan instance created instance=0x5cf0c153b000
730: [src/VulkanDevice.cpp:1071 VulkanDevice] Physical device count=1
730: [src/VulkanDevice.cpp:1104 VulkanDevice] Physical device candidate=0x5cf0c15f8af0 name=llvmpipe (LLVM 21.1.8, 256 bits) api=0x40414f type=4
730: [src/VulkanDevice.cpp:1151 VulkanDevice] Physical device selected physical=0x5cf0c15f8af0 queueFamily=0
730: [src/VulkanDevice.cpp:1165 VulkanDevice] Selected GPU name=llvmpipe (LLVM 21.1.8, 256 bits) vendor=0x10005 device=0x0 subgroup=8
730: [src/VulkanDevice.cpp:1167 VulkanDevice] Memory heap 0 size=30748.7 MiB flags=0x1
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 0 heap=0 flags=0xf
730: [src/VulkanDevice.cpp:1241 VulkanDevice] Shader clock driver=13 narrowSubgroupClock=0
730: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 4 samples 1x1, 8 samples 1x1; maxSampleLocationGridSize for every count 1x1
730: [src/VulkanDevice.cpp:1624 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
730: [src/VulkanDevice.cpp:2003 VulkanDevice] Vulkan device ready device=0x5cf0c16561b0 queue=0x5cf0c1657948 family=0
730: [write-watch] host imports resolve write protection: yes (0 of 4 scratch pages written after a GPU read, 4 after a GPU write, 0 after the import); imported ranges are compared
730: [write-watch] dma-buf imports keep write protection: yes (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 0 after the import, 1 seen after a CPU store); imported ranges stay watched
730: 32 idle MSAA remaps: created=32 destroyed=31 live=1
730: AGC graphics: MSAA storage promotion did not retain its source image
1/1 Test #730: agc_driver_multisample_retirement ...***Failed    0.07 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.10 sec

The following tests FAILED:
	730 - agc_driver_multisample_retirement (Failed)
Errors while running CTest
Output from these tests are in: /home/jota/anyps5-9455/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
# ctest rc=8
Log: this change, lavapipe
# head: d6eafa54d0464258574fd2f71889754d05a5bc93 (pr)
# diff vs origin/main:
 .../prx/libSceAgcDriver/tests/execution/MultisampleRetirement.cpp     | 4 ++++
 1 file changed, 4 insertions(+)
# env: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_ADD_LAYER_PATH=/home/jota/vvl/layer VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.json
# cmd: ctest --test-dir build -R ^agc_driver_multisample_retirement -V -j1 --timeout 30
UpdateCTestConfiguration  from :/home/jota/anyps5-9455/build/DartConfiguration.tcl
Test project /home/jota/anyps5-9455/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 730
    Start 730: agc_driver_multisample_retirement

730: Test command: /home/jota/anyps5-9455/build/tests/agc_driver_multisample_retirement_tests
730: Working Directory: /home/jota/anyps5-9455
730: Environment variables: 
730:  ANYPS5_NO_SHADER_CACHE=1
730:  APS5_NO_PIPELINE_JOURNAL=1
730: Test timeout computed to be: 30
730: [src/HostCpu.cpp:193 operator()] host CPU Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz: has SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, LZCNT, BMI1, BMI2, MOVBE, CMPXCHG16B, LAHF/SAHF, AVX, AVX2, FMA, F16C, AES, PCLMULQDQ, RDRAND, RDSEED, ADX, CLFLUSHOPT, XSAVEOPT, XSAVEC, PREFETCHW, OS AVX state (XCR0); lacks SHA, CLWB, RDPID, SSE4A, CLZERO
730: [src/VulkanDevice.cpp:1013 VulkanDevice] VulkanDevice constructor window=(nil)
730: [src/VulkanDevice.cpp:1022 VulkanDevice] Vulkan loader loaded library=0x5f79e7bcb010
730: [src/VulkanDevice.cpp:1060 VulkanDevice] Vulkan instance created instance=0x5f79e7bcc000
730: [src/VulkanDevice.cpp:1071 VulkanDevice] Physical device count=1
730: [src/VulkanDevice.cpp:1104 VulkanDevice] Physical device candidate=0x5f79e7c89af0 name=llvmpipe (LLVM 21.1.8, 256 bits) api=0x40414f type=4
730: [src/VulkanDevice.cpp:1151 VulkanDevice] Physical device selected physical=0x5f79e7c89af0 queueFamily=0
730: [src/VulkanDevice.cpp:1165 VulkanDevice] Selected GPU name=llvmpipe (LLVM 21.1.8, 256 bits) vendor=0x10005 device=0x0 subgroup=8
730: [src/VulkanDevice.cpp:1167 VulkanDevice] Memory heap 0 size=30748.7 MiB flags=0x1
730: [src/VulkanDevice.cpp:1168 VulkanDevice] Memory type 0 heap=0 flags=0xf
730: [src/VulkanDevice.cpp:1241 VulkanDevice] Shader clock driver=13 narrowSubgroupClock=0
730: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 4 samples 1x1, 8 samples 1x1; maxSampleLocationGridSize for every count 1x1
730: [src/VulkanDevice.cpp:1624 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
730: [src/VulkanDevice.cpp:2003 VulkanDevice] Vulkan device ready device=0x5f79e7ce71b0 queue=0x5f79e7ce8948 family=0
730: [write-watch] host imports resolve write protection: yes (0 of 4 scratch pages written after a GPU read, 4 after a GPU write, 0 after the import); imported ranges are compared
730: [write-watch] dma-buf imports keep write protection: yes (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 0 after the import, 1 seen after a CPU store); imported ranges stay watched
730: 32 idle MSAA remaps: created=32 destroyed=31 live=1
730: the device stores a multisampled color target in the guest sample order, so it is born storable with no promotion to retire; the MSAA storage-promotion remap is skipped
730: retired MSAA allocations stay bounded, recorded clears and storage promotions retain their images, sampled aliases release their parents after the last batch, and sample-order targets keep their retired images until their batch completes
1/1 Test #730: agc_driver_multisample_retirement ...   Passed    0.07 sec

The following tests passed:
	agc_driver_multisample_retirement

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.09 sec
# ctest rc=0
Layer insertion (VK_LOADER_DEBUG=layer, same command)
--- main-nv
[Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_KHRONOS_validation" (/home/jota/vvl/root/usr/lib/x86_64-linux-gnu/libVkLayer_khronos_validation.so)
[Vulkan Loader] INFO | LAYER:   Inserted device layer "VK_LAYER_KHRONOS_validation" (/home/jota/vvl/root/usr/lib/x86_64-linux-gnu/libVkLayer_khronos_validation.so)
--- pr-nv
[Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_KHRONOS_validation" (/home/jota/vvl/root/usr/lib/x86_64-linux-gnu/libVkLayer_khronos_validation.so)
[Vulkan Loader] INFO | LAYER:   Inserted device layer "VK_LAYER_KHRONOS_validation" (/home/jota/vvl/root/usr/lib/x86_64-linux-gnu/libVkLayer_khronos_validation.so)
--- main-lvp
[Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_KHRONOS_validation" (/home/jota/vvl/root/usr/lib/x86_64-linux-gnu/libVkLayer_khronos_validation.so)
[Vulkan Loader] INFO | LAYER:   Inserted device layer "VK_LAYER_KHRONOS_validation" (/home/jota/vvl/root/usr/lib/x86_64-linux-gnu/libVkLayer_khronos_validation.so)
--- pr-lvp
[Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_KHRONOS_validation" (/home/jota/vvl/root/usr/lib/x86_64-linux-gnu/libVkLayer_khronos_validation.so)
[Vulkan Loader] INFO | LAYER:   Inserted device layer "VK_LAYER_KHRONOS_validation" (/home/jota/vvl/root/usr/lib/x86_64-linux-gnu/libVkLayer_khronos_validation.so)

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

@github-actions github-actions Bot added the agc libSceAgc* label Oct 22, 2026
@GiannisG1

Copy link
Copy Markdown
Contributor

Ran agc_driver_multisample_retirement with this PR (eb6f3f94e) and #8604 (0089f4f63) merged together (clean), Linux Mint 22.3, GCC 13.3, Release, 3 runs each:

Device Sample-location grid in the driver log shaderStorageImageMultisample Result
Intel HD 630, Mesa 25.2.8 ANV 1x1 at 2, 4 and 8 samples false skipped 3/3 (#8604's guard; OrderRemap skips its own case)
GTX 1050 Ti, 580.173.02 2x2 at 4 samples true passes 3/3, StorageRemap runs
llvmpipe, Mesa 25.2.8 none logged true passes 3/3, StorageRemap runs

The HD 630 is the case listed here as not run: a 1x1 grid without the feature, so the target is color-only and this PR's condition is false; StorageRemap would still reach the storage view and throw, and #8604 skips it. None of these devices has the born-storable target, so this PR's skip branch itself is not exercised here.

@Dextroid17

Copy link
Copy Markdown
Contributor

Linux, llvmpipe (LLVM 23.1.1, 256 bits) via lavapipe, Mesa 26.2.4, GALLIUM_OVERRIDE_CPU_CAPS=avx, i9-11900K, CachyOS, GCC 16.2.1, Release, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, -j1; main 7e2ba73e4 with eb6f3f94e applied (local merge, clean, the 4-line test change only). Driver log: 4 samples 1x1, 8 samples 1x1; maxSampleLocationGridSize for every count 1x1.

Head. agc_driver_multisample_retirement passes 6 of 6 (3 plain, 3 under VK_LAYER_KHRONOS_validation 1.4.363 with Insert instance layer confirmed per run), every run printing the new "born storable with no promotion to retire" line, 0 VUID-.

Negative control. MultisampleRetirement.cpp from 7e2ba73e4, the only change in the build tree, rebuilt: fails 6 of 6, always MSAA storage promotion did not retain its source image, 0 VUID-. A second lavapipe build after @jotitadev's 26.0.3 with the same 1x1 grid and the same failure, so it is not specific to one lavapipe build.

Why 25.2.8 and 26.x disagree. @GiannisG1's llvmpipe on Mesa 25.2.8 (#9455 (comment)) logs no grid and passes with StorageRemap running; @jotitadev's 26.0.3 and this 26.2.4 log 1x1 and fail on main's test file. By reading, the line between them is Mesa 25.3.0: its release notes list "lavapipe: implement VK_EXT_sample_locations", lvp_device.c at mesa-25.3.0 sets .EXT_sample_locations = true and reports maxSampleLocationGridSize 1x1 with sampleLocationSubPixelBits 4, and mesa-25.2.8 has no mention of the extension. The Linux job's self-hosted runner has mesa-vulkan-drivers 25.2.8-0ubuntu0.24.04.4 (dpkg-query step of run 39746931544, the push build of main 7e2ba73e4, where test 731 passes), which fits: on that Mesa the driver logs no grid, so StorageRemap runs and passes, as in @GiannisG1's row. A lavapipe at 25.3.0 or later on that runner should, by this reading, log the 1x1 grid and fail main's StorageRemap the way both 26.x builds do; not run. This also answers the "I have not isolated which" in #8998 (comment): main 7e2ba73e4 alone fails here 6 of 6, and the remaining difference to CI fits the Mesa line above.

AI-assisted: yes (Claude Code); runs on this machine.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 7642 core/libs/prx/libSceAgcDriver/tests/execution/MultisampleRetirement.cpp
PR 9508 core/libs/prx/libSceAgcDriver/tests/execution/MultisampleRetirement.cpp
PR 10193 core/libs/prx/libSceAgcDriver/tests/execution/MultisampleRetirement.cpp

@adriadam10 adriadam10 self-assigned this Oct 23, 2026
@ycbuzi

ycbuzi commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

AMD and a second NVIDIA generation. eb6f3f94e4 merged onto main c7d6660ef8 (1e6846116a, clean), Windows 11 Home 10.0.26200, WinLibs MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, one device at a time with ANYPS5_GPU. agc_driver_multisample_retirement:

GPU sample location grids the test logs this PR main
NVIDIA RTX 4070 SUPER (616.92) 1: 4x4, 2: 2x4, 4: 2x2, 8: 1x2 pass pass
NVIDIA GTX 1650 SUPER (616.92) 1: 4x4, 2: 2x4, 4: 2x2, 8: 1x2 pass pass
AMD Radeon(TM) Graphics, RDNA2 iGPU (32.0.21030.2001) 2x2 for every count pass pass

None of the three has the 1x1 grid that makes MayReorderSamples true, so StorageRemap still runs on all of them, AMD included, and its promotion check passes there, as the description says it should. Not run: the validation layer. AI-assisted: yes (Claude Code)

@jotitadev

Copy link
Copy Markdown
Contributor Author

@MarcZX10 Adding the Apple run of the required comparison, same focused test, same three variables, main-side tree and this change. The Linux NVIDIA and lavapipe logs are in #9455 (comment); @ycbuzi's AMD RDNA2 / RTX 4070 SUPER / GTX 1650 SUPER runs on Windows (#9455 (comment)) were without the layer, and @Dextroid17 ran lavapipe 26.2.4 with it (#9455 (comment)).

  • Machine: Apple M2 Max, macOS 27.2, Xcode 27.0 (Apple clang), x86-64 build under Rosetta, Release, BUILD_TESTING=ON, full cmake --build build -j4 before each measurement.
  • Base: feat: macOS host support (Apple Silicon via Rosetta 2, Vulkan on MoltenVK) #8658 (feat/macos-port) head 564e005acb, which merges main at d7948b09f9 (2026-10-23). Not plain main, because main does not link on macOS yet. Change: this PR's diff (eb6f3f94e4, the 4-line test hunk) applied on the same checkout; it applies cleanly.
  • Drivers, selected with VK_DRIVER_FILES (loader from LunarG SDK 1.4.363.0, DYLD_LIBRARY_PATH pointing at a directory with only libvulkan*): MoltenVK 1.4.2 from the SDK, and MoltenVK main (1.4.3) built with MSL: Preserve negative zero in precise multiplication KhronosGroup/SPIRV-Cross#2704.
  • Layer: VK_LAYER_KHRONOS_validation 1.4.363 from the same SDK, added with VK_ADD_LAYER_PATH.
  • Command, identical for the four runs:
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
VK_ADD_LAYER_PATH=$HOME/VulkanSDK/1.4.363.0/macOS/share/vulkan/explicit_layer.d \
VK_DRIVER_FILES=<MoltenVK_icd.json> DYLD_LIBRARY_PATH=<loader dir> \
ctest --test-dir build -R '^agc_driver_multisample_retirement$' -V -j1 --timeout 30
agc_driver_multisample_retirement MoltenVK 1.4.2 (SDK) MoltenVK main + #2704
base fail: the device cannot write the multisampled color target's format as a storage image at its sample count fail, same message
this change fail, same message fail, same message

VUID- messages, as sets:

MoltenVK 1.4.2 MoltenVK main + #2704
base VUID-VkDeviceCreateInfo-pProperties-04451 (x1) VUID-VkDeviceCreateInfo-pProperties-04451 (x1)
this change VUID-VkDeviceCreateInfo-pProperties-04451 (x1) VUID-VkDeviceCreateInfo-pProperties-04451 (x1)
new with this change 0 0
  • 04451 is pre-existing and not from this test: vkCreateDevice does not enable VK_KHR_portability_subset, which MoltenVK exposes. It shows on every MoltenVK device creation, with or without this change.
  • None of the four logs contains was not found but was requested by env var VK_INSTANCE_LAYERS. A second run of each case with VK_LOADER_DEBUG=layer,driver shows Insert instance layer "VK_LAYER_KHRONOS_validation" and Inserted device layer "VK_LAYER_KHRONOS_validation", and the expected ICD for each driver.
  • After masking addresses and timings, the base and change logs are identical on each driver.

Why Apple fails both ways: MoltenVK reports a 1x1 sample-location grid at 2 and 4 samples, so MayReorderSamples is true, but it has no shaderStorageImageMultisample, so SampleOrderStorageFormat is VK_FORMAT_UNDEFINED. This PR's condition is false, the target is color-only, and StorageRemap throws when it asks for the storage view. That is the "1x1 grid without shaderStorageImageMultisample" case listed as not run in the description, and the same one @GiannisG1 hit on the HD 630; #8604 covers it, not this PR. To confirm the failing subtest, I ran one local control (not part of either log above): guarding only the run.StorageRemap() call with context.storageImageMultisample (the equivalent of #8604, which does not apply cleanly on #8658 because that tree has no StorageSrgbTwin) makes the test pass on both drivers, with the same single 04451. So on Apple this change neither fixes nor breaks anything, and adds no VUID-.

Log: base, MoltenVK 1.4.2 (SDK)
# tree: 564e005acb20bbeeac65d0006bae63d512eca6da (#8658 feat/macos-port head) + nothing (base)
# env: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_ADD_LAYER_PATH=/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/share/vulkan/explicit_layer.d VK_DRIVER_FILES=/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json DYLD_LIBRARY_PATH=/Users/jota_alv/Documents/GitHub/anyps5-work/moltenvk-2704/loader 
# cmd: ctest --test-dir build -R ^agc_driver_multisample_retirement$ -V -j1 --timeout 30
766: Test command: /Users/jota_alv/Documents/GitHub/anyps5-work/fix9455-port/build/tests/agc_driver_multisample_retirement_tests
766: Working Directory: /Users/jota_alv/Documents/GitHub/anyps5-work/fix9455-port
766: Environment variables: 
766:  ANYPS5_NO_SHADER_CACHE=1
766:  APS5_NO_PIPELINE_JOURNAL=1
766: Test timeout computed to be: 30
766: [src/VulkanDevice.cpp:1104 VulkanDevice] VulkanDevice constructor window=0x0
766: [src/VulkanDevice.cpp:1115 VulkanDevice] Vulkan loader loaded library=0xc9430
766: [src/VulkanDevice.cpp:1161 VulkanDevice] Vulkan instance created instance=0x7fc75000cc00
766: [src/VulkanDevice.cpp:1172 VulkanDevice] Physical device count=1
766: [src/VulkanDevice.cpp:1205 VulkanDevice] Physical device candidate=0x7fc72f308bb0 name=Apple M2 Max api=0x401165 type=1
766: [src/VulkanDevice.cpp:1252 VulkanDevice] Physical device selected physical=0x7fc72f308bb0 queueFamily=0
766: [src/VulkanDevice.cpp:1266 VulkanDevice] Selected GPU name=Apple M2 Max vendor=0x106b device=0x1b020208 subgroup=32
766: [src/VulkanDevice.cpp:1268 VulkanDevice] Memory heap 0 size=32768.0 MiB flags=0x1
766: [src/VulkanDevice.cpp:1269 VulkanDevice] Memory type 0 heap=0 flags=0x1
766: [src/VulkanDevice.cpp:1269 VulkanDevice] Memory type 1 heap=0 flags=0xf
766: [src/VulkanDevice.cpp:1269 VulkanDevice] Memory type 2 heap=0 flags=0x11
766: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 2 samples 1x1, 4 samples 1x1; maxSampleLocationGridSize for every count 1x1
766: [src/VulkanDevice.cpp:1732 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=0 depthClip=1 depthRangeUnrestricted=0 pipelineLibrary=0
766: Validation Error: [ VUID-VkDeviceCreateInfo-pProperties-04451 ] | MessageID = 0x3a3b6ca0
766: vkCreateDevice(): VK_KHR_portability_subset must be enabled because physical device VkPhysicalDevice 0x7fc74f20b3b0 supports it.
766: The Vulkan spec states: If the VK_KHR_portability_subset extension is included in pProperties of vkEnumerateDeviceExtensionProperties, ppEnabledExtensionNames must include "VK_KHR_portability_subset" (https://vulkan.lunarg.com/doc/view/1.4.363.0/mac/antora/spec/latest/chapters/devsandqueues.html#VUID-VkDeviceCreateInfo-pProperties-04451)
766: Objects: 1
766:     [0] VkPhysicalDevice 0x7fc74f20b3b0
766: 
766: [src/VulkanDevice.cpp:2109 VulkanDevice] Vulkan device ready device=0x7fc72f816218 queue=0x7fc72f308f78 family=0
766: [write-watch] host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 0 after the import); imported ranges stay watched
766: [float-controls] f32 denormal flush: hardware (0 of 5472 probe results differ from the emulated flush, 546 ms)
766: 32 idle MSAA remaps: created=32 destroyed=31 live=1
766: AGC graphics: the device cannot write the multisampled color target's format as a storage image at its sample count
1/1 Test #766: agc_driver_multisample_retirement ...***Failed    6.40 sec
0% tests passed, 1 tests failed out of 1
Total Test time (real) =   6.49 sec
The following tests FAILED:
	766 - agc_driver_multisample_retirement (Failed)
Errors while running CTest
Output from these tests are in: /Users/jota_alv/Documents/GitHub/anyps5-work/fix9455-port/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
# ctest rc=8
Log: this change, MoltenVK 1.4.2 (SDK)
# tree: 564e005acb20bbeeac65d0006bae63d512eca6da (#8658 feat/macos-port head) + PR #9455 eb6f3f94e4 diff
# env: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_ADD_LAYER_PATH=/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/share/vulkan/explicit_layer.d VK_DRIVER_FILES=/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json DYLD_LIBRARY_PATH=/Users/jota_alv/Documents/GitHub/anyps5-work/moltenvk-2704/loader 
766: Test command: /Users/jota_alv/Documents/GitHub/anyps5-work/fix9455-port/build/tests/agc_driver_multisample_retirement_tests
766: Working Directory: /Users/jota_alv/Documents/GitHub/anyps5-work/fix9455-port
766: Environment variables: 
766:  ANYPS5_NO_SHADER_CACHE=1
766:  APS5_NO_PIPELINE_JOURNAL=1
766: Test timeout computed to be: 30
766: [src/VulkanDevice.cpp:1104 VulkanDevice] VulkanDevice constructor window=0x0
766: [src/VulkanDevice.cpp:1115 VulkanDevice] Vulkan loader loaded library=0x147430
766: [src/VulkanDevice.cpp:1161 VulkanDevice] Vulkan instance created instance=0x7f787680fe00
766: [src/VulkanDevice.cpp:1172 VulkanDevice] Physical device count=1
766: [src/VulkanDevice.cpp:1205 VulkanDevice] Physical device candidate=0x7f7866714a00 name=Apple M2 Max api=0x401165 type=1
766: [src/VulkanDevice.cpp:1252 VulkanDevice] Physical device selected physical=0x7f7866714a00 queueFamily=0
766: [src/VulkanDevice.cpp:1266 VulkanDevice] Selected GPU name=Apple M2 Max vendor=0x106b device=0x1b020208 subgroup=32
766: [src/VulkanDevice.cpp:1268 VulkanDevice] Memory heap 0 size=32768.0 MiB flags=0x1
766: [src/VulkanDevice.cpp:1269 VulkanDevice] Memory type 0 heap=0 flags=0x1
766: [src/VulkanDevice.cpp:1269 VulkanDevice] Memory type 1 heap=0 flags=0xf
766: [src/VulkanDevice.cpp:1269 VulkanDevice] Memory type 2 heap=0 flags=0x11
766: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 2 samples 1x1, 4 samples 1x1; maxSampleLocationGridSize for every count 1x1
766: [src/VulkanDevice.cpp:1732 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=0 depthClip=1 depthRangeUnrestricted=0 pipelineLibrary=0
766: Validation Error: [ VUID-VkDeviceCreateInfo-pProperties-04451 ] | MessageID = 0x3a3b6ca0
766: vkCreateDevice(): VK_KHR_portability_subset must be enabled because physical device VkPhysicalDevice 0x7f7876709270 supports it.
766: The Vulkan spec states: If the VK_KHR_portability_subset extension is included in pProperties of vkEnumerateDeviceExtensionProperties, ppEnabledExtensionNames must include "VK_KHR_portability_subset" (https://vulkan.lunarg.com/doc/view/1.4.363.0/mac/antora/spec/latest/chapters/devsandqueues.html#VUID-VkDeviceCreateInfo-pProperties-04451)
766: Objects: 1
766:     [0] VkPhysicalDevice 0x7f7876709270
766: 
766: [src/VulkanDevice.cpp:2109 VulkanDevice] Vulkan device ready device=0x7f7878815218 queue=0x7f7866716038 family=0
766: [write-watch] host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 0 after the import); imported ranges stay watched
766: [float-controls] f32 denormal flush: hardware (0 of 5472 probe results differ from the emulated flush, 95 ms)
766: 32 idle MSAA remaps: created=32 destroyed=31 live=1
766: AGC graphics: the device cannot write the multisampled color target's format as a storage image at its sample count
1/1 Test #766: agc_driver_multisample_retirement ...***Failed    2.62 sec
0% tests passed, 1 tests failed out of 1
Total Test time (real) =   2.71 sec
The following tests FAILED:
	766 - agc_driver_multisample_retirement (Failed)
Errors while running CTest
Output from these tests are in: /Users/jota_alv/Documents/GitHub/anyps5-work/fix9455-port/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
# ctest rc=8
Log: base, MoltenVK main + #2704
# tree: 564e005acb20bbeeac65d0006bae63d512eca6da (#8658 feat/macos-port head) + nothing (base)
# env: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_ADD_LAYER_PATH=/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/share/vulkan/explicit_layer.d VK_DRIVER_FILES=/Users/jota_alv/Documents/GitHub/anyps5-work/moltenvk-2704/mvk-mainA/MoltenVK_icd.json DYLD_LIBRARY_PATH=/Users/jota_alv/Documents/GitHub/anyps5-work/moltenvk-2704/loader 
# cmd: ctest --test-dir build -R ^agc_driver_multisample_retirement$ -V -j1 --timeout 30
766: Test command: /Users/jota_alv/Documents/GitHub/anyps5-work/fix9455-port/build/tests/agc_driver_multisample_retirement_tests
766: Working Directory: /Users/jota_alv/Documents/GitHub/anyps5-work/fix9455-port
766: Environment variables: 
766:  ANYPS5_NO_SHADER_CACHE=1
766:  APS5_NO_PIPELINE_JOURNAL=1
766: Test timeout computed to be: 30
766: [src/VulkanDevice.cpp:1104 VulkanDevice] VulkanDevice constructor window=0x0
766: [src/VulkanDevice.cpp:1115 VulkanDevice] Vulkan loader loaded library=0x147430
766: [mvk-info] MoltenVK version 1.4.3, supporting Vulkan version 1.4.357. [extension list trimmed]
766: [mvk-info] GPU device:
766: [mvk-info] Created VkInstance for Vulkan version 1.1.357, as requested by app, with the following 0 Vulkan extensions enabled:
766: [src/VulkanDevice.cpp:1161 VulkanDevice] Vulkan instance created instance=0x7fba06008800
766: [src/VulkanDevice.cpp:1172 VulkanDevice] Physical device count=1
766: [src/VulkanDevice.cpp:1205 VulkanDevice] Physical device candidate=0x7fb9e5f24bb0 name=Apple M2 Max api=0x401165 type=1
766: [src/VulkanDevice.cpp:1252 VulkanDevice] Physical device selected physical=0x7fb9e5f24bb0 queueFamily=0
766: [src/VulkanDevice.cpp:1266 VulkanDevice] Selected GPU name=Apple M2 Max vendor=0x106b device=0x1b020208 subgroup=32
766: [src/VulkanDevice.cpp:1268 VulkanDevice] Memory heap 0 size=32768.0 MiB flags=0x1
766: [src/VulkanDevice.cpp:1269 VulkanDevice] Memory type 0 heap=0 flags=0x1
766: [src/VulkanDevice.cpp:1269 VulkanDevice] Memory type 1 heap=0 flags=0xf
766: [src/VulkanDevice.cpp:1269 VulkanDevice] Memory type 2 heap=0 flags=0x11
766: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 2 samples 1x1, 4 samples 1x1; maxSampleLocationGridSize for every count 1x1
766: [src/VulkanDevice.cpp:1732 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=0 depthClip=1 depthRangeUnrestricted=0 pipelineLibrary=0
766: Validation Error: [ VUID-VkDeviceCreateInfo-pProperties-04451 ] | MessageID = 0x3a3b6ca0
766: vkCreateDevice(): VK_KHR_portability_subset must be enabled because physical device VkPhysicalDevice 0x7fb9e5f257a0 supports it.
766: The Vulkan spec states: If the VK_KHR_portability_subset extension is included in pProperties of vkEnumerateDeviceExtensionProperties, ppEnabledExtensionNames must include "VK_KHR_portability_subset" (https://vulkan.lunarg.com/doc/view/1.4.363.0/mac/antora/spec/latest/chapters/devsandqueues.html#VUID-VkDeviceCreateInfo-pProperties-04451)
766: Objects: 1
766:     [0] VkPhysicalDevice 0x7fb9e5f257a0
766: 
766: [mvk-info] Vulkan semaphores using Metal implicit guarantees within a single queue.
766: [mvk-info] Descriptor sets binding resources using Metal3 argument buffers.
766: [mvk-info] Created VkDevice to run on GPU Apple M2 Max with the following 17 Vulkan extensions enabled:
766: [src/VulkanDevice.cpp:2109 VulkanDevice] Vulkan device ready device=0x7fba0702cc18 queue=0x7fba05f05228 family=0
766: [write-watch] host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 0 after the import); imported ranges stay watched
766: [float-controls] f32 denormal flush: hardware (0 of 5472 probe results differ from the emulated flush, 457 ms)
766: [mvk-info] Destroyed VkDevice on GPU Apple M2 Max with 17 Vulkan extensions enabled.
766: [mvk-info] Destroyed VkPhysicalDevice for GPU Apple M2 Max with 0 MB of GPU memory still allocated.
766: [mvk-info] Destroying VkInstance for Vulkan version 1.1.357 with 0 Vulkan extensions enabled.
766: 32 idle MSAA remaps: created=32 destroyed=31 live=1
766: AGC graphics: the device cannot write the multisampled color target's format as a storage image at its sample count
1/1 Test #766: agc_driver_multisample_retirement ...***Failed    1.15 sec
0% tests passed, 1 tests failed out of 1
Total Test time (real) =   1.19 sec
The following tests FAILED:
	766 - agc_driver_multisample_retirement (Failed)
Errors while running CTest
Output from these tests are in: /Users/jota_alv/Documents/GitHub/anyps5-work/fix9455-port/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
# ctest rc=8
Log: this change, MoltenVK main + #2704
# tree: 564e005acb20bbeeac65d0006bae63d512eca6da (#8658 feat/macos-port head) + PR #9455 eb6f3f94e4 diff
# env: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_ADD_LAYER_PATH=/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/share/vulkan/explicit_layer.d VK_DRIVER_FILES=/Users/jota_alv/Documents/GitHub/anyps5-work/moltenvk-2704/mvk-mainA/MoltenVK_icd.json DYLD_LIBRARY_PATH=/Users/jota_alv/Documents/GitHub/anyps5-work/moltenvk-2704/loader 
766: Test command: /Users/jota_alv/Documents/GitHub/anyps5-work/fix9455-port/build/tests/agc_driver_multisample_retirement_tests
766: Working Directory: /Users/jota_alv/Documents/GitHub/anyps5-work/fix9455-port
766: Environment variables: 
766:  ANYPS5_NO_SHADER_CACHE=1
766:  APS5_NO_PIPELINE_JOURNAL=1
766: Test timeout computed to be: 30
766: [src/VulkanDevice.cpp:1104 VulkanDevice] VulkanDevice constructor window=0x0
766: [src/VulkanDevice.cpp:1115 VulkanDevice] Vulkan loader loaded library=0x1f9430
766: [mvk-info] MoltenVK version 1.4.3, supporting Vulkan version 1.4.357. [extension list trimmed]
766: [mvk-info] GPU device:
766: [mvk-info] Created VkInstance for Vulkan version 1.1.357, as requested by app, with the following 0 Vulkan extensions enabled:
766: [src/VulkanDevice.cpp:1161 VulkanDevice] Vulkan instance created instance=0x7fe51f008200
766: [src/VulkanDevice.cpp:1172 VulkanDevice] Physical device count=1
766: [src/VulkanDevice.cpp:1205 VulkanDevice] Physical device candidate=0x7fe51d808690 name=Apple M2 Max api=0x401165 type=1
766: [src/VulkanDevice.cpp:1252 VulkanDevice] Physical device selected physical=0x7fe51d808690 queueFamily=0
766: [src/VulkanDevice.cpp:1266 VulkanDevice] Selected GPU name=Apple M2 Max vendor=0x106b device=0x1b020208 subgroup=32
766: [src/VulkanDevice.cpp:1268 VulkanDevice] Memory heap 0 size=32768.0 MiB flags=0x1
766: [src/VulkanDevice.cpp:1269 VulkanDevice] Memory type 0 heap=0 flags=0x1
766: [src/VulkanDevice.cpp:1269 VulkanDevice] Memory type 1 heap=0 flags=0xf
766: [src/VulkanDevice.cpp:1269 VulkanDevice] Memory type 2 heap=0 flags=0x11
766: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 2 samples 1x1, 4 samples 1x1; maxSampleLocationGridSize for every count 1x1
766: [src/VulkanDevice.cpp:1732 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=0 depthClip=1 depthRangeUnrestricted=0 pipelineLibrary=0
766: Validation Error: [ VUID-VkDeviceCreateInfo-pProperties-04451 ] | MessageID = 0x3a3b6ca0
766: vkCreateDevice(): VK_KHR_portability_subset must be enabled because physical device VkPhysicalDevice 0x7fe52e1138c0 supports it.
766: The Vulkan spec states: If the VK_KHR_portability_subset extension is included in pProperties of vkEnumerateDeviceExtensionProperties, ppEnabledExtensionNames must include "VK_KHR_portability_subset" (https://vulkan.lunarg.com/doc/view/1.4.363.0/mac/antora/spec/latest/chapters/devsandqueues.html#VUID-VkDeviceCreateInfo-pProperties-04451)
766: Objects: 1
766:     [0] VkPhysicalDevice 0x7fe52e1138c0
766: 
766: [mvk-info] Vulkan semaphores using Metal implicit guarantees within a single queue.
766: [mvk-info] Descriptor sets binding resources using Metal3 argument buffers.
766: [mvk-info] Created VkDevice to run on GPU Apple M2 Max with the following 17 Vulkan extensions enabled:
766: [src/VulkanDevice.cpp:2109 VulkanDevice] Vulkan device ready device=0x7fe52e830218 queue=0x7fe51d80a588 family=0
766: [write-watch] host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 0 after the import); imported ranges stay watched
766: [float-controls] f32 denormal flush: hardware (0 of 5472 probe results differ from the emulated flush, 98 ms)
766: [mvk-info] Destroyed VkDevice on GPU Apple M2 Max with 17 Vulkan extensions enabled.
766: [mvk-info] Destroyed VkPhysicalDevice for GPU Apple M2 Max with 0 MB of GPU memory still allocated.
766: [mvk-info] Destroying VkInstance for Vulkan version 1.1.357 with 0 Vulkan extensions enabled.
766: 32 idle MSAA remaps: created=32 destroyed=31 live=1
766: AGC graphics: the device cannot write the multisampled color target's format as a storage image at its sample count
1/1 Test #766: agc_driver_multisample_retirement ...***Failed    0.34 sec
0% tests passed, 1 tests failed out of 1
Total Test time (real) =   0.38 sec
The following tests FAILED:
	766 - agc_driver_multisample_retirement (Failed)
Errors while running CTest
Output from these tests are in: /Users/jota_alv/Documents/GitHub/anyps5-work/fix9455-port/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
# ctest rc=8
Layer insertion (VK_LOADER_DEBUG=layer,driver, same command)
--- base-sdk
[Vulkan Loader] DRIVER:         Found ICD manifest file /Users/jota_alv/VulkanSDK/1.4.363.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json, version 1.0.0
[Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_KHRONOS_validation" (/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/lib/libVkLayer_khronos_validation.dylib)
[Vulkan Loader] INFO | LAYER:   Inserted device layer "VK_LAYER_KHRONOS_validation" (/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/lib/libVkLayer_khronos_validation.dylib)
--- pr-sdk
[Vulkan Loader] DRIVER:         Found ICD manifest file /Users/jota_alv/VulkanSDK/1.4.363.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json, version 1.0.0
[Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_KHRONOS_validation" (/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/lib/libVkLayer_khronos_validation.dylib)
[Vulkan Loader] INFO | LAYER:   Inserted device layer "VK_LAYER_KHRONOS_validation" (/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/lib/libVkLayer_khronos_validation.dylib)
--- base-mvk
[Vulkan Loader] DRIVER:         Found ICD manifest file /Users/jota_alv/Documents/GitHub/anyps5-work/moltenvk-2704/mvk-mainA/MoltenVK_icd.json, version 1.0.0
[Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_KHRONOS_validation" (/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/lib/libVkLayer_khronos_validation.dylib)
[Vulkan Loader] INFO | LAYER:   Inserted device layer "VK_LAYER_KHRONOS_validation" (/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/lib/libVkLayer_khronos_validation.dylib)
--- pr-mvk
[Vulkan Loader] DRIVER:         Found ICD manifest file /Users/jota_alv/Documents/GitHub/anyps5-work/moltenvk-2704/mvk-mainA/MoltenVK_icd.json, version 1.0.0
[Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_KHRONOS_validation" (/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/lib/libVkLayer_khronos_validation.dylib)
[Vulkan Loader] INFO | LAYER:   Inserted device layer "VK_LAYER_KHRONOS_validation" (/Users/jota_alv/VulkanSDK/1.4.363.0/macOS/lib/libVkLayer_khronos_validation.dylib)

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

A device with programmable sample locations but only a 1x1 location grid (for example lavapipe) creates its multisampled color targets with storage usage from the start, so the guest sample order can be written back. MultisampleTargetStorageView then returns that already-storable image and makeStorable is a no-op, so there is no promotion allocation to retire and the generation does not change. StorageRemap asserted the opposite and failed deterministically with "MSAA storage promotion did not retain its source image".

Skip StorageRemap on such devices, mirroring OrderRemap, which already runs only there. The born-storable targets lifetime stays covered by OrderRemap; StorageRemap keeps covering the promotion path on devices whose MSAA targets are not born storable (for example NVIDIA, whose 4x grid is 2x2).
…e-order devices

StorageTwin asserts that a storage access promotes the rendered target
to a new image. On a device that writes the guest sample order back
(MayReorderSamples with a storage format, such as lavapipe with its 1x1
sample-location grid) the target is born storable, so the storage view
is the rendered image and the case fails with "MSAA storage promotion
kept the rendered image", the same reason StorageRemap failed. Expect
the same image there, and a new one everywhere else.
@jotitadev
jotitadev force-pushed the fix/agc-multisample-storage-remap-reorderable-skip branch from eb6f3f9 to 0069118 Compare October 27, 2026 05:46
@jotitadev

Copy link
Copy Markdown
Contributor Author

@MarcZX10 Update: on current main the first commit alone no longer makes the test pass on lavapipe. StorageTwin (added in 4375cf06a, after every lavapipe run in this thread) asserts the same promotion that StorageRemap did, so on a born-storable target it fails with MSAA storage promotion kept the rendered image.

  • Rebased onto main a8bc4474c (force-push, was eb6f3f94e, now 0069118a9; the first commit is unchanged apart from the rebase) and added test(agc): expect no promotion in the MSAA storage twin case on sample-order devices: with the same MayReorderSamples && SampleOrderStorageFormat != VK_FORMAT_UNDEFINED condition, StorageTwin now requires the same image there and a new image elsewhere. Its twin-view checks still run on every device.
  • Ubuntu 26.04, GCC 15.2, Release, RTX 3070 (595.99.02) and lavapipe (Mesa 26.0.3), ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ctest -R '^agc_driver_multisample_retirement$' -V -j1, 3 runs each:
RTX 3070 lavapipe
main 4297464b1 pass fail in StorageRemap (did not retain its source image)
eb6f3f94e on 4297464b1 pass fail in StorageTwin (kept the rendered image)
0069118a9 tree pass pass (StorageRemap skipped, StorageTwin runs)

4297464b1 and a8bc4474c have the same MultisampleRetirement.cpp and MultisampleTarget.cpp. 0 VUID- in all 18 runs, no was not found but was requested line, and VK_LOADER_DEBUG=layer shows the layer inserted at instance and device level. Both devices have shaderStorageImageMultisample, so StorageTwin runs on both. The PR description is updated.

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

@adriadam10
adriadam10 dismissed MarcZX10’s stale review October 27, 2026 05:48

Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.

@adriadam10
adriadam10 merged commit 20cfe35 into boykopovar:main Oct 27, 2026
11 of 12 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked both commits: the StorageRemap skip uses the same MayReorderSamples && SampleOrderStorageFormat != VK_FORMAT_UNDEFINED condition as OrderRemap, and StorageTwin now expects the same image on born-storable targets and a new image elsewhere (computed from the original format, twin-view checks still run everywhere). Validation-layer comparison on RTX 3070 and lavapipe shows 0 VUID- and the lavapipe failure gone; the Build run on this head is green; merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants