feat(shader): raise the image limit to 128 and name the counts in its refusals #10489

Merged
EagleBearerYS merged 24 commits from upstream-pr/10489 into main 2026-11-08 18:08:03 +00:00
EagleBearerYS commented 2026-10-24 03:15:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-24T03:15:41Z.


What

With #10000, Ghostrunner (PPSA03685)'s compute shader 0x200c520000 gets past sampler resource limit exceeded and stops on image resource limit exceeded (frankea's offline replay, on main + #9068 + #8070 + #9701-#9703 + #8939 + #9969 + #10000). The cap is ShaderInfo::MaxImages, 64. This PR raises it to 128:

  • The refusals name the counts. The tracker's is now image resource limit exceeded (129 of 128), the image being added against the limit, and the binding builder's is runtime image count exceeds the static capacity (N of 128). A replay that still refuses then says what it needs.
  • Every per-image range fits 128:
Limit At 128 images Room
ImageBase spec IDs, 1024 + 5 per image 1024-1663 below VertexBase 4096 (614 images)
MipCountBase, 8320 + 1 per image 8320-8447 below StoreQuantizeBase 12288
StoreQuantizeBase, 12288 + 4 per image 12288-12799 below DescriptorIndexBase 16384
CompareBase, 49152 + 6 per image 49152-49919 below FoldOffsetBase 57344
MinLodBase, 57600 + 1 per image 57600-57727 below SamplerLodBiasBase 57728 (#14621, 1 per sampler, to 57791)
FmaskFormatBase, 58048 + 1 per image 58048-58175 below VolumeGatherBase 58176
VolumeGatherBase (#9183), 58176 + 1 per image 58176-58303 below ImageComponentBase 65536
RuntimeAbi::ImageCapacity 128 entries 256

DescriptorIndex, HeapCountBase and the per-sampler bases are indexed per heap element, binding kind or sampler, not per image. No 64-bit mask is indexed by image: directSamplers[image] holds sampler bits. Device limits are still checked when the layout is created.
On main, FmaskFormatBase (57472) left room for 64 images below MirrorUnnormalizedBase (57536), so a direct FMASK image at index 64 or above would share sampler k's mirror-axes ID (XairRrR's review). This PR moves it above MinLodBase + 128, and DescriptorBindingBuilder.cpp now has a static_assert for each per-image and per-sampler range: each base plus its limit stays at or below the next base, so a later limit change or new base fails to compile. fma-rc's #9183 added VolumeGatherBase at 57664, which at 128 images would overlap FmaskFormatBase's new range, so this PR moves it too, making each per-image range ShaderInfo::MaxImages wide, and adds it to that chain. danielhorngt's #14621 has since taken 57728-57791 for SamplerLodBiasBase, one ID per sampler. So 482e813ba3 moves FmaskFormatBase to 58048 and VolumeGatherBase to 58176, above the IDs other open PRs take below 58048, and e62603545a adds SamplerLodBiasBase to the chain, between MinLodBase's range and FmaskFormatBase.

  • Shaders with 64 or fewer images plan exactly as before. Every comparison that reads the constant is already satisfied at 64.
  • What changes above 64: a shader whose selected records and direct images total 65 to 128 used to have its largest heaps merged back into one table. Now its records stay selected, one record each, as long as its pairs fit in 256. The existing selected-record test shows it: 127 selected reads and 1 direct image plan as 128 images (127 selected tables, 1 direct), 128 pairs.
  • Still 64: direct sampled images. Each takes an element in every typed heap of its runtime modes, and each heap holds 64 (shader image heap capacity exceeded). Images past 64 come through image tables, so 0x200c520000 gets past the tracker only if at most 64 of its images are direct.
  • Gran Turismo 7 (PPSA01317) needs 77 images per table-call shader. freneza replayed its 28 compute shaders with a table call in agc_shader_replay --prepare, on Linux with an RTX 5070, on #14636's 8e5b82d0f2 with MaxImages raised locally rather than with this PR: each needs 77 images, over main's 64 and under this PR's 128 (comment on #13538), and freneza's reply on #14636 confirms the 77 and that module size, not the image limit, is what stops them. It doesn't pass: the modules come to 33.9-35.2M SPIR-V words each, and vkCreateComputePipelines hadn't returned after 17 min 49 s at about 19 GB, when freneza's own memory guard stopped it. The module size is what #13538 is about, not this PR.
  • FormatVersion 60: main is at 57 since frankea's #9020 (11-07 11:49Z). Ours take one number each: #10489 60, #7642 62, #7395 63, #8939 66, #9457 67, #9633 70, #9790 71, #9749 72 and #9969 73. This PR held 57 from 9544416ba9 (11-04 04:33Z), as #9020, ZSWolt's #12944 and savvaniss's #9889 and #9897 did. All of them change main's 56 to 57 on the same line, so git merged #9020's main into this PR with no conflict. #9020 landed first, so this PR moved to 58 (d5b9ccdb80). frankea's #10049 and ntamas94's #14032 also held 58, so the head moves to 60 (74407aac46). That's also what Dean asked of #9508 on 11-07: "take a fresh FormatVersion number, since other open PRs also bump that line" (comment). The other open PRs changing it hold 51 (#14944), 52 (#6416), 53 (#9748), 57 (#9889, #9897, #10351, #11551 and #12944, the same as main), 58 (#10049 and #14032), 59 (#15343), 61 (#9508), 62 (#7085), 68 (#14636), 69 (#14871), 73 (#15555, #16812 and #16814, on #9969), 74 (#14853), 75 (#10193, #16472 and #16631) and 76 (#13928 and #13929), from a check of every open PR's head at 17:41Z on 11-07. Whichever lands second on a number takes the next free one.
  • Specialization IDs that other open PRs also take. Whichever PR lands second moves its base to a free one. If one of these lands first, this PR's next merge of main moves its range, and checks the merged values whether or not git reports a conflict:
    • 57728-57791, SamplerLodBiasBase, now on main: danielhorngt's #14621 merged (1322babd48, 11-05 23:13Z) with SamplerLodBiasBase at 57728, one ID per sampler, inside the FmaskFormatBase range this PR had moved to (57728-57855). This PR moved its two bases above it (482e813ba3, see Tested). shahulmubeen-a's #14964 adds HalfBorderUnnormalizedBase at 57728 too, which now overlaps main's SamplerLodBiasBase rather than this PR's ranges (BunnyFl's note). This PR leaves 57792-57855 free, which #16935 takes (below).
    • 57792-57855, the range this PR leaves free: akkadbakkad89's #16935 adds UnnormalizedScaledBase at 57792, one ID per sampler, for a different Gran Turismo 7 (PPSA01317) stop: #16650, where an unnormalized S# selects a nonzero mip on a multi-level 2D view. This PR raises the image limit that the title's table-call shaders exceed (above). ShaderInfo::MaxSamplers is 64 on both, so #16935's range ends at 57855, below this PR's FmaskFormatBase (58048) and #12790's GatherLodBase (57856). Git reports one conflict, in PipelineSpecialization.hpp: both PRs add their lines right after SamplerLodBiasShaderThreshold, this PR FmaskFormatBase and VolumeGatherBase, #16935 UnnormalizedScaledBase (merge-tree of 9ac49a7410 with 74407aac46, 01:08Z 11-08). Either order works: whichever lands second keeps all three lines and adds UnnormalizedScaledBase to the static_assert chain, with SamplerLodBiasBase + ShaderInfo::MaxSamplers <= UnnormalizedScaledBase and UnnormalizedScaledBase + ShaderInfo::MaxSamplers <= FmaskFormatBase.
    • 57856-58047, below this PR's new bases: yinx080's #12790 adds GatherLodBase (57856), GatherLodBiasBase (57920) and GatherImageMinLodBase (57984), 64 each. Its IDs no longer overlap this PR's ranges. Since #14621 merged, #12790 conflicts with main itself in PipelineSpecialization.hpp and DescriptorBindingBuilder.cpp. Its own static_assert (VolumeGatherBase + ShaderInfo::MaxImages <= GatherLodBase) fails to compile with this PR, whose VolumeGatherBase is now above GatherLodBase.
    • 8384, in this PR's MipCountBase range (8320-8447): Amoenus's #7085 adds LevelsPastViewBase at 8384, one ID per image, the first free ID above main's 64-image range. #7085 had it first (7f56df7116, 10-19); this PR widened MipCountBase's range in 325861788d (10-24). Git merges the two with no conflict in PipelineSpecialization.hpp, and no static_assert names both bases, so in a shader with 65 or more images, image 64's mip count would share image 0's LevelsPastViewBase ID. fdfawef324's draft #6280 takes 8384 too, for its own LevelsPastViewBase.
    • 58368, above this PR's new end (58303): Celegans12's #10193, #13928 and #13929 add DeviceSamplerClassBase there, clear of this PR's ranges.

The commits:

  1. 325861788d: the limit and the counted refusals, with the existing limit test's fixture resized to work at either limit (256 heap records, the direct T#s and samplers past the 130 key words).
  2. 8e0d4f5ad2: the new tests.
  3. 482e813ba3: moves FmaskFormatBase and VolumeGatherBase to 58048 and 58176, above #14621's SamplerLodBiasBase.
  4. e62603545a: adds SamplerLodBiasBase to the static_assert chain.

Tested

  • agc_shader_image_limits (CPU, tests/ShaderMemory.cpp):
    • 65 and 128 table images plan and compile as that many table elements, each holding its own T#;
    • 64 table images and 64 direct images plan as 128 and compile to 64 table and 64 heap elements, with no specialization ID emitted twice (image 127's are 1659 to 1663);
    • 129 images are refused by the tracker and by the binding builder with the counted texts.
  • agc_driver_many_images (Vulkan, tests/execution/ManyImages.cpp): 65 images, each a texture holding its own value, sampled and stored to its own output word, in both orders (a table image then 64 direct images, and the reverse). 128 on the device would take 84 s on a cold runner, so the 128-element binding is covered by the CPU test.
  • Red: with only ShaderInfo.hpp's constant and the tracker's message reverted, image limits: 65 images were not planned: image resource limit exceeded, and the device test refuses with image resource limit exceeded.
  • GitHub's runners (run 40055234901, against #10000's head 12b89239c7, ×10 after):
    • Linux: both new tests fail before; after, 17 run, 17 pass, 0 skip, 0 fail.
    • Windows: agc_shader_image_limits fails before; after, 17 run, 16 pass, 1 skip (agc_driver_many_images, no Vulkan device), 0 fail.
    • The libc and libkernel suites pass on both, run with APS5_SKIP_TIMING_TESTS=1.
  • Linux, CI's configure flags (lavapipe, on a cloud machine), on this change over #10000's earlier head 51a0116de:
    • CI's Linux job mirrored: 1,917 tests, 1,826 pass, 86 skip, 5 fail, the five being that machine's 4 IPv6 tests and the agc_driver_sgpr_pattern_fill_keys load race;
    • --repeat until-fail:20 on the 33 ^agc_shader_ and 7 image_table tests, all 20 of 20.
  • Validation layer (Khronos 1.3.275, lavapipe, on a cloud machine), #10000's earlier head 51a0116de with and without this change, over agc_driver_many_images, agc_driver_many_direct_samplers and the 7 agc_driver_image_table* tests: identical VUIDs on both trees, only the known VUID-VkDeviceCreateInfo-pNext-pNext at device creation, and no new VUID-. On the base, agc_driver_many_images refuses before it dispatches; on this PR all 9 pass.
  • e916c02082, a merge of #10000's d6061d4ce2, which merges main c9b2660d56. Against that main, ShaderDiskCache.hpp differs only in FormatVersion, 47 to 54, and keeps main's LoadSharedPlan; ShaderDiskCache.cpp and its test differ only in #10000's 64-bit imageSamplers. This head merges cleanly into main 30be9b428b. On GitHub's runners, 10 runs (run) of the sampler, selected-record, image-sample and disk-cache sets (^.*sampler, ^.*selected_records, ^.*image_sample, ^.*disk_cache) and the 12 other shader tests built from the changed files, agc_shader_image_limits among them: Linux 32 run, 32 pass, 0 skip, 0 fail. Windows 34 run, 22 pass, 12 skip (no Vulkan device), 0 fail. The libc and libkernel suites pass on both (123 and 204 tests on Linux, 150 and 217 on Windows), run with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • Validation layer, main c9b2660d56 against e916c02082 (CONTRIBUTING's AGC rule), on GitHub's Linux runner (llvmpipe, LLVM 20.1.2), with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 and ctest -V. main's arm runs main's implementation of every file this stack changes, #10000's included.
    • Run: the sampler, selected-record, image-sample and disk-cache sets with the other shader tests built from the changed files. 32 pass with this PR and 29 on main; the layer was inserted 12 and 11 times.
    • Run: agc_driver_many_images, agc_driver_many_direct_samplers and the 7 agc_driver_image_table* tests, with the other shader tests. 26 pass with this PR and 22 on main; the layer was inserted 10 and 8 times.
    • Neither log has was not found but was requested, both trees report only VUID-VkDeviceCreateInfo-pNext-pNext, and this PR adds no VUID- message. agc_shader_image_limits and agc_driver_many_images, and #10000's agc_shader_sampler_limits and agc_driver_many_direct_samplers, don't exist on main, so only this PR's tree runs them.
  • Ghostrunner (PPSA03685), a replay by @TheSovietWaffle (comment): this PR's ce4d6f48c3 merged with #9633's 217e3d7b1f and #10000's e7b14b0e8e. The only conflicts were FormatVersion and the debt docs. It's the same shader_200c520000.prepare.req, dumped on main 74acfad65, and the same agc_shader_replay --prepare with ANYPS5_NO_SHADER_CACHE=1 as their run without this PR. CPU replay only.
    • Without this PR, that stack stops on image resource limit exceeded.
    • With it, the request gets past the image limit and stops on sampler resource limit exceeded, the 64-sampler cap.
    • Their counts from the srt IR (on the #9969 stack): 1,047 GetImageResource and 941 GetSamplerResource, 619 of them with distinct argument tuples. These are SSA tuples, not distinct memory locations.
  • ce2ba44d38, a merge of #10000's merge of main (d82e3f9552) (run). No conflict of its own; this PR's diff over #10000 is unchanged. The sampler, selected-record, disk-cache, image-table and agc_shader_image_limits tests pass 10 runs in a row. Linux: 27 run, 27 pass, 0 skip, 0 fail. Windows: 29 run, 23 pass, 6 skip (the agc_driver_image_table tests, no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (144 and 207) and on Windows (171 and 223). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • NVIDIA GeForce RTX 5070 Ti (621.01) and an AMD Radeon RDNA2 iGPU (AMD 2026.04.17), Windows 11, by @wachi35676 (comment): WinLibs GCC 15.2.0, Release, this PR's ce2ba44d38 merged onto main aeff26bd9, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, no validation layer. The 64 image, sampler, record, disk-cache, image-table and agc_shader_ entries pass on both GPUs; with ShaderInfo::MaxImages set back to 64, agc_shader_image_limits and agc_driver_many_images fail on both. A local variant of ManyImages.cpp with 64 table T#s next to the 64 direct ones, in both orders, binds 64 image table elements and 64 heap elements with every output word holding its own image's texel and nothing written past them; 129 images refuse with image resource limit exceeded (129 of 128). Of 253 agc_ entries the only failure, with and without this PR, is agc_driver_depth_plane_partial_store (#10664).
  • ef7c065124 and 0fd6998a10, a merge of #10000's merge of main 85f8e11372, and a trim of this PR's debt entry (run). In the Windows set_tests_properties line of core/libs/prx/libSceAgcDriver/CMakeLists.txt, the merge keeps main's three result-memo budget tests (#9989) with #10000's agc_shader_sampler_limits and this PR's agc_shader_image_limits; this PR's diff over #10000 is otherwise unchanged, and FormatVersion stays 54. 0fd6998a10 brings the image-table entry in docs/dev/debt/shader.md under the debt-length limit, from 1069 characters to 989, as the reply to wachi35676's run said it would: the masked-key case joins the sentence on the unevaluated key, and the reason clause goes; the behaviour it records is the same. The agc_shader_ tests with the tests built from the files the merge changes pass 10 runs in a row. Linux: 321 run, 311 pass, 10 skip (seven AGC tests on lavapipe and three video-out tests with no display or Vulkan device), 0 fail. Windows: 347 run, 260 pass, 87 skip (84 AGC tests and the same three video-out tests, no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (145 and 211) and on Windows (174 and 232). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 254fb9018c, a merge of #10000's aa94587021 (run), which brings #10000's merge of main 0c5401dcbd and its two test-only commits: the refusal checks @oneandonlydean listed on #10000 go, and agc_driver_many_direct_samplers skips on a device with fewer than 33 samplers per stage or set (@jotitadev's MoltenVK run). No conflicts; FormatVersion stays 54, and this PR's changed lines over #10000 are the same. The image-limit, sampler-limit, image-table, sample-order, shader and disk-cache tests ran 10 times with no failure. Linux: 26 run, 26 pass, 0 skip, 0 fail. Windows: 28 run, 25 pass, 3 skip (agc_driver_image_table, agc_driver_many_direct_samplers and agc_driver_sample_order; no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (166 and 264). On Windows libc passes (194), and libkernel passes 283 of 286: exec_arguments, guest_timed_join_import_libkernel_sys and guest_timed_join_import_libkernel_web fail at their setup in the verify's Windows build (FileNotFoundError starting the title, or copying the libraries they load), and pass in main's own Windows job at 1829def9bf (job). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • Apple M2 Max with MoltenVK, by @jotitadev (review), on 0fd6998a10 over main b87d3d87e2 with the macOS port PRs and one local patch (FormatVersion resolved to 54): MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0) and MoltenVK main with SPIRV-Cross #2704, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1.
    • Green: agc_driver_many_images and agc_shader_image_limits pass 3 of 3 on both drivers (MoltenVK's maxPerStageDescriptorSampledImages is 256).
    • Red: with ShaderInfo::MaxImages set back to 64, both fail 3 of 3 on both drivers with image resource limit exceeded (65 of 64).
    • Validation layer (SDK driver): only VUID-vkCreateDescriptorSetLayout-support-09582 (×2) in agc_driver_many_images, the image-table layout MoltenVK's layout-support query rejects (KhronosGroup/MoltenVK#2573), as in the existing image-table tests on the base.
    • ^agc: the base's failures plus agc_driver_many_direct_samplers, from #10000, on MoltenVK's 16 samplers per stage; #10000's aa94587021 now skips it on such a device. One agc_driver_lds_subword_store_branch failure on MoltenVK main passes 5 of 5 alone and is the LDS-barrier test #10858 targets.
  • b198906a61, a merge of #10000's 7f4e97c45f, which carries main 94fe1b5c5a and with it #11507's FormatVersion 49 (run). Clean: FormatVersion stays 54 (see What), and this PR's diff over #10000 is the same. The image-limit, sampler-limit, image-table and sample-order tests with the disk-cache, bindless and shader-memory tests and #11507's agc_driver_image_sample_short_cube ran 10 times with no failure. Linux: 27 run, 27 pass, 0 skip, 0 fail. Windows: 29 run, 25 pass, 4 skip (the Vulkan device tests), 0 fail. Suites: libc and libkernel pass on Linux (166 and 265). On Windows libc passes (194), and libkernel passes 284 of 287: exec_arguments, guest_timed_join_import_libkernel_sys and guest_timed_join_import_libkernel_web fail at their setup in the verify's Windows build (FileNotFoundError starting the title, or copying the libraries they load), with main's code too, and pass in main's own Windows job at 1829def9bf (job). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 1e5eb0cc71, a merge of #10000's merge of main 0836dfdf4f (run, on e7c504633b, which has the same tree). #12862 moved libSceAgcDriver's test registrations into tests/cmake/; the conflict in CMakeLists.txt is resolved with tools/agc_test_split.py resolve, which moves this PR's registration of agc_shader_image_limits into tests/cmake/agc_shader_memory_tests.cmake (+3 −2 against #10000's merge). Nothing else conflicted. Apart from the move, this PR's diff is unchanged. With -DBUILD_TESTING=ON, ctest -N gives 3079 tests: main's 3075 plus this PR's and #10000's 4 tests, each listed once. The 11 tests of this PR's verify set pass 10 runs in a row. Linux: 11 run, 11 pass, 0 skip, 0 fail. Windows: 11 run, 8 pass, 3 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (199 and 308) and on Windows (226 and 330). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • Validation layer, main 8a4fc62318 against this head 1e5eb0cc71 (CONTRIBUTING's AGC rule, refreshed for @MarcZX10's review), on GitHub's Linux runner (run).
    • The setup: llvmpipe (LLVM 20.1.2), Mesa 25.2.8, Ubuntu 24.04.5, with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 and ctest -V.
    • The head's arm is a verify-only commit whose tree is byte-identical to 1e5eb0cc71's, with main 8a4fc62318 as a second parent, so the runner can check out both arms.
    • The tests: this PR's set (the shader sampler and image limit tests, agc_driver_many_images, agc_driver_many_direct_samplers, agc_driver_image_sample_reduction, agc_shader_disk_cache, agc_shader_memory, agc_shader_selected_records_*), plus the tests the harness maps from the files that differ between the two trees.
    • The layer was inserted 1 time on main and 3 times with this head, and neither log has was not found.
    • The result: both logs report only VUID-VkDeviceCreateInfo-pNext-pNext, which is on main, so this head adds none. With this head, 31 run, 31 pass. main's arm passes the tests it has.
  • NVIDIA, TechLevelZero's GPU runner (report): 1e5eb0cc71 merged onto main 0836dfdf4f, NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Linux. Passed: 2,450 passed, 0 new failures (4 fail on main too, and 2 are unstable there), and no new validation IDs against main over 930 tests run on the GPU.
  • 9a7315f239, a merge of #10000's 760a550294, which merges main 88e804b0a7 (run). #10000's merge brings Ondra97's #7694 and JJenkx's #6959 (see #10000). The conflicts were this PR's lines beside #10000's and main's at the same places, and the merge keeps both: its --image-limits case in ShaderMemory.cpp and its agc_shader_image_limits registration in agc_shader_memory_tests.cmake, next to #7694's agc_shader_descriptor_phis. FormatVersion stays 54, and this PR's diff over #10000 is unchanged. The image-limit, sampler-limit, selected-record, disk-cache and shader-memory tests, with agc_driver_image_sample_reduction, agc_driver_many_direct_samplers and agc_driver_many_images, pass 10 runs in a row. Linux: 13 run, 13 pass, 0 skip, 0 fail. Windows: 15 run, 12 pass, 3 skip (those three agc_driver_ tests; no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • f3fb2905a4: 306ed92696, 688024e6aa, 4a58386f5f and f3fb2905a4, for XairRrR's review (×10, red).
    • 306ed92696 merges #10000's ba833f42c0, which checks the pair-limit merge without compiling it, and 688024e6aa merges main 5cb015caaa. Both are clean.
    • 4a58386f5f splits agc_shader_image_limits into agc_shader_image_limits_table (65 and 128 table images), agc_shader_image_limits_mixed (64 table and 64 direct images) and agc_shader_image_limits_refusals (129 images).
    • f3fb2905a4 gives FmaskFormatBase its own range of ShaderInfo::MaxImages IDs, with the static_asserts above. agc_shader_image_limits_mixed adds an FMASK direct image at index 64 beside a sampler that mirrors when unnormalized, and checks that no specialization ID is emitted twice.
    • Red: f3fb2905a4's tests with the old DescriptorBindingBuilder.cpp and PipelineSpecialization.hpp fail agc_shader_image_limits_mixed on both runners: "image limits: image 64's FMASK format shares a specialization ID with another constant, such as sampler 0's mirror axes".
    • ×10: the image-limit, sampler-limit, selected-record, disk-cache and image-sample tests. Linux: 14 run, 14 pass, 0 skip, 0 fail. Windows: 16 run, 13 pass, 3 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 279 and 321 tests on Linux and 306 and 342 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Test times on GitHub's Linux runner (lavapipe, four tests at a time, the longest of the 10 runs): agc_shader_image_limits_table 13.2 s, agc_shader_image_limits_mixed 8.8 s, agc_shader_image_limits_refusals 0.1 s, agc_shader_sampler_limits 10.2 s, agc_shader_selected_records_image_limit 9.7 s, agc_shader_selected_records_direct_image_limit 9.4 s, agc_shader_selected_records_pair_limit 0.2 s and agc_shader_selected_records_direct_pair_limit 0.2 s.
  • 02ace33cfa, a merge of main 4f41f4c375 (run).
    • Why: it only resolves the two merge bases this branch had with main, left by merging #10000's ba833f42c0 (306ed92696) before #10000 landed. GitHub showed them as a conflict, though git merges the branch with main cleanly. No file needed a resolution (git show --remerge-diff is empty), so the merge adds no change of its own.
    • ×10: agc_driver_image_sample_reduction, agc_driver_many_direct_samplers, agc_driver_many_images, agc_shader_sampler_limits and every test matching ^agc_shader_disk_cache, ^agc_shader_selected_records_ or ^agc_shader_image_limits. Linux: 14 run, 14 pass, 0 skip, 0 fail. Windows: 16 run, 13 pass, 3 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 300 and 322 tests on Linux and 327 and 342 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • GPUs, at f3fb2905a4 merged onto main 4f41f4c: TechLevelZero's NVIDIA bot, RTX 2000 Ada, driver 595.99.02 (report): 2,766 passed, 7 failed, none new (3 also fail on main, 4 unstable on main), 48 skipped, with no new validation IDs (936 tests on the GPU). Its AMD bot, Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8; report): 2,753 passed, 10 failed, none new (8 also fail on main, 2 unstable on main), 58 skipped, with no new validation IDs (936 tests on the GPU).
  • 54bd6f2cc6, a merge of main 086c0686c8, which brings fma-rc's #9183 (×10).
    • The conflict: PipelineSpecialization.hpp, where #9183 adds VolumeGatherBase at 57664 next to this PR's moved FmaskFormatBase. The merge keeps it at 57856 (see What). It also changes DescriptorBindingBuilder.cpp, which didn't conflict: FmaskFormatBase's static_assert now ends at VolumeGatherBase, and a new one keeps VolumeGatherBase + 128 at or below ImageComponentBase. This PR's other lines are unchanged.

    • ×10: agc_driver_image_sample_reduction, agc_driver_many_direct_samplers, agc_driver_many_images, agc_shader_sampler_limits and every test matching ^agc_shader_disk_cache, ^agc_shader_selected_records_, ^agc_shader_image_limits or ^agc_driver_image_gather, which takes in #9183's gather tests. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 19 run, 13 pass, 6 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 300 and 324 tests on Linux and 330 and 342 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.

    • Every agc test, once (run): Linux: 1,294 run, 1,209 pass, 84 skip, 1 fail. Windows: 1,331 run, 403 pass, 928 skip (no Vulkan device), 0 fail. The one failure is agc_driver_pipeline_journal's 120-second timeout (Test #1393: agc_driver_pipeline_journal ***Timeout 120.06 sec).

    • That timeout is main's own cold run, near the limit. main 086c0686c8 times out the same way under ctest -V (run): Test #1392: agc_driver_pipeline_journal ***Timeout 120.06 sec. With a 300-second limit, 5 runs each on GitHub's Linux runner, both pass 5 of 5:

      agc_driver_pipeline_journal First (cold) run Warm runs Warm median
      This merge, 54bd6f2cc6 (run) 125.8 s 45.8, 46.4, 46.0, 46.1 s 46.1 s
      main 086c0686c8 (run) 135.9 s 49.7, 50.1, 49.4, 49.7 s 49.7 s

      In both, one slow step of the cold run is a journal reload that drops an unreadable tail (16 to 22 s in the verbose runs).

    • NVIDIA RTX 2000 Ada Generation at 54bd6f2cc6, from TechLevelZero's NVIDIA bot (report): this head merged onto main 1c8c0ef, driver 595.99.02. 2,792 passed, 6 failed (none new: 3 also fail on main, 3 unstable on main), 50 skipped. This PR's agc_shader_image_limits_table, agc_shader_image_limits_mixed and agc_shader_image_limits_refusals passed on the GPU.

    • AMD Radeon RX 6300 (RADV NAVI24) at 54bd6f2cc6, from TechLevelZero's AMD bot (report): the same merge, Mesa 25.2.8. 2,778 passed, 9 failed (none new: 7 also fail on main, 2 unstable on main), 61 skipped. The same three tests passed on the GPU.

  • 9544416ba9, a merge of main c2eafe4461, which brings yabanana's #7223 (×10).
    • The conflict: FormatVersion in ShaderDiskCache.hpp. main reached 56 with #7223, so this merge moves #10489 from 54 to 57, the next number no open PR holds. This PR's other lines are unchanged.
    • ×10: the same tests as on 54bd6f2cc6. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 19 run, 13 pass, 6 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 301 and 325 tests on Linux and 331 and 343 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • NVIDIA RTX 2000 Ada Generation, from TechLevelZero's NVIDIA bot (report): this head merged onto main 5b1d381, driver 595.99.02. 2,840 passed, 5 failed (none new: 3 also fail on main, 2 unstable on main), 50 skipped, with no new validation IDs (981 tests on the GPU).
    • AMD Radeon RX 6300 (RADV NAVI24), from TechLevelZero's AMD bot (report): this head merged onto main b611e63, Mesa 25.2.8. 2,872 passed, 10 failed (none new: 9 also fail on main, 1 unstable on main), 60 skipped, with no new validation IDs (992 tests on the GPU).
    • On both GPUs, this PR's agc_shader_image_limits_table, agc_shader_image_limits_mixed and agc_shader_image_limits_refusals, and agc_driver_many_images, ran with validation and passed. Both reports list the four as not in main's validation baseline.
    • GitHub's windows check is red at this head on one test, avplayer_http_patched_modules, at AvPlayerHttpModules.cmake:155, where the owner executable avplayer_http_patched_modules_tests.exe wasn't built for the selected test (job). JJenkx's #15375, which builds the owners of wrappers around selected guest tests, has since merged (bfd14d1260, 11-04 23:28Z). This PR changes no avplayer or HTTP file.
  • e62603545a: 482e813ba3, a merge of main ea07ec82d3 (9c0f71e1fa) and e62603545a, after danielhorngt's #14621 (×10, validation).
    • 482e813ba3, before the merge, moves FmaskFormatBase from 57728 to 58048 and VolumeGatherBase from 57856 to 58176, so the merge itself keeps both sides.
    • The conflict: PipelineSpecialization.hpp, where main's SamplerLodBiasBase and SamplerLodBiasShaderThreshold lines now come before this PR's moved bases. #14621's lines in DescriptorBindingBuilder.cpp and SpirvImageEmitter.cpp merged without a conflict. FormatVersion stays 57.
    • e62603545a: the chain's MinLodBase + ShaderInfo::MaxImages <= FmaskFormatBase becomes <= SamplerLodBiasBase, followed by SamplerLodBiasBase + ShaderInfo::MaxSamplers <= FmaskFormatBase.
    • ×10: the image-limit, sampler-limit, selected-record, disk-cache and shader-memory tests, agc_driver_image_sample_reduction, agc_driver_many_direct_samplers and agc_driver_many_images, with #14621's agc_driver_image_sample_lod_bias_sum and agc_driver_graphics. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 19 run, 15 pass, 4 skip (agc_driver_image_sample_lod_bias_sum, agc_driver_image_sample_reduction, agc_driver_many_direct_samplers and agc_driver_many_images, no Vulkan device), 0 fail. The libc and libkernel suites run 323 and 334 tests on Linux and 354 and 365 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Validation (CONTRIBUTING's recompiler rule): VK_LAYER_KHRONOS_validation on GitHub's Linux runner, llvmpipe (LLVM 20.1.2). main's tree ran 13 of these tests and passed 13. This head ran 17, the 13 plus agc_shader_image_limits_table, _mixed and _refusals and agc_driver_many_images, which main doesn't have, and passed 17. The only VUID is VUID-VkDeviceCreateInfo-pNext-pNext, on both, so this change adds none.
    • Red on Windows: the same run built this PR's tests against main's implementation, where agc_shader_image_limits_table, _mixed and _refusals fail (image limits: 65 images were not planned: image resource limit exceeded). They pass here.
    • It merges cleanly with main 01f804bb2f.
  • d5b9ccdb80: d1d8e3ef93, a merge of main 090f57166a, and the format commit d5b9ccdb80 (×10).
    • d1d8e3ef93 merges cleanly. main has frankea's #9020, which also changes FormatVersion from 56 to 57, so git took the line without a conflict and left this PR on main's number.
    • d5b9ccdb80 moves FormatVersion from 57 to 58 (see What) and changes no other line. This PR's other lines over main are unchanged.
    • ×10: the same tests as on e62603545a. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 19 run, 15 pass, 4 skip (the same four, no Vulkan device), 0 fail. The libc and libkernel suites run 327 and 344 tests on Linux and 358 and 371 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 74407aac46: FormatVersion from 58 to 60 (×10).
    • frankea's #10049 and ntamas94's #14032 also hold 58, which git would merge with this PR's 58 without a conflict. 74407aac46 moves the line to 60 (see What) and changes no other line.
    • ×10: the same tests as on d5b9ccdb80. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 19 run, 15 pass, 4 skip (the same four, no Vulkan device), 0 fail. The libc and libkernel suites run 327 and 344 tests on Linux and 358 and 371 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.

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 (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none. #10000, which this PR was stacked on, has merged, as have #9989 and #10440, which each share one line with this PR (libSceAgcDriver/CMakeLists.txt and DescriptorBindingBuilder.cpp); this head keeps both. Any order with the others: #12944, #9889 and #9897 hold FormatVersion 57, now main's, and #15343 (59) and #9508 (61) change the same line. #12790's static_assert and the 8384 of #7085 and #6280 meet this PR's ranges (see What), so whichever lands second moves to a free number or base. #14621, which took 57728, has merged, and this head's bases sit above it. savvaniss's #9897 and ntamas94's #14032 also add a test to the Windows set_tests_properties line of agc_shader_memory_tests.cmake; whichever lands second keeps both
  • Fixes: none
  • Unblocks: Ghostrunner (PPSA03685) #7320: compute shader 0x200c520000 past 64 images, by offline replay (TheSovietWaffle's, with #9633 and #10000); the next stop is sampler resource limit exceeded, the 64-sampler cap
  • GPUs tested: lavapipe (llvmpipe), on GitHub's Linux runner and on a cloud machine; NVIDIA GeForce RTX 5070 Ti (621.01) and an AMD Radeon RDNA2 iGPU, Windows 11 (wachi35676)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4992051949 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10489). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-24T03:15:41Z. --- ### What With #10000, Ghostrunner (PPSA03685)'s compute shader 0x200c520000 gets past `sampler resource limit exceeded` and stops on `image resource limit exceeded` ([frankea's offline replay](https://github.com/boykopovar/AnyPS5/pull/10000#issuecomment-6368191279), on `main` + #9068 + #8070 + #9701-#9703 + #8939 + #9969 + #10000). The cap is `ShaderInfo::MaxImages`, 64. This PR raises it to 128: - **The refusals name the counts.** The tracker's is now `image resource limit exceeded (129 of 128)`, the image being added against the limit, and the binding builder's is `runtime image count exceeds the static capacity (N of 128)`. A replay that still refuses then says what it needs. - **Every per-image range fits 128:** | Limit | At 128 images | Room | |---|---|---| | `ImageBase` spec IDs, 1024 + 5 per image | 1024-1663 | below `VertexBase` 4096 (614 images) | | `MipCountBase`, 8320 + 1 per image | 8320-8447 | below `StoreQuantizeBase` 12288 | | `StoreQuantizeBase`, 12288 + 4 per image | 12288-12799 | below `DescriptorIndexBase` 16384 | | `CompareBase`, 49152 + 6 per image | 49152-49919 | below `FoldOffsetBase` 57344 | | `MinLodBase`, 57600 + 1 per image | 57600-57727 | below `SamplerLodBiasBase` 57728 (#14621, 1 per sampler, to 57791) | | `FmaskFormatBase`, 58048 + 1 per image | 58048-58175 | below `VolumeGatherBase` 58176 | | `VolumeGatherBase` (#9183), 58176 + 1 per image | 58176-58303 | below `ImageComponentBase` 65536 | | `RuntimeAbi::ImageCapacity` | 128 entries | 256 | `DescriptorIndex`, `HeapCountBase` and the per-sampler bases are indexed per heap element, binding kind or sampler, not per image. No 64-bit mask is indexed by image: `directSamplers[image]` holds sampler bits. Device limits are still checked when the layout is created. On `main`, `FmaskFormatBase` (57472) left room for 64 images below `MirrorUnnormalizedBase` (57536), so a direct FMASK image at index 64 or above would share sampler k's mirror-axes ID (XairRrR's [review](https://github.com/boykopovar/AnyPS5/pull/10489#pullrequestreview-5744828513)). This PR moves it above `MinLodBase` + 128, and `DescriptorBindingBuilder.cpp` now has a `static_assert` for each per-image and per-sampler range: each base plus its limit stays at or below the next base, so a later limit change or new base fails to compile. fma-rc's #9183 added `VolumeGatherBase` at 57664, which at 128 images would overlap `FmaskFormatBase`'s new range, so this PR moves it too, making each per-image range `ShaderInfo::MaxImages` wide, and adds it to that chain. danielhorngt's #14621 has since taken 57728-57791 for `SamplerLodBiasBase`, one ID per sampler. So 482e813ba3 moves `FmaskFormatBase` to 58048 and `VolumeGatherBase` to 58176, above the IDs other open PRs take below 58048, and e62603545a adds `SamplerLodBiasBase` to the chain, between `MinLodBase`'s range and `FmaskFormatBase`. - **Shaders with 64 or fewer images plan exactly as before.** Every comparison that reads the constant is already satisfied at 64. - **What changes above 64:** a shader whose selected records and direct images total 65 to 128 used to have its largest heaps merged back into one table. Now its records stay selected, one record each, as long as its pairs fit in 256. The existing selected-record test shows it: 127 selected reads and 1 direct image plan as `128 images (127 selected tables, 1 direct), 128 pairs`. - **Still 64:** direct sampled images. Each takes an element in every typed heap of its runtime modes, and each heap holds 64 (`shader image heap capacity exceeded`). Images past 64 come through image tables, so 0x200c520000 gets past the tracker only if at most 64 of its images are direct. - **Gran Turismo 7 (PPSA01317) needs 77 images per table-call shader.** freneza replayed its 28 compute shaders with a table call in `agc_shader_replay --prepare`, on Linux with an RTX 5070, on #14636's 8e5b82d0f2 with `MaxImages` raised locally rather than with this PR: each needs 77 images, over `main`'s 64 and under this PR's 128 ([comment on #13538](https://github.com/boykopovar/AnyPS5/issues/13538#issuecomment-6711900685)), and freneza's [reply on #14636](https://github.com/boykopovar/AnyPS5/pull/14636#issuecomment-6713437310) confirms the 77 and that module size, not the image limit, is what stops them. It doesn't pass: the modules come to 33.9-35.2M SPIR-V words each, and `vkCreateComputePipelines` hadn't returned after 17 min 49 s at about 19 GB, when freneza's own memory guard stopped it. The module size is what #13538 is about, not this PR. - **`FormatVersion` 60:** `main` is at 57 since frankea's #9020 (11-07 11:49Z). Ours take one number each: #10489 60, #7642 62, #7395 63, #8939 66, #9457 67, #9633 70, #9790 71, #9749 72 and #9969 73. This PR held 57 from 9544416ba9 (11-04 04:33Z), as #9020, ZSWolt's #12944 and savvaniss's #9889 and #9897 did. All of them change `main`'s 56 to 57 on the same line, so git merged #9020's `main` into this PR with no conflict. #9020 landed first, so this PR moved to 58 (d5b9ccdb80). frankea's #10049 and ntamas94's #14032 also held 58, so the head moves to 60 (74407aac46). That's also what Dean asked of #9508 on 11-07: "take a fresh `FormatVersion` number, since other open PRs also bump that line" ([comment](https://github.com/boykopovar/AnyPS5/pull/9508#issuecomment-6707134988)). The other open PRs changing it hold 51 (#14944), 52 (#6416), 53 (#9748), 57 (#9889, #9897, #10351, #11551 and #12944, the same as `main`), 58 (#10049 and #14032), 59 (#15343), 61 (#9508), 62 (#7085), 68 (#14636), 69 (#14871), 73 (#15555, #16812 and #16814, on #9969), 74 (#14853), 75 (#10193, #16472 and #16631) and 76 (#13928 and #13929), from a check of every open PR's head at 17:41Z on 11-07. Whichever lands second on a number takes the next free one. - **Specialization IDs that other open PRs also take.** Whichever PR lands second moves its base to a free one. If one of these lands first, this PR's next merge of `main` moves its range, and checks the merged values whether or not git reports a conflict: - **57728-57791, `SamplerLodBiasBase`, now on `main`:** danielhorngt's #14621 merged (1322babd48, 11-05 23:13Z) with `SamplerLodBiasBase` at 57728, one ID per sampler, inside the `FmaskFormatBase` range this PR had moved to (57728-57855). This PR moved its two bases above it (482e813ba3, see Tested). shahulmubeen-a's #14964 adds `HalfBorderUnnormalizedBase` at 57728 too, which now overlaps `main`'s `SamplerLodBiasBase` rather than this PR's ranges ([BunnyFl's note](https://github.com/boykopovar/AnyPS5/pull/14964#issuecomment-6662378448)). This PR leaves 57792-57855 free, which #16935 takes (below). - **57792-57855, the range this PR leaves free:** akkadbakkad89's #16935 adds `UnnormalizedScaledBase` at 57792, one ID per sampler, for a different Gran Turismo 7 (PPSA01317) stop: #16650, where an unnormalized S# selects a nonzero mip on a multi-level 2D view. This PR raises the image limit that the title's table-call shaders exceed (above). `ShaderInfo::MaxSamplers` is 64 on both, so #16935's range ends at 57855, below this PR's `FmaskFormatBase` (58048) and #12790's `GatherLodBase` (57856). Git reports one conflict, in `PipelineSpecialization.hpp`: both PRs add their lines right after `SamplerLodBiasShaderThreshold`, this PR `FmaskFormatBase` and `VolumeGatherBase`, #16935 `UnnormalizedScaledBase` (merge-tree of 9ac49a7410 with 74407aac46, 01:08Z 11-08). Either order works: whichever lands second keeps all three lines and adds `UnnormalizedScaledBase` to the `static_assert` chain, with `SamplerLodBiasBase + ShaderInfo::MaxSamplers <= UnnormalizedScaledBase` and `UnnormalizedScaledBase + ShaderInfo::MaxSamplers <= FmaskFormatBase`. - **57856-58047, below this PR's new bases:** yinx080's #12790 adds `GatherLodBase` (57856), `GatherLodBiasBase` (57920) and `GatherImageMinLodBase` (57984), 64 each. Its IDs no longer overlap this PR's ranges. Since #14621 merged, #12790 conflicts with `main` itself in `PipelineSpecialization.hpp` and `DescriptorBindingBuilder.cpp`. Its own `static_assert` (`VolumeGatherBase + ShaderInfo::MaxImages <= GatherLodBase`) fails to compile with this PR, whose `VolumeGatherBase` is now above `GatherLodBase`. - **8384, in this PR's `MipCountBase` range (8320-8447):** Amoenus's #7085 adds `LevelsPastViewBase` at 8384, one ID per image, the first free ID above `main`'s 64-image range. #7085 had it first (7f56df7116, 10-19); this PR widened `MipCountBase`'s range in 325861788d (10-24). Git merges the two with no conflict in `PipelineSpecialization.hpp`, and no `static_assert` names both bases, so in a shader with 65 or more images, image 64's mip count would share image 0's `LevelsPastViewBase` ID. fdfawef324's draft #6280 takes 8384 too, for its own `LevelsPastViewBase`. - **58368, above this PR's new end (58303):** Celegans12's #10193, #13928 and #13929 add `DeviceSamplerClassBase` there, clear of this PR's ranges. **The commits:** 1. **325861788d:** the limit and the counted refusals, with the existing limit test's fixture resized to work at either limit (256 heap records, the direct T#s and samplers past the 130 key words). 2. **8e0d4f5ad2:** the new tests. 3. **482e813ba3:** moves `FmaskFormatBase` and `VolumeGatherBase` to 58048 and 58176, above #14621's `SamplerLodBiasBase`. 4. **e62603545a:** adds `SamplerLodBiasBase` to the `static_assert` chain. ### Tested - **`agc_shader_image_limits`** (CPU, `tests/ShaderMemory.cpp`): - 65 and 128 table images plan and compile as that many table elements, each holding its own T#; - 64 table images and 64 direct images plan as 128 and compile to 64 table and 64 heap elements, with no specialization ID emitted twice (image 127's are 1659 to 1663); - 129 images are refused by the tracker and by the binding builder with the counted texts. - **`agc_driver_many_images`** (Vulkan, `tests/execution/ManyImages.cpp`): 65 images, each a texture holding its own value, sampled and stored to its own output word, in both orders (a table image then 64 direct images, and the reverse). 128 on the device would take 84 s on a cold runner, so the 128-element binding is covered by the CPU test. - **Red:** with only `ShaderInfo.hpp`'s constant and the tracker's message reverted, `image limits: 65 images were not planned: image resource limit exceeded`, and the device test refuses with `image resource limit exceeded`. - **GitHub's runners** ([run 40055234901](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40055234901), against #10000's head 12b89239c7, ×10 after): - **Linux:** both new tests fail before; after, 17 run, 17 pass, 0 skip, 0 fail. - **Windows:** `agc_shader_image_limits` fails before; after, 17 run, 16 pass, 1 skip (`agc_driver_many_images`, no Vulkan device), 0 fail. - The libc and libkernel suites pass on both, run with `APS5_SKIP_TIMING_TESTS=1`. - **Linux, CI's configure flags (lavapipe, on a cloud machine)**, on this change over #10000's earlier head 51a0116de: - CI's Linux job mirrored: 1,917 tests, 1,826 pass, 86 skip, 5 fail, the five being that machine's 4 IPv6 tests and the `agc_driver_sgpr_pattern_fill_keys` load race; - `--repeat until-fail:20` on the 33 `^agc_shader_` and 7 `image_table` tests, all 20 of 20. - **Validation layer** (Khronos 1.3.275, lavapipe, on a cloud machine), #10000's earlier head 51a0116de with and without this change, over `agc_driver_many_images`, `agc_driver_many_direct_samplers` and the 7 `agc_driver_image_table*` tests: identical VUIDs on both trees, only the known `VUID-VkDeviceCreateInfo-pNext-pNext` at device creation, and no new `VUID-`. On the base, `agc_driver_many_images` refuses before it dispatches; on this PR all 9 pass. - **e916c02082, a merge of #10000's d6061d4ce2, which merges `main` c9b2660d56.** Against that `main`, `ShaderDiskCache.hpp` differs only in `FormatVersion`, 47 to 54, and keeps `main`'s `LoadSharedPlan`; `ShaderDiskCache.cpp` and its test differ only in #10000's 64-bit `imageSamplers`. This head merges cleanly into `main` 30be9b428b. On GitHub's runners, 10 runs ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40100983331)) of the sampler, selected-record, image-sample and disk-cache sets (`^.*sampler`, `^.*selected_records`, `^.*image_sample`, `^.*disk_cache`) and the 12 other shader tests built from the changed files, `agc_shader_image_limits` among them: Linux 32 run, 32 pass, 0 skip, 0 fail. Windows 34 run, 22 pass, 12 skip (no Vulkan device), 0 fail. The libc and libkernel suites pass on both (123 and 204 tests on Linux, 150 and 217 on Windows), run with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Validation layer, `main` c9b2660d56 against e916c02082** (CONTRIBUTING's AGC rule), on GitHub's Linux runner (llvmpipe, LLVM 20.1.2), with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1` and `ctest -V`. `main`'s arm runs `main`'s implementation of every file this stack changes, #10000's included. - [Run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40109671150): the sampler, selected-record, image-sample and disk-cache sets with the other shader tests built from the changed files. 32 pass with this PR and 29 on `main`; the layer was inserted 12 and 11 times. - [Run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40118526618): `agc_driver_many_images`, `agc_driver_many_direct_samplers` and the 7 `agc_driver_image_table*` tests, with the other shader tests. 26 pass with this PR and 22 on `main`; the layer was inserted 10 and 8 times. - Neither log has `was not found but was requested`, both trees report only `VUID-VkDeviceCreateInfo-pNext-pNext`, and this PR adds no `VUID-` message. `agc_shader_image_limits` and `agc_driver_many_images`, and #10000's `agc_shader_sampler_limits` and `agc_driver_many_direct_samplers`, don't exist on `main`, so only this PR's tree runs them. - **Ghostrunner (PPSA03685), a replay by @TheSovietWaffle** ([comment](https://github.com/boykopovar/AnyPS5/pull/8939#issuecomment-6542139251)): this PR's ce4d6f48c3 merged with #9633's 217e3d7b1f and #10000's e7b14b0e8e. The only conflicts were `FormatVersion` and the debt docs. It's the same `shader_200c520000.prepare.req`, dumped on `main` 74acfad65, and the same `agc_shader_replay --prepare` with `ANYPS5_NO_SHADER_CACHE=1` as [their run without this PR](https://github.com/boykopovar/AnyPS5/pull/8939#issuecomment-6542038051). CPU replay only. - Without this PR, that stack stops on `image resource limit exceeded`. - With it, the request gets past the image limit and stops on `sampler resource limit exceeded`, the 64-sampler cap. - Their counts from the `srt` IR (on the #9969 stack): 1,047 `GetImageResource` and 941 `GetSamplerResource`, 619 of them with distinct argument tuples. These are SSA tuples, not distinct memory locations. - **ce2ba44d38, a merge of #10000's merge of `main` (d82e3f9552)** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40187794170)). No conflict of its own; this PR's diff over #10000 is unchanged. The sampler, selected-record, disk-cache, image-table and `agc_shader_image_limits` tests pass 10 runs in a row. Linux: 27 run, 27 pass, 0 skip, 0 fail. Windows: 29 run, 23 pass, 6 skip (the `agc_driver_image_table` tests, no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (144 and 207) and on Windows (171 and 223). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **NVIDIA GeForce RTX 5070 Ti (621.01) and an AMD Radeon RDNA2 iGPU (AMD 2026.04.17), Windows 11, by @wachi35676** ([comment](https://github.com/boykopovar/AnyPS5/pull/10489#issuecomment-6403457766)): WinLibs GCC 15.2.0, Release, this PR's ce2ba44d38 merged onto `main` aeff26bd9, `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`, no validation layer. The 64 image, sampler, record, disk-cache, image-table and `agc_shader_` entries pass on both GPUs; with `ShaderInfo::MaxImages` set back to 64, `agc_shader_image_limits` and `agc_driver_many_images` fail on both. A local variant of `ManyImages.cpp` with 64 table T#s next to the 64 direct ones, in both orders, binds `64 image table elements and 64 heap elements` with every output word holding its own image's texel and nothing written past them; 129 images refuse with `image resource limit exceeded (129 of 128)`. Of 253 `agc_` entries the only failure, with and without this PR, is `agc_driver_depth_plane_partial_store` (#10664). - **ef7c065124 and 0fd6998a10, a merge of #10000's merge of `main` 85f8e11372, and a trim of this PR's debt entry** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40341523407)). In the Windows `set_tests_properties` line of `core/libs/prx/libSceAgcDriver/CMakeLists.txt`, the merge keeps `main`'s three result-memo budget tests (#9989) with #10000's `agc_shader_sampler_limits` and this PR's `agc_shader_image_limits`; this PR's diff over #10000 is otherwise unchanged, and `FormatVersion` stays 54. 0fd6998a10 brings the image-table entry in `docs/dev/debt/shader.md` under the `debt-length` limit, from 1069 characters to 989, as the reply to wachi35676's run said it would: the masked-key case joins the sentence on the unevaluated key, and the reason clause goes; the behaviour it records is the same. The `agc_shader_` tests with the tests built from the files the merge changes pass 10 runs in a row. Linux: 321 run, 311 pass, 10 skip (seven AGC tests on lavapipe and three video-out tests with no display or Vulkan device), 0 fail. Windows: 347 run, 260 pass, 87 skip (84 AGC tests and the same three video-out tests, no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (145 and 211) and on Windows (174 and 232). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **254fb9018c, a merge of #10000's aa94587021** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40640598845)), which brings #10000's merge of `main` 0c5401dcbd and its two test-only commits: the refusal checks @oneandonlydean listed on #10000 go, and `agc_driver_many_direct_samplers` skips on a device with fewer than 33 samplers per stage or set (@jotitadev's MoltenVK run). No conflicts; `FormatVersion` stays 54, and this PR's changed lines over #10000 are the same. The image-limit, sampler-limit, image-table, sample-order, shader and disk-cache tests ran 10 times with no failure. Linux: 26 run, 26 pass, 0 skip, 0 fail. Windows: 28 run, 25 pass, 3 skip (`agc_driver_image_table`, `agc_driver_many_direct_samplers` and `agc_driver_sample_order`; no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (166 and 264). On Windows libc passes (194), and libkernel passes 283 of 286: `exec_arguments`, `guest_timed_join_import_libkernel_sys` and `guest_timed_join_import_libkernel_web` fail at their setup in the verify's Windows build (`FileNotFoundError` starting the title, or copying the libraries they load), and pass in `main`'s own Windows job at 1829def9bf ([job](https://github.com/boykopovar/AnyPS5/actions/runs/40627345977/job/122615375186)). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Apple M2 Max with MoltenVK, by @jotitadev** ([review](https://github.com/boykopovar/AnyPS5/pull/10489#pullrequestreview-5664914355)), on 0fd6998a10 over `main` b87d3d87e2 with the macOS port PRs and one local patch (`FormatVersion` resolved to 54): MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0) and MoltenVK `main` with SPIRV-Cross #2704, `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`. - **Green:** `agc_driver_many_images` and `agc_shader_image_limits` pass 3 of 3 on both drivers (MoltenVK's `maxPerStageDescriptorSampledImages` is 256). - **Red:** with `ShaderInfo::MaxImages` set back to 64, both fail 3 of 3 on both drivers with `image resource limit exceeded (65 of 64)`. - **Validation layer** (SDK driver): only `VUID-vkCreateDescriptorSetLayout-support-09582` (×2) in `agc_driver_many_images`, the image-table layout MoltenVK's layout-support query rejects (KhronosGroup/MoltenVK#2573), as in the existing image-table tests on the base. - **`^agc`:** the base's failures plus `agc_driver_many_direct_samplers`, from #10000, on MoltenVK's 16 samplers per stage; #10000's aa94587021 now skips it on such a device. One `agc_driver_lds_subword_store_branch` failure on MoltenVK `main` passes 5 of 5 alone and is the LDS-barrier test #10858 targets. - **b198906a61, a merge of #10000's 7f4e97c45f**, which carries `main` 94fe1b5c5a and with it #11507's `FormatVersion` 49 ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40665897095)). Clean: `FormatVersion` stays 54 (see What), and this PR's diff over #10000 is the same. The image-limit, sampler-limit, image-table and sample-order tests with the disk-cache, bindless and shader-memory tests and #11507's `agc_driver_image_sample_short_cube` ran 10 times with no failure. Linux: 27 run, 27 pass, 0 skip, 0 fail. Windows: 29 run, 25 pass, 4 skip (the Vulkan device tests), 0 fail. Suites: libc and libkernel pass on Linux (166 and 265). On Windows libc passes (194), and libkernel passes 284 of 287: `exec_arguments`, `guest_timed_join_import_libkernel_sys` and `guest_timed_join_import_libkernel_web` fail at their setup in the verify's Windows build (`FileNotFoundError` starting the title, or copying the libraries they load), with `main`'s code too, and pass in `main`'s own Windows job at 1829def9bf ([job](https://github.com/boykopovar/AnyPS5/actions/runs/40627345977/job/122615375186)). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **1e5eb0cc71, a merge of #10000's merge of `main` 0836dfdf4f** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41239658807), on e7c504633b, which has the same tree). #12862 moved `libSceAgcDriver`'s test registrations into `tests/cmake/`; the conflict in `CMakeLists.txt` is resolved with `tools/agc_test_split.py resolve`, which moves this PR's registration of `agc_shader_image_limits` into `tests/cmake/agc_shader_memory_tests.cmake` (+3 −2 against #10000's merge). Nothing else conflicted. Apart from the move, this PR's diff is unchanged. With `-DBUILD_TESTING=ON`, `ctest -N` gives 3079 tests: `main`'s 3075 plus this PR's and #10000's 4 tests, each listed once. The 11 tests of this PR's verify set pass 10 runs in a row. Linux: 11 run, 11 pass, 0 skip, 0 fail. Windows: 11 run, 8 pass, 3 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (199 and 308) and on Windows (226 and 330). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Validation layer, `main` 8a4fc62318 against this head 1e5eb0cc71** (CONTRIBUTING's AGC rule, refreshed for @MarcZX10's [review](https://github.com/boykopovar/AnyPS5/pull/10489#pullrequestreview-5725505198)), on GitHub's Linux runner ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41254595799)). - **The setup:** llvmpipe (LLVM 20.1.2), Mesa 25.2.8, Ubuntu 24.04.5, with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1` and `ctest -V`. - **The head's arm is a verify-only commit** whose tree is byte-identical to 1e5eb0cc71's, with `main` 8a4fc62318 as a second parent, so the runner can check out both arms. - **The tests:** this PR's set (the shader sampler and image limit tests, `agc_driver_many_images`, `agc_driver_many_direct_samplers`, `agc_driver_image_sample_reduction`, `agc_shader_disk_cache`, `agc_shader_memory`, `agc_shader_selected_records_*`), plus the tests the harness maps from the files that differ between the two trees. - **The layer** was inserted 1 time on `main` and 3 times with this head, and neither log has `was not found`. - **The result:** both logs report only `VUID-VkDeviceCreateInfo-pNext-pNext`, which is on `main`, so this head adds none. With this head, 31 run, 31 pass. `main`'s arm passes the tests it has. - **NVIDIA, TechLevelZero's GPU runner** ([report](https://github.com/boykopovar/AnyPS5/pull/10489#issuecomment-6550672796)): 1e5eb0cc71 merged onto `main` 0836dfdf4f, NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Linux. Passed: 2,450 passed, 0 new failures (4 fail on `main` too, and 2 are unstable there), and no new validation IDs against `main` over 930 tests run on the GPU. - **9a7315f239, a merge of #10000's 760a550294, which merges `main` 88e804b0a7** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41415859723)). #10000's merge brings Ondra97's #7694 and JJenkx's #6959 (see #10000). The conflicts were this PR's lines beside #10000's and `main`'s at the same places, and the merge keeps both: its `--image-limits` case in `ShaderMemory.cpp` and its `agc_shader_image_limits` registration in `agc_shader_memory_tests.cmake`, next to #7694's `agc_shader_descriptor_phis`. `FormatVersion` stays 54, and this PR's diff over #10000 is unchanged. The image-limit, sampler-limit, selected-record, disk-cache and shader-memory tests, with `agc_driver_image_sample_reduction`, `agc_driver_many_direct_samplers` and `agc_driver_many_images`, pass 10 runs in a row. Linux: 13 run, 13 pass, 0 skip, 0 fail. Windows: 15 run, 12 pass, 3 skip (those three `agc_driver_` tests; no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **f3fb2905a4: 306ed92696, 688024e6aa0, 4a58386f5f and f3fb2905a4**, for XairRrR's [review](https://github.com/boykopovar/AnyPS5/pull/10489#pullrequestreview-5744828513) ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41626889174), [red](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41626919620)). - **306ed92696** merges #10000's ba833f42c0f, which checks the pair-limit merge without compiling it, and **688024e6aa0** merges `main` 5cb015caaa. Both are clean. - **4a58386f5f** splits `agc_shader_image_limits` into `agc_shader_image_limits_table` (65 and 128 table images), `agc_shader_image_limits_mixed` (64 table and 64 direct images) and `agc_shader_image_limits_refusals` (129 images). - **f3fb2905a4** gives `FmaskFormatBase` its own range of `ShaderInfo::MaxImages` IDs, with the `static_assert`s above. `agc_shader_image_limits_mixed` adds an FMASK direct image at index 64 beside a sampler that mirrors when unnormalized, and checks that no specialization ID is emitted twice. - **Red:** f3fb2905a4's tests with the old `DescriptorBindingBuilder.cpp` and `PipelineSpecialization.hpp` fail `agc_shader_image_limits_mixed` on both runners: "image limits: image 64's FMASK format shares a specialization ID with another constant, such as sampler 0's mirror axes". - **×10:** the image-limit, sampler-limit, selected-record, disk-cache and image-sample tests. Linux: 14 run, 14 pass, 0 skip, 0 fail. Windows: 16 run, 13 pass, 3 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 279 and 321 tests on Linux and 306 and 342 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Test times** on GitHub's Linux runner (lavapipe, four tests at a time, the longest of the 10 runs): `agc_shader_image_limits_table` 13.2 s, `agc_shader_image_limits_mixed` 8.8 s, `agc_shader_image_limits_refusals` 0.1 s, `agc_shader_sampler_limits` 10.2 s, `agc_shader_selected_records_image_limit` 9.7 s, `agc_shader_selected_records_direct_image_limit` 9.4 s, `agc_shader_selected_records_pair_limit` 0.2 s and `agc_shader_selected_records_direct_pair_limit` 0.2 s. - **02ace33cfa, a merge of `main` 4f41f4c375** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41658417645)). - **Why:** it only resolves the two merge bases this branch had with `main`, left by merging #10000's ba833f42c0f (306ed92696) before #10000 landed. GitHub showed them as a conflict, though git merges the branch with `main` cleanly. No file needed a resolution (`git show --remerge-diff` is empty), so the merge adds no change of its own. - **×10:** `agc_driver_image_sample_reduction`, `agc_driver_many_direct_samplers`, `agc_driver_many_images`, `agc_shader_sampler_limits` and every test matching `^agc_shader_disk_cache`, `^agc_shader_selected_records_` or `^agc_shader_image_limits`. Linux: 14 run, 14 pass, 0 skip, 0 fail. Windows: 16 run, 13 pass, 3 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 300 and 322 tests on Linux and 327 and 342 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **GPUs, at f3fb2905a4 merged onto `main` 4f41f4c:** TechLevelZero's NVIDIA bot, RTX 2000 Ada, driver 595.99.02 ([report](https://github.com/boykopovar/AnyPS5/pull/10489#issuecomment-6608090049)): 2,766 passed, 7 failed, none new (3 also fail on `main`, 4 unstable on `main`), 48 skipped, with no new validation IDs (936 tests on the GPU). Its AMD bot, Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8; [report](https://github.com/boykopovar/AnyPS5/pull/10489#issuecomment-6608230341)): 2,753 passed, 10 failed, none new (8 also fail on `main`, 2 unstable on `main`), 58 skipped, with no new validation IDs (936 tests on the GPU). - **54bd6f2cc6, a merge of `main` 086c0686c8,** which brings fma-rc's #9183 ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41703250465)). - **The conflict:** `PipelineSpecialization.hpp`, where #9183 adds `VolumeGatherBase` at 57664 next to this PR's moved `FmaskFormatBase`. The merge keeps it at 57856 (see What). It also changes `DescriptorBindingBuilder.cpp`, which didn't conflict: `FmaskFormatBase`'s `static_assert` now ends at `VolumeGatherBase`, and a new one keeps `VolumeGatherBase` + 128 at or below `ImageComponentBase`. This PR's other lines are unchanged. - **×10:** `agc_driver_image_sample_reduction`, `agc_driver_many_direct_samplers`, `agc_driver_many_images`, `agc_shader_sampler_limits` and every test matching `^agc_shader_disk_cache`, `^agc_shader_selected_records_`, `^agc_shader_image_limits` or `^agc_driver_image_gather`, which takes in #9183's gather tests. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 19 run, 13 pass, 6 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 300 and 324 tests on Linux and 330 and 342 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` test, once** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41703277704)): Linux: 1,294 run, 1,209 pass, 84 skip, 1 fail. Windows: 1,331 run, 403 pass, 928 skip (no Vulkan device), 0 fail. The one failure is `agc_driver_pipeline_journal`'s 120-second timeout (`Test #1393: agc_driver_pipeline_journal ***Timeout 120.06 sec`). - **That timeout is `main`'s own cold run, near the limit.** `main` 086c0686c8 times out the same way under `ctest -V` ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41736700046)): `Test #1392: agc_driver_pipeline_journal ***Timeout 120.06 sec`. With a 300-second limit, 5 runs each on GitHub's Linux runner, both pass 5 of 5: | `agc_driver_pipeline_journal` | First (cold) run | Warm runs | Warm median | |---|---|---|---| | This merge, 54bd6f2cc6 ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41743706005)) | 125.8 s | 45.8, 46.4, 46.0, 46.1 s | 46.1 s | | `main` 086c0686c8 ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41743726570)) | 135.9 s | 49.7, 50.1, 49.4, 49.7 s | 49.7 s | In both, one slow step of the cold run is a journal reload that drops an unreadable tail (16 to 22 s in the verbose runs). - **NVIDIA RTX 2000 Ada Generation** at 54bd6f2cc6, from TechLevelZero's NVIDIA bot ([report](https://github.com/boykopovar/AnyPS5/pull/10489#issuecomment-6620117780)): this head merged onto `main` 1c8c0ef, driver 595.99.02. 2,792 passed, 6 failed (none new: 3 also fail on `main`, 3 unstable on `main`), 50 skipped. This PR's `agc_shader_image_limits_table`, `agc_shader_image_limits_mixed` and `agc_shader_image_limits_refusals` passed on the GPU. - **AMD Radeon RX 6300 (RADV NAVI24)** at 54bd6f2cc6, from TechLevelZero's AMD bot ([report](https://github.com/boykopovar/AnyPS5/pull/10489#issuecomment-6620231929)): the same merge, Mesa 25.2.8. 2,778 passed, 9 failed (none new: 7 also fail on `main`, 2 unstable on `main`), 61 skipped. The same three tests passed on the GPU. - **9544416ba9, a merge of `main` c2eafe4461,** which brings yabanana's #7223 ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41774045959)). - **The conflict:** `FormatVersion` in `ShaderDiskCache.hpp`. `main` reached 56 with #7223, so this merge moves #10489 from 54 to 57, the next number no open PR holds. This PR's other lines are unchanged. - **×10:** the same tests as on 54bd6f2cc6. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 19 run, 13 pass, 6 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 301 and 325 tests on Linux and 331 and 343 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **NVIDIA RTX 2000 Ada Generation**, from TechLevelZero's NVIDIA bot ([report](https://github.com/boykopovar/AnyPS5/pull/10489#issuecomment-6626188512)): this head merged onto `main` 5b1d381, driver 595.99.02. 2,840 passed, 5 failed (none new: 3 also fail on `main`, 2 unstable on `main`), 50 skipped, with no new validation IDs (981 tests on the GPU). - **AMD Radeon RX 6300 (RADV NAVI24)**, from TechLevelZero's AMD bot ([report](https://github.com/boykopovar/AnyPS5/pull/10489#issuecomment-6650177235)): this head merged onto `main` b611e63, Mesa 25.2.8. 2,872 passed, 10 failed (none new: 9 also fail on `main`, 1 unstable on `main`), 60 skipped, with no new validation IDs (992 tests on the GPU). - On both GPUs, this PR's `agc_shader_image_limits_table`, `agc_shader_image_limits_mixed` and `agc_shader_image_limits_refusals`, and `agc_driver_many_images`, ran with validation and passed. Both reports list the four as not in `main`'s validation baseline. - **GitHub's `windows` check is red at this head** on one test, `avplayer_http_patched_modules`, at `AvPlayerHttpModules.cmake:155`, where the owner executable `avplayer_http_patched_modules_tests.exe` wasn't built for the selected test ([job](https://github.com/boykopovar/AnyPS5/actions/runs/41781617882/job/126414273267)). JJenkx's #15375, which builds the owners of wrappers around selected guest tests, has since merged (bfd14d1260, 11-04 23:28Z). This PR changes no avplayer or HTTP file. - **e62603545a: 482e813ba3, a merge of `main` ea07ec82d3 (9c0f71e1fa) and e62603545a**, after danielhorngt's #14621 ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42129873241), [validation](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42129898990)). - **482e813ba3**, before the merge, moves `FmaskFormatBase` from 57728 to 58048 and `VolumeGatherBase` from 57856 to 58176, so the merge itself keeps both sides. - **The conflict:** `PipelineSpecialization.hpp`, where `main`'s `SamplerLodBiasBase` and `SamplerLodBiasShaderThreshold` lines now come before this PR's moved bases. #14621's lines in `DescriptorBindingBuilder.cpp` and `SpirvImageEmitter.cpp` merged without a conflict. `FormatVersion` stays 57. - **e62603545a:** the chain's `MinLodBase + ShaderInfo::MaxImages <= FmaskFormatBase` becomes `<= SamplerLodBiasBase`, followed by `SamplerLodBiasBase + ShaderInfo::MaxSamplers <= FmaskFormatBase`. - **×10:** the image-limit, sampler-limit, selected-record, disk-cache and shader-memory tests, `agc_driver_image_sample_reduction`, `agc_driver_many_direct_samplers` and `agc_driver_many_images`, with #14621's `agc_driver_image_sample_lod_bias_sum` and `agc_driver_graphics`. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 19 run, 15 pass, 4 skip (`agc_driver_image_sample_lod_bias_sum`, `agc_driver_image_sample_reduction`, `agc_driver_many_direct_samplers` and `agc_driver_many_images`, no Vulkan device), 0 fail. The libc and libkernel suites run 323 and 334 tests on Linux and 354 and 365 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Validation** (CONTRIBUTING's recompiler rule): `VK_LAYER_KHRONOS_validation` on GitHub's Linux runner, llvmpipe (LLVM 20.1.2). `main`'s tree ran 13 of these tests and passed 13. This head ran 17, the 13 plus `agc_shader_image_limits_table`, `_mixed` and `_refusals` and `agc_driver_many_images`, which `main` doesn't have, and passed 17. The only VUID is `VUID-VkDeviceCreateInfo-pNext-pNext`, on both, so this change adds none. - **Red on Windows:** the same run built this PR's tests against `main`'s implementation, where `agc_shader_image_limits_table`, `_mixed` and `_refusals` fail (`image limits: 65 images were not planned: image resource limit exceeded`). They pass here. - It merges cleanly with `main` 01f804bb2f. - **d5b9ccdb80: d1d8e3ef93, a merge of `main` 090f57166a, and the format commit d5b9ccdb80** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42374868296)). - **d1d8e3ef93** merges cleanly. `main` has frankea's #9020, which also changes `FormatVersion` from 56 to 57, so git took the line without a conflict and left this PR on `main`'s number. - **d5b9ccdb80** moves `FormatVersion` from 57 to 58 (see What) and changes no other line. This PR's other lines over `main` are unchanged. - **×10:** the same tests as on e62603545a. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 19 run, 15 pass, 4 skip (the same four, no Vulkan device), 0 fail. The libc and libkernel suites run 327 and 344 tests on Linux and 358 and 371 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **74407aac46: `FormatVersion` from 58 to 60** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42389505906)). - frankea's #10049 and ntamas94's #14032 also hold 58, which git would merge with this PR's 58 without a conflict. 74407aac46 moves the line to 60 (see What) and changes no other line. - **×10:** the same tests as on d5b9ccdb80. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 19 run, 15 pass, 4 skip (the same four, no Vulkan device), 0 fail. The libc and libkernel suites run 327 and 344 tests on Linux and 358 and 371 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. ### 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 (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none. #10000, which this PR was stacked on, has merged, as have #9989 and #10440, which each share one line with this PR (`libSceAgcDriver/CMakeLists.txt` and `DescriptorBindingBuilder.cpp`); this head keeps both. Any order with the others: #12944, #9889 and #9897 hold `FormatVersion` 57, now `main`'s, and #15343 (59) and #9508 (61) change the same line. #12790's `static_assert` and the 8384 of #7085 and #6280 meet this PR's ranges (see What), so whichever lands second moves to a free number or base. #14621, which took 57728, has merged, and this head's bases sit above it. savvaniss's #9897 and ntamas94's #14032 also add a test to the Windows `set_tests_properties` line of `agc_shader_memory_tests.cmake`; whichever lands second keeps both - [x] Fixes: none - [x] Unblocks: Ghostrunner (PPSA03685) #7320: compute shader 0x200c520000 past 64 images, by offline replay ([TheSovietWaffle's](https://github.com/boykopovar/AnyPS5/pull/8939#issuecomment-6542139251), with #9633 and #10000); the next stop is `sampler resource limit exceeded`, the 64-sampler cap - [x] GPUs tested: lavapipe (llvmpipe), on GitHub's Linux runner and on a cloud machine; NVIDIA GeForce RTX 5070 Ti (621.01) and an AMD Radeon RDNA2 iGPU, Windows 11 (wachi35676) - [x] AI-assisted: yes
MarcZX10 commented 2026-10-24 15:56:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T15:56:21Z.

Review: CHANGES_REQUESTED


I reviewed the current diff and reported image-limit tests. Two integration/verification items remain. First, git merge-tree against current upstream main (3fcb5e4d76) conflicts in core/shader/recompiler/ShaderDiskCache.hpp: this branch sets FormatVersion to 51 and removes LoadSharedPlan, while main still has version 47 and that declaration. The body says this PR goes after #10000, #9989 and #10440, and its format-version sequence also cites #9969, but the checklist lists only #10000 as a dependency. Please make the full predecessor/landing order explicit and resolve the conflict without dropping either side's cache changes when the predecessors land. Second, this is an AGC/shader-recompiler change. The report's paired validation run compares against #10000's earlier head 51a0116de, not current main; the repository requires the same focused tests on main and the change on the same GPU with the required Vulkan validation environment and no new VUIDs. Please attach that current-main comparison (or update the evidence after the dependency stack lands). I did not approve this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638863619 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10489#pullrequestreview-5638863619). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T15:56:21Z. **Review:** CHANGES_REQUESTED --- I reviewed the current diff and reported image-limit tests. Two integration/verification items remain. First, `git merge-tree` against current upstream main (3fcb5e4d76) conflicts in `core/shader/recompiler/ShaderDiskCache.hpp`: this branch sets `FormatVersion` to 51 and removes `LoadSharedPlan`, while main still has version 47 and that declaration. The body says this PR goes after #10000, #9989 and #10440, and its format-version sequence also cites #9969, but the checklist lists only #10000 as a dependency. Please make the full predecessor/landing order explicit and resolve the conflict without dropping either side's cache changes when the predecessors land. Second, this is an AGC/shader-recompiler change. The report's paired validation run compares against #10000's earlier head `51a0116de`, not current `main`; the repository requires the same focused tests on main and the change on the same GPU with the required Vulkan validation environment and no new VUIDs. Please attach that current-main comparison (or update the evidence after the dependency stack lands). I did not approve this head.
jotitadev commented 2026-10-27 09:32:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T09:32:32Z.

Review: COMMENTED


Apple GPU run of head 0fd6998a10: agc_driver_many_images goes red to green on MoltenVK. The stacked agc_driver_many_direct_samplers from #10000 fails on MoltenVK's 16-sampler per-stage limit; details are in my review on #10000.

Setup: Apple M2 Max, macOS 27.2, x86-64 Release under Rosetta 2. main doesn't build and run on macOS, so this is main b87d3d87e2 + the macOS port PRs (#7631 #11249 #11358 #10669 #10552 #7804 #11447 #11437 #11554) + one local patch (#11705's), with this PR merged on top. The only conflict was FormatVersion, which I resolved to 54. Two drivers: MoltenVK 1.4.2 from Vulkan SDK 1.4.363.0, and MoltenVK main with SPIRV-Cross#2704. ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, ctest -j1 --timeout 30.

  • Green: agc_driver_many_images and agc_shader_image_limits pass 3 of 3 on both drivers. MoltenVK's maxPerStageDescriptorSampledImages is 256, so the 64 direct images fit.
  • Red (ShaderInfo::MaxImages set back to 64): both fail 3 of 3 on both drivers. agc_driver_many_images stops with ShaderRecompiler::Recompile: image resource limit exceeded (65 of 64), and agc_shader_image_limits with 65 images were not planned: image resource limit exceeded (65 of 64).
  • Validation layer (SDK driver): the only VUID in agc_driver_many_images is VUID-vkCreateDescriptorSetLayout-support-09582 (×2). It's the image-table layout that MoltenVK's vkGetDescriptorSetLayoutSupport rejects without accounting for update-after-bind (KhronosGroup/MoltenVK#2573), and the same VUID shows up in the existing image-table tests on the base.
  • Suite: ^agc has the same failures as the base on both drivers, plus agc_driver_many_direct_samplers. The MoltenVK main suite run also had one agc_driver_lds_subword_store_branch failure (thread 96 (wave 3) read 673754884, expected 262176). That test passes 5 of 5 alone and is the LDS-barrier test that #10858 targets, so it isn't from this change.

GPUs tested: Apple M2 Max (MoltenVK 1.4.2 / MoltenVK main + SPIRV-Cross#2704), macOS 27.2

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

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5664914355 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10489#pullrequestreview-5664914355). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-27T09:32:32Z. **Review:** COMMENTED --- Apple GPU run of head `0fd6998a10`: `agc_driver_many_images` goes red to green on MoltenVK. The stacked `agc_driver_many_direct_samplers` from #10000 fails on MoltenVK's 16-sampler per-stage limit; details are in my review on #10000. **Setup:** Apple M2 Max, macOS 27.2, x86-64 Release under Rosetta 2. `main` doesn't build and run on macOS, so this is `main` `b87d3d87e2` + the macOS port PRs (#7631 #11249 #11358 #10669 #10552 #7804 #11447 #11437 #11554) + one local patch (#11705's), with this PR merged on top. The only conflict was `FormatVersion`, which I resolved to 54. Two drivers: MoltenVK 1.4.2 from Vulkan SDK 1.4.363.0, and MoltenVK `main` with SPIRV-Cross#2704. `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`, `ctest -j1 --timeout 30`. - **Green:** `agc_driver_many_images` and `agc_shader_image_limits` pass 3 of 3 on both drivers. MoltenVK's `maxPerStageDescriptorSampledImages` is 256, so the 64 direct images fit. - **Red** (`ShaderInfo::MaxImages` set back to 64): both fail 3 of 3 on both drivers. `agc_driver_many_images` stops with `ShaderRecompiler::Recompile: image resource limit exceeded (65 of 64)`, and `agc_shader_image_limits` with `65 images were not planned: image resource limit exceeded (65 of 64)`. - **Validation layer** (SDK driver): the only VUID in `agc_driver_many_images` is `VUID-vkCreateDescriptorSetLayout-support-09582` (×2). It's the image-table layout that MoltenVK's `vkGetDescriptorSetLayoutSupport` rejects without accounting for update-after-bind (KhronosGroup/MoltenVK#2573), and the same VUID shows up in the existing image-table tests on the base. - **Suite:** `^agc` has the same failures as the base on both drivers, plus `agc_driver_many_direct_samplers`. The MoltenVK `main` suite run also had one `agc_driver_lds_subword_store_branch` failure (`thread 96 (wave 3) read 673754884, expected 262176`). That test passes 5 of 5 alone and is the LDS-barrier test that #10858 targets, so it isn't from this change. GPUs tested: Apple M2 Max (MoltenVK 1.4.2 / MoltenVK main + SPIRV-Cross#2704), macOS 27.2 Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
MarcZX10 commented 2026-10-31 23:51:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T23:51:06Z.

Review: CHANGES_REQUESTED


Re-checked — new head, validation pending

Head 1e5eb0cc718a2bf01490ccec7c5940e6c068bf67 merges cleanly with current main, but the required Vulkan comparison is still against older main and candidate commits.

What I ran

Reviewed head 1e5eb0cc718a2bf01490ccec7c5940e6c068bf67 against PR base 0836dfdf4fecb1e0326100c490476e15d3a74da5; the merge preview against current main b08c539c505c48341146c705bc72d9b603cdb3a7 was clean. Environment: Debian GNU/Linux 12, x86_64, Python 3.11.2, GCC 12.2.0. I ran no local build or GPU tests.

git diff --check b08c539c505c48341146c705bc72d9b603cdb3a7...refs/remotes/review/pr-10489
python3 tools/check_conventions.py --base 0836dfdf4fecb1e0326100c490476e15d3a74da5 --head 1e5eb0cc718a2bf01490ccec7c5940e6c068bf67
python3 tools/pr_stack_check.py 10489 --repo boykopovar/AnyPS5
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10489
git diff --name-only c9b2660d56 b08c539c505c48341146c705bc72d9b603cdb3a7
gh pr checks 10489 --repo boykopovar/AnyPS5

Results

Check Result
Diff and conventions Passed
Current-main merge preview Clean; stack check confirmed #10000's head is included and the declared order is clean
No-build precheck Completed on the exact head/base; diff, conventions and dependency/mergeability checks passed. Optional ABI and test-quality helper scripts are absent from the PR snapshot.
Hosted CI Windows job and platform build jobs passed. Linux, register-context and write-watch jobs were skipped. The PR's Windows GPU cases are reported as skipped because the runner has no Vulkan device.
Vulkan validation evidence in the PR The report compares main c9b2660d56 with candidate e916c02082; it does not compare current main b08c539c505c48341146c705bc72d9b603cdb3a7 with this reviewed head.
Unedited output excerpts
All conventions checks passed.
Target branch tip: `b08c539c505c48341146c705bc72d9b603cdb3a7`
Dependency order: #10000 → #10489
- PR #10489: **clean** against current base; head `1e5eb0cc718a2bf01490ccec7c5940e6c068bf67`
- #10000 → #10489: **head_included**
windows	pass	22m12s	https://github.com/boykopovar/AnyPS5/actions/runs/41250134486/job/124684089284
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41250134486/job/124684090725

Findings

Blocking

The PR changes AGC and shader-recompiler behavior, so the repository requires the same focused Vulkan tests on main and the change on the same machine/GPU with the validation layer, no shader cache, and ANYPS5_REQUIRE_VULKAN=1, then a comparison showing no new VUIDs. The PR's current report is pinned to main c9b2660d56 and candidate e916c02082, rather than current main b08c539c505c48341146c705bc72d9b603cdb3a7 and reviewed head 1e5eb0cc718a2bf01490ccec7c5940e6c068bf67. Current main has since changed overlapping shader-resource, shader-cache, test, and recompiler files, including ShaderResources.cpp, ShaderMemory.cpp, ShaderDiskCache.cpp, ResourceMaterializer.cpp, and ResourceTracker.cpp. The successful hosted Windows job does not close this gap because its GPU tests are skipped.

Please refresh the matched focused Vulkan comparison against current main and this exact head, report the exact machine/GPU and test scope, confirm the validation layer was inserted, and compare the logs for new VUIDs. No rebase is needed based on the current clean merge preview.

Non-blocking: None.

Sources

Not verified

  • Local build or GPU execution.
  • A matched Vulkan run using current main and the reviewed head.
  • Console gameplay; the PR's described Ghostrunner run is an offline CPU replay.

To get this to a good state

Add the refreshed matched validation report described above. I will recheck the current head and compare the same focused commands after the update.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5725505198 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10489#pullrequestreview-5725505198). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T23:51:06Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, validation pending Head `1e5eb0cc718a2bf01490ccec7c5940e6c068bf67` merges cleanly with current `main`, but the required Vulkan comparison is still against older `main` and candidate commits. ## What I ran Reviewed head `1e5eb0cc718a2bf01490ccec7c5940e6c068bf67` against PR base `0836dfdf4fecb1e0326100c490476e15d3a74da5`; the merge preview against current `main` `b08c539c505c48341146c705bc72d9b603cdb3a7` was clean. Environment: Debian GNU/Linux 12, x86_64, Python 3.11.2, GCC 12.2.0. I ran no local build or GPU tests. ```sh git diff --check b08c539c505c48341146c705bc72d9b603cdb3a7...refs/remotes/review/pr-10489 python3 tools/check_conventions.py --base 0836dfdf4fecb1e0326100c490476e15d3a74da5 --head 1e5eb0cc718a2bf01490ccec7c5940e6c068bf67 python3 tools/pr_stack_check.py 10489 --repo boykopovar/AnyPS5 python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10489 git diff --name-only c9b2660d56 b08c539c505c48341146c705bc72d9b603cdb3a7 gh pr checks 10489 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Diff and conventions | Passed | | Current-main merge preview | Clean; stack check confirmed #10000's head is included and the declared order is clean | | No-build precheck | Completed on the exact head/base; diff, conventions and dependency/mergeability checks passed. Optional ABI and test-quality helper scripts are absent from the PR snapshot. | | Hosted CI | Windows job and platform build jobs passed. Linux, register-context and write-watch jobs were skipped. The PR's Windows GPU cases are reported as skipped because the runner has no Vulkan device. | | Vulkan validation evidence in the PR | The report compares `main` `c9b2660d56` with candidate `e916c02082`; it does not compare current `main` `b08c539c505c48341146c705bc72d9b603cdb3a7` with this reviewed head. | <details><summary>Unedited output excerpts</summary> ```text All conventions checks passed. ``` ```text Target branch tip: `b08c539c505c48341146c705bc72d9b603cdb3a7` Dependency order: #10000 → #10489 - PR #10489: **clean** against current base; head `1e5eb0cc718a2bf01490ccec7c5940e6c068bf67` - #10000 → #10489: **head_included** ``` ```text windows pass 22m12s https://github.com/boykopovar/AnyPS5/actions/runs/41250134486/job/124684089284 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41250134486/job/124684090725 ``` </details> ## Findings **Blocking** The PR changes AGC and shader-recompiler behavior, so the repository requires the same focused Vulkan tests on `main` and the change on the same machine/GPU with the validation layer, no shader cache, and `ANYPS5_REQUIRE_VULKAN=1`, then a comparison showing no new VUIDs. The PR's current report is pinned to `main` `c9b2660d56` and candidate `e916c02082`, rather than current `main` `b08c539c505c48341146c705bc72d9b603cdb3a7` and reviewed head `1e5eb0cc718a2bf01490ccec7c5940e6c068bf67`. Current main has since changed overlapping shader-resource, shader-cache, test, and recompiler files, including `ShaderResources.cpp`, `ShaderMemory.cpp`, `ShaderDiskCache.cpp`, `ResourceMaterializer.cpp`, and `ResourceTracker.cpp`. The successful hosted Windows job does not close this gap because its GPU tests are skipped. Please refresh the matched focused Vulkan comparison against current main and this exact head, report the exact machine/GPU and test scope, confirm the validation layer was inserted, and compare the logs for new VUIDs. No rebase is needed based on the current clean merge preview. **Non-blocking:** None. ## Sources - [Repository AGC validation rule at current main](https://github.com/boykopovar/AnyPS5/blob/b08c539c505c48341146c705bc72d9b603cdb3a7/CONTRIBUTING.md#L73) - [Overlapping shader-resource source at current main](https://github.com/boykopovar/AnyPS5/blob/b08c539c505c48341146c705bc72d9b603cdb3a7/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp) - [Overlapping resource materializer at current main](https://github.com/boykopovar/AnyPS5/blob/b08c539c505c48341146c705bc72d9b603cdb3a7/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp) - [Current-head hosted Windows job](https://github.com/boykopovar/AnyPS5/actions/runs/41250134486/job/124684089284) - [Current PR report and pinned test commits](https://github.com/boykopovar/AnyPS5/pull/10489) ## Not verified - Local build or GPU execution. - A matched Vulkan run using current main and the reviewed head. - Console gameplay; the PR's described Ghostrunner run is an offline CPU replay. ## To get this to a good state Add the refreshed matched validation report described above. I will recheck the current head and compare the same focused commands after the update.
XairRrR commented 2026-11-02 23:20:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T23:20:42Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The limits, the 64-bit masks and the counted refusals work. The new tests are red without the change and green with it. Two problems block it: on current main, direct images 64 to 127 get FMASK specialization IDs that collide with the per-sampler mirror IDs, and three of the tests now take over 30 s.

What I ran

Head 9a7315f239181a6afeb7b5036dd5874ae3141ae6, main 5cb015caaaaf83f8ee431414ee6a457b5b307d49, merged with --no-ff in a clean worktree (Debian 13 VM, 2× Xeon Gold 6136, GCC 14.2.0, lavapipe on Mesa 26.1.6 / LLVM 19, no GPU).

git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...9a7315f239181a6afeb7b5036dd5874ae3141ae6
python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -j8 --test-load 32 \
  -R '^(agc_driver_image_sample_lod_clamp_shader_lane|agc_shader_image_limits|agc_shader_sampler_limits|agc_driver_many_images|agc_driver_many_direct_samplers|agc_shader_selected_records_.*|agc_shader_disk_cache|agc_driver_image_sample_reduction)$'
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -j1 -R '^(agc_shader_selected_records_.*|agc_shader_image_limits|agc_shader_sampler_limits)$'
# negative control 1: ShaderInfo.hpp from main
git show 5cb015ca…:core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ShaderInfo.hpp > (same path)
ninja -C build agc_shader_memory_tests agc_driver_many_images_tests agc_driver_image_sample_lod_clamp_tests
ctest --test-dir build --output-on-failure -R '^(agc_driver_image_sample_lod_clamp_shader_lane|agc_shader_image_limits|agc_driver_many_images)$'
# negative control 2: all 12 production files from main, then main's ShaderMemory.cpp
ninja -C build agc_driver_image_sample_lod_clamp_tests agc_shader_memory_tests
ctest --test-dir build -R '^agc_driver_image_sample_lod_clamp_shader_lane$'
ctest --test-dir build -j1 -R '^agc_shader_selected_records_'
# restore every file from the merged tree 051c6da4250a8bd5bef4ce1af5f182472841b26b, rebuild, git status --porcelain (clean)

The script's build and selected test run (2240 tests) and its validation-layer comparison (761 tests) are in the results below.

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs OK
New tests (agc_shader_image_limits, agc_shader_sampler_limits, agc_driver_many_images, agc_driver_many_direct_samplers) pass
agc_shader_selected_records_*, agc_shader_disk_cache, agc_driver_image_sample_reduction pass
Script's new failure agc_driver_image_sample_lod_clamp_shader_lane comes from main: it fails the same way with all 12 production files restored from main (the baseline was the older 096c4557)
Script's new failure unwrap_self_…_destination_directory_group os.chown gives EINVAL in the sandbox's /tmp. This Python tool test is unrelated to the diff.
Validation layer (script, 761 tests, layer loaded in 760, none missing) 0 tests with a new VUID-
Test duration, run alone (-j1) over 30 s for three tests, see below
Durations on lavapipe, run alone
Test main (main's production and ShaderMemory.cpp) This PR
agc_shader_selected_records_pair_limit 6.2 s 35.7 s / 38.7 s
agc_shader_selected_records_direct_pair_limit 5.2 s 31.2 s / 37.8 s
agc_shader_selected_records_image_limit 5.8 s 14.5 s
agc_shader_selected_records_direct_image_limit 5.5 s 13.5 s
agc_shader_image_limits (new) — 32.7 s / 32.7 s
agc_shader_sampler_limits (new) — 14.8 s
lod_clamp failure, all production files from main
1/1 Test #1774: agc_driver_image_sample_lod_clamp_shader_lane ...***Failed    3.48 sec
AGC graphics: image_sample_lz through the S# that holds the LOD at 0 with T# MIN_LOD 768 over BASE_LEVEL 0 with a second S# of words 1 0 and 2 5242880, and a second T# of MIN_LOD 0 and LAST_LEVEL 0: thread 0 component 1 is 0.000000, expected 0.062500

Negative control

I restored only ShaderInfo.hpp from main (MaxImages 64, MaxSamplers 32, MaxSampledPairs 64) and rebuilt. Both new image tests fail with the counted message:

agc_shader_image_limits ... ***Failed  image limits: 65 images were not planned: image resource limit exceeded (65 of 64)
agc_driver_many_images  ... ***Failed  ShaderRecompiler::Recompile: image resource limit exceeded (65 of 64)

Then I restored every file from the merged tree and rebuilt. git status --porcelain is empty.

Findings

Blocking

  1. On main, FmaskFormatBase is indexed per image and leaves room for only 64 images. Direct images 64 to 127 collide with MirrorUnnormalizedBase. In core/shader/recompiler/PipelineSpecialization.hpp:50-51, FmaskFormatBase is 57472 and MirrorUnnormalizedBase is 57536 (main).

    • DescriptorBindingBuilder.cpp:448 pushes FmaskFormatBase + index, where index is the image index (main). SpirvImageEmitter.cpp declares FmaskFormatBase + resource the same way.
    • DescriptorBindingBuilder.cpp:400 pushes MirrorUnnormalizedBase + sampler (main).
    • With 128 images, a direct FMASK-expanded image at index 64+k (for example after 64 table images, the shape agc_shader_image_limits plans) gets spec ID 57536+k. That is the ID of sampler k's mirror axes, so one of the two constants gets the other's value and nothing reports it.
    • Neither base exists at the PR head: MirrorUnnormalizedBase came with main's e2f17064b8. The description's table of per-image ranges was therefore right for its base and is not right for the merged tree.
    • MinLodBase + image (57600 to 57727) fits only because nothing is above it yet.
    • Suggested fix: give FmaskFormatBase (and, to be safe, MinLodBase) a block of ShaderInfo::MaxImages IDs, for example above MinLodBase + 128. Add static_asserts that each per-image and per-sampler base plus its limit stays below the next base, so the next limit change or new base fails to compile. Add an FMASK direct image at index ≥ 64, next to a mirror-unnormalized S#, to the duplicate-ID check in agc_shader_image_limits, or extend that check to the whole plan.
  2. Three tests take over 30 s on lavapipe (CONTRIBUTING: "Each test finishes in 30 s on the CI runners … Split or shrink a test that gets close").

    • agc_shader_selected_records_pair_limit went from 6.2 s to 35.7 to 38.7 s, and agc_shader_selected_records_direct_pair_limit from 5.2 s to 31.2 to 37.8 s. Both were run alone on this machine.
    • The cause is the rescaled fixture: eight samplers per read (TableManySamplerSgprs, core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:4579, :4628), against the 256-pair limit.
    • The new agc_shader_image_limits (ShaderMemory.cpp:4842) takes 32.7 s, because it plans and compiles 65, 128, 64+64 and 129 images.
    • The image-limit selected-record tests also more than doubled, to 13.5 to 14.5 s.
    • Suggested fix: split --image-limits into separate modes (65/128 table images, the 64+64 mixed case, the refusals). For the pair-limit tests, the limit is reached with fewer reads if each read uses more samplers, or keep only the at-limit and limit+1 plans and drop the compile-and-bind of the merged table where another test covers it.

Non-blocking

None.

Not verified

  • Hardware GPUs. I ran only lavapipe. For the RTX 5070 Ti, the RDNA2 iGPU, the RTX 2000 Ada and MoltenVK I rely on the reports in the discussion.
  • I did not build a device test for the FMASK/mirror spec-ID collision. The finding comes from the code and the constants: 57472 + 64 = 57536.
  • The Ghostrunner replay. It is offline and title-specific, and no request dump is available here.
  • I did not time the CI runners themselves. These timings are from this 32-vCPU VM run with -j1, which is close to the lavapipe configuration CI uses.

To get this to a good state

  • Move FmaskFormatBase (and MinLodBase) to ranges that hold ShaderInfo::MaxImages entries, add static_asserts on every per-image and per-sampler range, and cover an FMASK direct image at index ≥ 64 in the duplicate-ID check.
  • Bring agc_shader_image_limits and the two selected-record pair-limit tests under 30 s on lavapipe, by splitting or shrinking them, and report the times.
  • Update the per-image range table in the description against current main.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5744828513 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10489#pullrequestreview-5744828513). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T23:20:42Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The limits, the 64-bit masks and the counted refusals work. The new tests are red without the change and green with it. Two problems block it: on current `main`, direct images 64 to 127 get FMASK specialization IDs that collide with the per-sampler mirror IDs, and three of the tests now take over 30 s. ## What I ran Head `9a7315f239181a6afeb7b5036dd5874ae3141ae6`, `main` `5cb015caaaaf83f8ee431414ee6a457b5b307d49`, merged with `--no-ff` in a clean worktree (Debian 13 VM, 2× Xeon Gold 6136, GCC 14.2.0, lavapipe on Mesa 26.1.6 / LLVM 19, no GPU). ```sh git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...9a7315f239181a6afeb7b5036dd5874ae3141ae6 python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -j8 --test-load 32 \ -R '^(agc_driver_image_sample_lod_clamp_shader_lane|agc_shader_image_limits|agc_shader_sampler_limits|agc_driver_many_images|agc_driver_many_direct_samplers|agc_shader_selected_records_.*|agc_shader_disk_cache|agc_driver_image_sample_reduction)$' ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -j1 -R '^(agc_shader_selected_records_.*|agc_shader_image_limits|agc_shader_sampler_limits)$' # negative control 1: ShaderInfo.hpp from main git show 5cb015ca…:core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ShaderInfo.hpp > (same path) ninja -C build agc_shader_memory_tests agc_driver_many_images_tests agc_driver_image_sample_lod_clamp_tests ctest --test-dir build --output-on-failure -R '^(agc_driver_image_sample_lod_clamp_shader_lane|agc_shader_image_limits|agc_driver_many_images)$' # negative control 2: all 12 production files from main, then main's ShaderMemory.cpp ninja -C build agc_driver_image_sample_lod_clamp_tests agc_shader_memory_tests ctest --test-dir build -R '^agc_driver_image_sample_lod_clamp_shader_lane$' ctest --test-dir build -j1 -R '^agc_shader_selected_records_' # restore every file from the merged tree 051c6da4250a8bd5bef4ce1af5f182472841b26b, rebuild, git status --porcelain (clean) ``` The script's build and selected test run (2240 tests) and its validation-layer comparison (761 tests) are in the results below. ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure / build / `libs` | OK | | New tests (`agc_shader_image_limits`, `agc_shader_sampler_limits`, `agc_driver_many_images`, `agc_driver_many_direct_samplers`) | pass | | `agc_shader_selected_records_*`, `agc_shader_disk_cache`, `agc_driver_image_sample_reduction` | pass | | Script's new failure `agc_driver_image_sample_lod_clamp_shader_lane` | **comes from `main`**: it fails the same way with all 12 production files restored from `main` (the baseline was the older `096c4557`) | | Script's new failure `unwrap_self_…_destination_directory_group` | `os.chown` gives EINVAL in the sandbox's `/tmp`. This Python tool test is unrelated to the diff. | | Validation layer (script, 761 tests, layer loaded in 760, none missing) | 0 tests with a new `VUID-` | | Test duration, run alone (`-j1`) | over 30 s for three tests, see below | <details><summary>Durations on lavapipe, run alone</summary> | Test | `main` (main's production and ShaderMemory.cpp) | This PR | |---|---|---| | `agc_shader_selected_records_pair_limit` | 6.2 s | 35.7 s / 38.7 s | | `agc_shader_selected_records_direct_pair_limit` | 5.2 s | 31.2 s / 37.8 s | | `agc_shader_selected_records_image_limit` | 5.8 s | 14.5 s | | `agc_shader_selected_records_direct_image_limit` | 5.5 s | 13.5 s | | `agc_shader_image_limits` (new) | — | 32.7 s / 32.7 s | | `agc_shader_sampler_limits` (new) | — | 14.8 s | </details> <details><summary>lod_clamp failure, all production files from main</summary> ``` 1/1 Test #1774: agc_driver_image_sample_lod_clamp_shader_lane ...***Failed 3.48 sec AGC graphics: image_sample_lz through the S# that holds the LOD at 0 with T# MIN_LOD 768 over BASE_LEVEL 0 with a second S# of words 1 0 and 2 5242880, and a second T# of MIN_LOD 0 and LAST_LEVEL 0: thread 0 component 1 is 0.000000, expected 0.062500 ``` </details> ## Negative control I restored only `ShaderInfo.hpp` from `main` (MaxImages 64, MaxSamplers 32, MaxSampledPairs 64) and rebuilt. Both new image tests fail with the counted message: ``` agc_shader_image_limits ... ***Failed image limits: 65 images were not planned: image resource limit exceeded (65 of 64) agc_driver_many_images ... ***Failed ShaderRecompiler::Recompile: image resource limit exceeded (65 of 64) ``` Then I restored every file from the merged tree and rebuilt. `git status --porcelain` is empty. ## Findings ### Blocking 1. **On `main`, `FmaskFormatBase` is indexed per image and leaves room for only 64 images. Direct images 64 to 127 collide with `MirrorUnnormalizedBase`.** In `core/shader/recompiler/PipelineSpecialization.hpp:50-51`, `FmaskFormatBase` is 57472 and `MirrorUnnormalizedBase` is 57536 ([main](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/core/shader/recompiler/PipelineSpecialization.hpp#L48-L52)). - `DescriptorBindingBuilder.cpp:448` pushes `FmaskFormatBase + index`, where `index` is the image index ([main](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp#L447)). `SpirvImageEmitter.cpp` declares `FmaskFormatBase + resource` the same way. - `DescriptorBindingBuilder.cpp:400` pushes `MirrorUnnormalizedBase + sampler` ([main](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp#L399)). - With 128 images, a direct FMASK-expanded image at index 64+k (for example after 64 table images, the shape `agc_shader_image_limits` plans) gets spec ID 57536+k. That is the ID of sampler k's mirror axes, so one of the two constants gets the other's value and nothing reports it. - Neither base exists at the PR head: `MirrorUnnormalizedBase` came with `main`'s e2f17064b8. The description's table of per-image ranges was therefore right for its base and is not right for the merged tree. - `MinLodBase + image` (57600 to 57727) fits only because nothing is above it yet. - Suggested fix: give `FmaskFormatBase` (and, to be safe, `MinLodBase`) a block of `ShaderInfo::MaxImages` IDs, for example above `MinLodBase + 128`. Add `static_assert`s that each per-image and per-sampler base plus its limit stays below the next base, so the next limit change or new base fails to compile. Add an FMASK direct image at index ≥ 64, next to a mirror-unnormalized S#, to the duplicate-ID check in `agc_shader_image_limits`, or extend that check to the whole plan. 2. **Three tests take over 30 s on lavapipe** (CONTRIBUTING: "Each test finishes in 30 s on the CI runners … Split or shrink a test that gets close"). - `agc_shader_selected_records_pair_limit` went from 6.2 s to 35.7 to 38.7 s, and `agc_shader_selected_records_direct_pair_limit` from 5.2 s to 31.2 to 37.8 s. Both were run alone on this machine. - The cause is the rescaled fixture: eight samplers per read (`TableManySamplerSgprs`, `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:4579`, `:4628`), against the 256-pair limit. - The new `agc_shader_image_limits` (`ShaderMemory.cpp:4842`) takes 32.7 s, because it plans and compiles 65, 128, 64+64 and 129 images. - The image-limit selected-record tests also more than doubled, to 13.5 to 14.5 s. - Suggested fix: split `--image-limits` into separate modes (65/128 table images, the 64+64 mixed case, the refusals). For the pair-limit tests, the limit is reached with fewer reads if each read uses more samplers, or keep only the at-limit and limit+1 plans and drop the compile-and-bind of the merged table where another test covers it. ### Non-blocking None. ## Not verified - Hardware GPUs. I ran only lavapipe. For the RTX 5070 Ti, the RDNA2 iGPU, the RTX 2000 Ada and MoltenVK I rely on the reports in the discussion. - I did not build a device test for the FMASK/mirror spec-ID collision. The finding comes from the code and the constants: 57472 + 64 = 57536. - The Ghostrunner replay. It is offline and title-specific, and no request dump is available here. - I did not time the CI runners themselves. These timings are from this 32-vCPU VM run with `-j1`, which is close to the lavapipe configuration CI uses. ## To get this to a good state - Move `FmaskFormatBase` (and `MinLodBase`) to ranges that hold `ShaderInfo::MaxImages` entries, add `static_assert`s on every per-image and per-sampler range, and cover an FMASK direct image at index ≥ 64 in the duplicate-ID check. - Bring `agc_shader_image_limits` and the two selected-record pair-limit tests under 30 s on lavapipe, by splitting or shrinking them, and report the times. - Update the per-image range table in the description against current `main`. <!-- anyps5-bots job=1923 head=9a7315f239181a6afeb7b5036dd5874ae3141ae6 -->
XairRrR commented 2026-11-03 15:16:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T15:16:06Z.

Review: APPROVED


Re-checked — approved

Both blocking findings from my last review are fixed. f3fb2905a4 moves FmaskFormatBase to its own range of 128 IDs, adds static_asserts on the per-image and per-sampler ranges, and checks for the collision in a test. 4a58386f5f and #10000's ba833f42c0 bring every focused test under 30 s.

What changed since my last review

I last reviewed 9a7315f239. Since then:

  • 306ed92696: merges #10000's ba833f42c0. The pair-limit tests now take the capture without compiling the merged request.
  • 688024e6aa: merges main 5cb015caaa.
  • 4a58386f5f: splits agc_shader_image_limits into three tests: _table, _mixed and _refusals.
  • f3fb2905a4:
    • FmaskFormatBase goes from 57472 to 57728.
    • Nine static_asserts at core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp:22-30.
    • _mixed gains a direct FMASK image at index 64 next to a sampler that mirrors when unnormalized, and checks that no specialization ID is emitted twice.
  • The description's range table now has the MinLodBase and FmaskFormatBase rows.

What I ran

Head f3fb2905a405ae95167826f1935849272046f5a4, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged with --no-ff into 5afbd1a249dbcc7a2d024a408e7c233bbd5c0cfb in a clean worktree. Machine: Debian 13 VM, 2× Xeon Gold 6136, GCC 14.2.0, lavapipe on Mesa 26.1.6 / LLVM 19, no GPU.

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...f3fb2905a405ae95167826f1935849272046f5a4
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -j1 --output-on-failure \
  -R '^(agc_shader_image_limits_.*|agc_shader_sampler_limits|agc_shader_selected_records_.*|agc_driver_many_images|agc_driver_many_direct_samplers|agc_shader_disk_cache|agc_driver_image_sample_reduction|agc_driver_image_sample_lod_clamp.*)$'
# negative control: the FMASK fix's two production files from main
git show 4f41f4c3…:core/shader/recompiler/PipelineSpecialization.hpp > (same path)
git show 4f41f4c3…:core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp > (same path)
ninja -C build -j32 -l32 agc_shader_memory_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_shader_image_limits_(mixed|table)$'
# restore both from 5afbd1a2…, rebuild, rerun _mixed, git status --porcelain

The script's build and selected run (2219 tests) and its validation comparison (771 tests) are included below.

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs OK
Script's test run 0 new failures and 0 timeouts. The 7 known failures also fail on main. 114 skips, all expected.
Validation layer (script) 771 tests, layer loaded in 770 and missing in none, 0 tests with a new VUID-
Focused tests, run alone (-j1) 13 pass. agc_driver_image_sample_lod_clamp skips for a device limitation.
agc_driver_image_sample_lod_clamp_shader_lane passes. It failed from main in my last review.
Durations on lavapipe, run alone
Test Last review Now
agc_shader_image_limits / _table 32.7 s (one test) 18.3 s
agc_shader_image_limits_mixed — 12.1 s
agc_shader_image_limits_refusals — 0.03 s
agc_shader_selected_records_pair_limit 35.7–38.7 s 0.16 s
agc_shader_selected_records_direct_pair_limit 31.2–37.8 s 0.11 s
agc_shader_selected_records_image_limit 14.5 s 16.0 s
agc_shader_selected_records_direct_image_limit 13.5 s 13.9 s
agc_shader_sampler_limits 14.8 s 16.1 s
agc_driver_many_images — 5.7 s
agc_driver_many_direct_samplers — 6.8 s

Negative control

I restored only PipelineSpecialization.hpp and DescriptorBindingBuilder.cpp from main. Both files had to go back, because the new static_asserts do not compile with the old base. I then rebuilt agc_shader_memory_tests.

  • agc_shader_image_limits_mixed fails with the collision.
  • _table still passes, as expected, since it has no FMASK image.
image limits: 64 table images and 64 direct images bound as 64 table and 64 heap elements; direct image 127 has image specialization constants 1659 to 1663
image limits: image 64's FMASK format shares a specialization ID with another constant, such as sampler 0's mirror axes

Then I restored both files from the merged tree and rebuilt. _mixed passes again. git status --porcelain lists only an untracked 3rdparty/harfbuzz/, which was there before my changes and has nothing to do with this PR.

For the earlier controls (limit constant restored, so 65 images are refused with (65 of 64)), see my last review. The code they exercised has not changed.

Previous findings

  1. FMASK spec IDs of images 64–127 collide with MirrorUnnormalizedBase: Resolved.
    • At the head, the ranges are PipelineSpecialization.hpp:48-52:
      • MirrorUnnormalizedBase 57536–57599
      • MinLodBase 57600–57727
      • FmaskFormatBase 57728–57855
    • Every per-image and per-sampler base that DescriptorBindingBuilder.cpp and SpirvImageEmitter.cpp index is checked against the next base by the static_asserts.
    • ImageComponentBase (65536) is the top range, so nothing sits above it.
    • The new check fails without the fix (negative control above).
  2. Three tests over 30 s on lavapipe: Resolved. The slowest focused test is now agc_shader_image_limits_table at 18.3 s, run alone on this machine. The pair-limit tests went from 31–39 s to 0.1–0.2 s. The author's GitHub-runner times (13.2 s for the slowest) are author-reported, and are consistent with mine.

New findings

Blocking

None.

Non-blocking

None. oneandonlydean has already raised the VolumeGatherBase placement for #9183, and the author has agreed to re-place the ranges when that lands. It does not affect this tree.

Not verified

  • Hardware GPUs. I ran only lavapipe. For the RTX 5070 Ti, the RDNA2 iGPU, the RTX 2000 Ada, the RX 6300 and MoltenVK I rely on the reports in the discussion. Those runs predate f3fb2905a4, which only moves a spec-ID base.
  • A device test of the FMASK/mirror case. The new check works at the binding-plan level (DescriptorBindingBuilder::Prepare), and it forces the sampler's explicit-LOD use on the plan's copy instead of deriving it from shader code.
  • The Ghostrunner replay, which is offline, title-specific and not available here.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5754699111 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10489#pullrequestreview-5754699111). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T15:16:06Z. **Review:** APPROVED --- # Re-checked — approved Both blocking findings from my last review are fixed. f3fb2905a4 moves `FmaskFormatBase` to its own range of 128 IDs, adds `static_assert`s on the per-image and per-sampler ranges, and checks for the collision in a test. 4a58386f5f and #10000's ba833f42c0 bring every focused test under 30 s. ## What changed since my last review I last reviewed `9a7315f239`. Since then: - **306ed92696:** merges #10000's ba833f42c0. The pair-limit tests now take the capture without compiling the merged request. - **688024e6aa0:** merges `main` 5cb015caaa. - **4a58386f5f:** splits `agc_shader_image_limits` into three tests: `_table`, `_mixed` and `_refusals`. - **f3fb2905a4:** - `FmaskFormatBase` goes from 57472 to 57728. - Nine `static_assert`s at `core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp:22-30`. - `_mixed` gains a direct FMASK image at index 64 next to a sampler that mirrors when unnormalized, and checks that no specialization ID is emitted twice. - The description's range table now has the `MinLodBase` and `FmaskFormatBase` rows. ## What I ran Head `f3fb2905a405ae95167826f1935849272046f5a4`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged with `--no-ff` into `5afbd1a249dbcc7a2d024a408e7c233bbd5c0cfb` in a clean worktree. Machine: Debian 13 VM, 2× Xeon Gold 6136, GCC 14.2.0, lavapipe on Mesa 26.1.6 / LLVM 19, no GPU. ```sh git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...f3fb2905a405ae95167826f1935849272046f5a4 python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -j1 --output-on-failure \ -R '^(agc_shader_image_limits_.*|agc_shader_sampler_limits|agc_shader_selected_records_.*|agc_driver_many_images|agc_driver_many_direct_samplers|agc_shader_disk_cache|agc_driver_image_sample_reduction|agc_driver_image_sample_lod_clamp.*)$' # negative control: the FMASK fix's two production files from main git show 4f41f4c3…:core/shader/recompiler/PipelineSpecialization.hpp > (same path) git show 4f41f4c3…:core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp > (same path) ninja -C build -j32 -l32 agc_shader_memory_tests ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_shader_image_limits_(mixed|table)$' # restore both from 5afbd1a2…, rebuild, rerun _mixed, git status --porcelain ``` The script's build and selected run (2219 tests) and its validation comparison (771 tests) are included below. | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure / build / `libs` | OK | | Script's test run | 0 new failures and 0 timeouts. The 7 known failures also fail on `main`. 114 skips, all expected. | | Validation layer (script) | 771 tests, layer loaded in 770 and missing in none, 0 tests with a new `VUID-` | | Focused tests, run alone (`-j1`) | 13 pass. `agc_driver_image_sample_lod_clamp` skips for a device limitation. | | `agc_driver_image_sample_lod_clamp_shader_lane` | passes. It failed from `main` in my last review. | <details><summary>Durations on lavapipe, run alone</summary> | Test | Last review | Now | |---|---|---| | `agc_shader_image_limits` / `_table` | 32.7 s (one test) | 18.3 s | | `agc_shader_image_limits_mixed` | — | 12.1 s | | `agc_shader_image_limits_refusals` | — | 0.03 s | | `agc_shader_selected_records_pair_limit` | 35.7–38.7 s | 0.16 s | | `agc_shader_selected_records_direct_pair_limit` | 31.2–37.8 s | 0.11 s | | `agc_shader_selected_records_image_limit` | 14.5 s | 16.0 s | | `agc_shader_selected_records_direct_image_limit` | 13.5 s | 13.9 s | | `agc_shader_sampler_limits` | 14.8 s | 16.1 s | | `agc_driver_many_images` | — | 5.7 s | | `agc_driver_many_direct_samplers` | — | 6.8 s | </details> ## Negative control I restored only `PipelineSpecialization.hpp` and `DescriptorBindingBuilder.cpp` from `main`. Both files had to go back, because the new `static_assert`s do not compile with the old base. I then rebuilt `agc_shader_memory_tests`. - `agc_shader_image_limits_mixed` fails with the collision. - `_table` still passes, as expected, since it has no FMASK image. ``` image limits: 64 table images and 64 direct images bound as 64 table and 64 heap elements; direct image 127 has image specialization constants 1659 to 1663 image limits: image 64's FMASK format shares a specialization ID with another constant, such as sampler 0's mirror axes ``` Then I restored both files from the merged tree and rebuilt. `_mixed` passes again. `git status --porcelain` lists only an untracked `3rdparty/harfbuzz/`, which was there before my changes and has nothing to do with this PR. For the earlier controls (limit constant restored, so 65 images are refused with `(65 of 64)`), see my last review. The code they exercised has not changed. ## Previous findings 1. **FMASK spec IDs of images 64–127 collide with `MirrorUnnormalizedBase`: Resolved.** - At the head, the ranges are [`PipelineSpecialization.hpp:48-52`](https://github.com/boykopovar/AnyPS5/blob/f3fb2905a405ae95167826f1935849272046f5a4/core/shader/recompiler/PipelineSpecialization.hpp#L48-L52): - `MirrorUnnormalizedBase` 57536–57599 - `MinLodBase` 57600–57727 - `FmaskFormatBase` 57728–57855 - Every per-image and per-sampler base that `DescriptorBindingBuilder.cpp` and `SpirvImageEmitter.cpp` index is checked against the next base by the [`static_assert`s](https://github.com/boykopovar/AnyPS5/blob/f3fb2905a405ae95167826f1935849272046f5a4/core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp#L22-L30). - `ImageComponentBase` (65536) is the top range, so nothing sits above it. - The new check fails without the fix (negative control above). 2. **Three tests over 30 s on lavapipe: Resolved.** The slowest focused test is now `agc_shader_image_limits_table` at 18.3 s, run alone on this machine. The pair-limit tests went from 31–39 s to 0.1–0.2 s. The author's GitHub-runner times (13.2 s for the slowest) are author-reported, and are consistent with mine. ## New findings ### Blocking None. ### Non-blocking None. oneandonlydean has already raised the `VolumeGatherBase` placement for #9183, and the author has agreed to re-place the ranges when that lands. It does not affect this tree. ## Not verified - Hardware GPUs. I ran only lavapipe. For the RTX 5070 Ti, the RDNA2 iGPU, the RTX 2000 Ada, the RX 6300 and MoltenVK I rely on the reports in the discussion. Those runs predate f3fb2905a4, which only moves a spec-ID base. - A device test of the FMASK/mirror case. The new check works at the binding-plan level (`DescriptorBindingBuilder::Prepare`), and it forces the sampler's explicit-LOD use on the plan's copy instead of deriving it from shader code. - The Ghostrunner replay, which is offline, title-specific and not available here. <!-- anyps5-bots job=3400 head=f3fb2905a405ae95167826f1935849272046f5a4 -->
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!10489
No description provided.