feat(shader): raise the image limit to 128 and name the counts in its refusals #10489
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10489"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 exceededand stops onimage resource limit exceeded(frankea's offline replay, onmain+ #9068 + #8070 + #9701-#9703 + #8939 + #9969 + #10000). The cap isShaderInfo::MaxImages, 64. This PR raises it to 128:image resource limit exceeded (129 of 128), the image being added against the limit, and the binding builder's isruntime image count exceeds the static capacity (N of 128). A replay that still refuses then says what it needs.ImageBasespec IDs, 1024 + 5 per imageVertexBase4096 (614 images)MipCountBase, 8320 + 1 per imageStoreQuantizeBase12288StoreQuantizeBase, 12288 + 4 per imageDescriptorIndexBase16384CompareBase, 49152 + 6 per imageFoldOffsetBase57344MinLodBase, 57600 + 1 per imageSamplerLodBiasBase57728 (#14621, 1 per sampler, to 57791)FmaskFormatBase, 58048 + 1 per imageVolumeGatherBase58176VolumeGatherBase(#9183), 58176 + 1 per imageImageComponentBase65536RuntimeAbi::ImageCapacityDescriptorIndex,HeapCountBaseand 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 belowMirrorUnnormalizedBase(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 aboveMinLodBase+ 128, andDescriptorBindingBuilder.cppnow has astatic_assertfor 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 addedVolumeGatherBaseat 57664, which at 128 images would overlapFmaskFormatBase's new range, so this PR moves it too, making each per-image rangeShaderInfo::MaxImageswide, and adds it to that chain. danielhorngt's #14621 has since taken 57728-57791 forSamplerLodBiasBase, one ID per sampler. So482e813ba3movesFmaskFormatBaseto 58048 andVolumeGatherBaseto 58176, above the IDs other open PRs take below 58048, ande62603545aaddsSamplerLodBiasBaseto the chain, betweenMinLodBase's range andFmaskFormatBase.128 images (127 selected tables, 1 direct), 128 pairs.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.agc_shader_replay --prepare, on Linux with an RTX 5070, on #14636's8e5b82d0f2withMaxImagesraised locally rather than with this PR: each needs 77 images, overmain'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, andvkCreateComputePipelineshadn'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.FormatVersion60:mainis 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 from9544416ba9(11-04 04:33Z), as #9020, ZSWolt's #12944 and savvaniss's #9889 and #9897 did. All of them changemain's 56 to 57 on the same line, so git merged #9020'smaininto 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 freshFormatVersionnumber, 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 asmain), 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.mainmoves its range, and checks the merged values whether or not git reports a conflict:SamplerLodBiasBase, now onmain: danielhorngt's #14621 merged (1322babd48, 11-05 23:13Z) withSamplerLodBiasBaseat 57728, one ID per sampler, inside theFmaskFormatBaserange this PR had moved to (57728-57855). This PR moved its two bases above it (482e813ba3, see Tested). shahulmubeen-a's #14964 addsHalfBorderUnnormalizedBaseat 57728 too, which now overlapsmain'sSamplerLodBiasBaserather than this PR's ranges (BunnyFl's note). This PR leaves 57792-57855 free, which #16935 takes (below).UnnormalizedScaledBaseat 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::MaxSamplersis 64 on both, so #16935's range ends at 57855, below this PR'sFmaskFormatBase(58048) and #12790'sGatherLodBase(57856). Git reports one conflict, inPipelineSpecialization.hpp: both PRs add their lines right afterSamplerLodBiasShaderThreshold, this PRFmaskFormatBaseandVolumeGatherBase, #16935UnnormalizedScaledBase(merge-tree of 9ac49a7410 with74407aac46, 01:08Z 11-08). Either order works: whichever lands second keeps all three lines and addsUnnormalizedScaledBaseto thestatic_assertchain, withSamplerLodBiasBase + ShaderInfo::MaxSamplers <= UnnormalizedScaledBaseandUnnormalizedScaledBase + ShaderInfo::MaxSamplers <= FmaskFormatBase.GatherLodBase(57856),GatherLodBiasBase(57920) andGatherImageMinLodBase(57984), 64 each. Its IDs no longer overlap this PR's ranges. Since #14621 merged, #12790 conflicts withmainitself inPipelineSpecialization.hppandDescriptorBindingBuilder.cpp. Its ownstatic_assert(VolumeGatherBase + ShaderInfo::MaxImages <= GatherLodBase) fails to compile with this PR, whoseVolumeGatherBaseis now aboveGatherLodBase.MipCountBaserange (8320-8447): Amoenus's #7085 addsLevelsPastViewBaseat 8384, one ID per image, the first free ID abovemain's 64-image range. #7085 had it first (7f56df7116, 10-19); this PR widenedMipCountBase's range in325861788d(10-24). Git merges the two with no conflict inPipelineSpecialization.hpp, and nostatic_assertnames both bases, so in a shader with 65 or more images, image 64's mip count would share image 0'sLevelsPastViewBaseID. fdfawef324's draft #6280 takes 8384 too, for its ownLevelsPastViewBase.DeviceSamplerClassBasethere, clear of this PR's ranges.The commits:
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).8e0d4f5ad2: the new tests.482e813ba3: movesFmaskFormatBaseandVolumeGatherBaseto 58048 and 58176, above #14621'sSamplerLodBiasBase.e62603545a: addsSamplerLodBiasBaseto thestatic_assertchain.Tested
agc_shader_image_limits(CPU,tests/ShaderMemory.cpp):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.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 withimage resource limit exceeded.12b89239c7, ×10 after):agc_shader_image_limitsfails before; after, 17 run, 16 pass, 1 skip (agc_driver_many_images, no Vulkan device), 0 fail.APS5_SKIP_TIMING_TESTS=1.agc_driver_sgpr_pattern_fill_keysload race;--repeat until-fail:20on the 33^agc_shader_and 7image_tabletests, all 20 of 20.agc_driver_many_images,agc_driver_many_direct_samplersand the 7agc_driver_image_table*tests: identical VUIDs on both trees, only the knownVUID-VkDeviceCreateInfo-pNext-pNextat device creation, and no newVUID-. On the base,agc_driver_many_imagesrefuses before it dispatches; on this PR all 9 pass.e916c02082, a merge of #10000'sd6061d4ce2, which mergesmainc9b2660d56. Against thatmain,ShaderDiskCache.hppdiffers only inFormatVersion, 47 to 54, and keepsmain'sLoadSharedPlan;ShaderDiskCache.cppand its test differ only in #10000's 64-bitimageSamplers. This head merges cleanly intomain30be9b428b. 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_limitsamong 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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.mainc9b2660d56againste916c02082(CONTRIBUTING's AGC rule), on GitHub's Linux runner (llvmpipe, LLVM 20.1.2), withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1andctest -V.main's arm runsmain's implementation of every file this stack changes, #10000's included.main; the layer was inserted 12 and 11 times.agc_driver_many_images,agc_driver_many_direct_samplersand the 7agc_driver_image_table*tests, with the other shader tests. 26 pass with this PR and 22 onmain; the layer was inserted 10 and 8 times.was not found but was requested, both trees report onlyVUID-VkDeviceCreateInfo-pNext-pNext, and this PR adds noVUID-message.agc_shader_image_limitsandagc_driver_many_images, and #10000'sagc_shader_sampler_limitsandagc_driver_many_direct_samplers, don't exist onmain, so only this PR's tree runs them.ce4d6f48c3merged with #9633's217e3d7b1fand #10000'se7b14b0e8e. The only conflicts wereFormatVersionand the debt docs. It's the sameshader_200c520000.prepare.req, dumped onmain74acfad65, and the sameagc_shader_replay --preparewithANYPS5_NO_SHADER_CACHE=1as their run without this PR. CPU replay only.image resource limit exceeded.sampler resource limit exceeded, the 64-sampler cap.srtIR (on the #9969 stack): 1,047GetImageResourceand 941GetSamplerResource, 619 of them with distinct argument tuples. These are SSA tuples, not distinct memory locations.ce2ba44d38, a merge of #10000's merge ofmain(d82e3f9552) (run). No conflict of its own; this PR's diff over #10000 is unchanged. The sampler, selected-record, disk-cache, image-table andagc_shader_image_limitstests pass 10 runs in a row. Linux: 27 run, 27 pass, 0 skip, 0 fail. Windows: 29 run, 23 pass, 6 skip (theagc_driver_image_tabletests, no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (144 and 207) and on Windows (171 and 223). The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.ce2ba44d38merged ontomainaeff26bd9,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, no validation layer. The 64 image, sampler, record, disk-cache, image-table andagc_shader_entries pass on both GPUs; withShaderInfo::MaxImagesset back to 64,agc_shader_image_limitsandagc_driver_many_imagesfail on both. A local variant ofManyImages.cppwith 64 table T#s next to the 64 direct ones, in both orders, binds64 image table elements and 64 heap elementswith every output word holding its own image's texel and nothing written past them; 129 images refuse withimage resource limit exceeded (129 of 128). Of 253agc_entries the only failure, with and without this PR, isagc_driver_depth_plane_partial_store(#10664).ef7c065124and0fd6998a10, a merge of #10000's merge ofmain85f8e11372, and a trim of this PR's debt entry (run). In the Windowsset_tests_propertiesline ofcore/libs/prx/libSceAgcDriver/CMakeLists.txt, the merge keepsmain's three result-memo budget tests (#9989) with #10000'sagc_shader_sampler_limitsand this PR'sagc_shader_image_limits; this PR's diff over #10000 is otherwise unchanged, andFormatVersionstays 54.0fd6998a10brings the image-table entry indocs/dev/debt/shader.mdunder thedebt-lengthlimit, 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. Theagc_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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.254fb9018c, a merge of #10000'saa94587021(run), which brings #10000's merge ofmain0c5401dcbdand its two test-only commits: the refusal checks @oneandonlydean listed on #10000 go, andagc_driver_many_direct_samplersskips on a device with fewer than 33 samplers per stage or set (@jotitadev's MoltenVK run). No conflicts;FormatVersionstays 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_samplersandagc_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_sysandguest_timed_join_import_libkernel_webfail at their setup in the verify's Windows build (FileNotFoundErrorstarting the title, or copying the libraries they load), and pass inmain's own Windows job at1829def9bf(job). The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.0fd6998a10overmainb87d3d87e2with the macOS port PRs and one local patch (FormatVersionresolved to 54): MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0) and MoltenVKmainwith SPIRV-Cross #2704,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1.agc_driver_many_imagesandagc_shader_image_limitspass 3 of 3 on both drivers (MoltenVK'smaxPerStageDescriptorSampledImagesis 256).ShaderInfo::MaxImagesset back to 64, both fail 3 of 3 on both drivers withimage resource limit exceeded (65 of 64).VUID-vkCreateDescriptorSetLayout-support-09582(×2) inagc_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 plusagc_driver_many_direct_samplers, from #10000, on MoltenVK's 16 samplers per stage; #10000'saa94587021now skips it on such a device. Oneagc_driver_lds_subword_store_branchfailure on MoltenVKmainpasses 5 of 5 alone and is the LDS-barrier test #10858 targets.b198906a61, a merge of #10000's7f4e97c45f, which carriesmain94fe1b5c5aand with it #11507'sFormatVersion49 (run). Clean:FormatVersionstays 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'sagc_driver_image_sample_short_cuberan 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_sysandguest_timed_join_import_libkernel_webfail at their setup in the verify's Windows build (FileNotFoundErrorstarting the title, or copying the libraries they load), withmain's code too, and pass inmain's own Windows job at1829def9bf(job). The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.1e5eb0cc71, a merge of #10000's merge ofmain0836dfdf4f(run, on e7c504633b, which has the same tree). #12862 movedlibSceAgcDriver's test registrations intotests/cmake/; the conflict inCMakeLists.txtis resolved withtools/agc_test_split.py resolve, which moves this PR's registration ofagc_shader_image_limitsintotests/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 -Ngives 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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.main8a4fc62318against this head1e5eb0cc71(CONTRIBUTING's AGC rule, refreshed for @MarcZX10's review), on GitHub's Linux runner (run).VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1andctest -V.main8a4fc62318as a second parent, so the runner can check out both arms.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.mainand 3 times with this head, and neither log haswas not found.VUID-VkDeviceCreateInfo-pNext-pNext, which is onmain, so this head adds none. With this head, 31 run, 31 pass.main's arm passes the tests it has.1e5eb0cc71merged ontomain0836dfdf4f, NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Linux. Passed: 2,450 passed, 0 new failures (4 fail onmaintoo, and 2 are unstable there), and no new validation IDs againstmainover 930 tests run on the GPU.9a7315f239, a merge of #10000's760a550294, which mergesmain88e804b0a7(run). #10000's merge brings Ondra97's #7694 and JJenkx's #6959 (see #10000). The conflicts were this PR's lines beside #10000's andmain's at the same places, and the merge keeps both: its--image-limitscase inShaderMemory.cppand itsagc_shader_image_limitsregistration inagc_shader_memory_tests.cmake, next to #7694'sagc_shader_descriptor_phis.FormatVersionstays 54, and this PR's diff over #10000 is unchanged. The image-limit, sampler-limit, selected-record, disk-cache and shader-memory tests, withagc_driver_image_sample_reduction,agc_driver_many_direct_samplersandagc_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 threeagc_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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.f3fb2905a4:306ed92696,688024e6aa,4a58386f5fandf3fb2905a4, for XairRrR's review (×10, red).306ed92696merges #10000'sba833f42c0, which checks the pair-limit merge without compiling it, and688024e6aamergesmain5cb015caaa. Both are clean.4a58386f5fsplitsagc_shader_image_limitsintoagc_shader_image_limits_table(65 and 128 table images),agc_shader_image_limits_mixed(64 table and 64 direct images) andagc_shader_image_limits_refusals(129 images).f3fb2905a4givesFmaskFormatBaseits own range ofShaderInfo::MaxImagesIDs, with thestatic_asserts above.agc_shader_image_limits_mixedadds an FMASK direct image at index 64 beside a sampler that mirrors when unnormalized, and checks that no specialization ID is emitted twice.DescriptorBindingBuilder.cppandPipelineSpecialization.hppfailagc_shader_image_limits_mixedon both runners: "image limits: image 64's FMASK format shares a specialization ID with another constant, such as sampler 0's mirror axes".APS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.agc_shader_image_limits_table13.2 s,agc_shader_image_limits_mixed8.8 s,agc_shader_image_limits_refusals0.1 s,agc_shader_sampler_limits10.2 s,agc_shader_selected_records_image_limit9.7 s,agc_shader_selected_records_direct_image_limit9.4 s,agc_shader_selected_records_pair_limit0.2 s andagc_shader_selected_records_direct_pair_limit0.2 s.02ace33cfa, a merge ofmain4f41f4c375(run).main, left by merging #10000'sba833f42c0(306ed92696) before #10000 landed. GitHub showed them as a conflict, though git merges the branch withmaincleanly. No file needed a resolution (git show --remerge-diffis empty), so the merge adds no change of its own.agc_driver_image_sample_reduction,agc_driver_many_direct_samplers,agc_driver_many_images,agc_shader_sampler_limitsand 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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.f3fb2905a4merged ontomain4f41f4c: TechLevelZero's NVIDIA bot, RTX 2000 Ada, driver 595.99.02 (report): 2,766 passed, 7 failed, none new (3 also fail onmain, 4 unstable onmain), 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 onmain, 2 unstable onmain), 58 skipped, with no new validation IDs (936 tests on the GPU).54bd6f2cc6, a merge ofmain086c0686c8, which brings fma-rc's #9183 (×10).The conflict:
PipelineSpecialization.hpp, where #9183 addsVolumeGatherBaseat 57664 next to this PR's movedFmaskFormatBase. The merge keeps it at 57856 (see What). It also changesDescriptorBindingBuilder.cpp, which didn't conflict:FmaskFormatBase'sstatic_assertnow ends atVolumeGatherBase, and a new one keepsVolumeGatherBase+ 128 at or belowImageComponentBase. 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_limitsand every test matching^agc_shader_disk_cache,^agc_shader_selected_records_,^agc_shader_image_limitsor^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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.Every
agctest, 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 isagc_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.main086c0686c8times out the same way underctest -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_journal54bd6f2cc6(run)main086c0686c8(run)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 ontomain1c8c0ef, driver 595.99.02. 2,792 passed, 6 failed (none new: 3 also fail onmain, 3 unstable onmain), 50 skipped. This PR'sagc_shader_image_limits_table,agc_shader_image_limits_mixedandagc_shader_image_limits_refusalspassed 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 onmain, 2 unstable onmain), 61 skipped. The same three tests passed on the GPU.9544416ba9, a merge ofmainc2eafe4461, which brings yabanana's #7223 (×10).FormatVersioninShaderDiskCache.hpp.mainreached 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.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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.main5b1d381, driver 595.99.02. 2,840 passed, 5 failed (none new: 3 also fail onmain, 2 unstable onmain), 50 skipped, with no new validation IDs (981 tests on the GPU).mainb611e63, Mesa 25.2.8. 2,872 passed, 10 failed (none new: 9 also fail onmain, 1 unstable onmain), 60 skipped, with no new validation IDs (992 tests on the GPU).agc_shader_image_limits_table,agc_shader_image_limits_mixedandagc_shader_image_limits_refusals, andagc_driver_many_images, ran with validation and passed. Both reports list the four as not inmain's validation baseline.windowscheck is red at this head on one test,avplayer_http_patched_modules, atAvPlayerHttpModules.cmake:155, where the owner executableavplayer_http_patched_modules_tests.exewasn'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 ofmainea07ec82d3(9c0f71e1fa) ande62603545a, after danielhorngt's #14621 (×10, validation).482e813ba3, before the merge, movesFmaskFormatBasefrom 57728 to 58048 andVolumeGatherBasefrom 57856 to 58176, so the merge itself keeps both sides.PipelineSpecialization.hpp, wheremain'sSamplerLodBiasBaseandSamplerLodBiasShaderThresholdlines now come before this PR's moved bases. #14621's lines inDescriptorBindingBuilder.cppandSpirvImageEmitter.cppmerged without a conflict.FormatVersionstays 57.e62603545a: the chain'sMinLodBase + ShaderInfo::MaxImages <= FmaskFormatBasebecomes<= SamplerLodBiasBase, followed bySamplerLodBiasBase + ShaderInfo::MaxSamplers <= FmaskFormatBase.agc_driver_image_sample_reduction,agc_driver_many_direct_samplersandagc_driver_many_images, with #14621'sagc_driver_image_sample_lod_bias_sumandagc_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_samplersandagc_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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.VK_LAYER_KHRONOS_validationon 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 plusagc_shader_image_limits_table,_mixedand_refusalsandagc_driver_many_images, whichmaindoesn't have, and passed 17. The only VUID isVUID-VkDeviceCreateInfo-pNext-pNext, on both, so this change adds none.main's implementation, whereagc_shader_image_limits_table,_mixedand_refusalsfail (image limits: 65 images were not planned: image resource limit exceeded). They pass here.main01f804bb2f.d5b9ccdb80:d1d8e3ef93, a merge ofmain090f57166a, and the format commitd5b9ccdb80(×10).d1d8e3ef93merges cleanly.mainhas frankea's #9020, which also changesFormatVersionfrom 56 to 57, so git took the line without a conflict and left this PR onmain's number.d5b9ccdb80movesFormatVersionfrom 57 to 58 (see What) and changes no other line. This PR's other lines overmainare unchanged.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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.74407aac46:FormatVersionfrom 58 to 60 (×10).74407aac46moves the line to 60 (see What) and changes no other line.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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)libSceAgcDriver/CMakeLists.txtandDescriptorBindingBuilder.cpp); this head keeps both. Any order with the others: #12944, #9889 and #9897 holdFormatVersion57, nowmain's, and #15343 (59) and #9508 (61) change the same line. #12790'sstatic_assertand 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 Windowsset_tests_propertiesline ofagc_shader_memory_tests.cmake; whichever lands second keeps bothsampler resource limit exceeded, the 64-sampler capImported 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-treeagainst current upstream main (3fcb5e4d76) conflicts incore/shader/recompiler/ShaderDiskCache.hpp: this branch setsFormatVersionto 51 and removesLoadSharedPlan, 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 head51a0116de, not currentmain; 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.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_imagesgoes red to green on MoltenVK. The stackedagc_driver_many_direct_samplersfrom #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.
maindoesn't build and run on macOS, so this ismainb87d3d87e2+ 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 wasFormatVersion, which I resolved to 54. Two drivers: MoltenVK 1.4.2 from Vulkan SDK 1.4.363.0, and MoltenVKmainwith SPIRV-Cross#2704.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1,ctest -j1 --timeout 30.agc_driver_many_imagesandagc_shader_image_limitspass 3 of 3 on both drivers. MoltenVK'smaxPerStageDescriptorSampledImagesis 256, so the 64 direct images fit.ShaderInfo::MaxImagesset back to 64): both fail 3 of 3 on both drivers.agc_driver_many_imagesstops withShaderRecompiler::Recompile: image resource limit exceeded (65 of 64), andagc_shader_image_limitswith65 images were not planned: image resource limit exceeded (65 of 64).agc_driver_many_imagesisVUID-vkCreateDescriptorSetLayout-support-09582(×2). It's the image-table layout that MoltenVK'svkGetDescriptorSetLayoutSupportrejects without accounting for update-after-bind (KhronosGroup/MoltenVK#2573), and the same VUID shows up in the existing image-table tests on the base.^agchas the same failures as the base on both drivers, plusagc_driver_many_direct_samplers. The MoltenVKmainsuite run also had oneagc_driver_lds_subword_store_branchfailure (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.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T23:51:06Z.
Review: CHANGES_REQUESTED
Re-checked — new head, validation pending
Head
1e5eb0cc718a2bf01490ccec7c5940e6c068bf67merges cleanly with currentmain, but the required Vulkan comparison is still against oldermainand candidate commits.What I ran
Reviewed head
1e5eb0cc718a2bf01490ccec7c5940e6c068bf67against PR base0836dfdf4fecb1e0326100c490476e15d3a74da5; the merge preview against currentmainb08c539c505c48341146c705bc72d9b603cdb3a7was clean. Environment: Debian GNU/Linux 12, x86_64, Python 3.11.2, GCC 12.2.0. I ran no local build or GPU tests.Results
mainc9b2660d56with candidatee916c02082; it does not compare currentmainb08c539c505c48341146c705bc72d9b603cdb3a7with this reviewed head.Unedited output excerpts
Findings
Blocking
The PR changes AGC and shader-recompiler behavior, so the repository requires the same focused Vulkan tests on
mainand the change on the same machine/GPU with the validation layer, no shader cache, andANYPS5_REQUIRE_VULKAN=1, then a comparison showing no new VUIDs. The PR's current report is pinned tomainc9b2660d56and candidatee916c02082, rather than currentmainb08c539c505c48341146c705bc72d9b603cdb3a7and reviewed head1e5eb0cc718a2bf01490ccec7c5940e6c068bf67. Current main has since changed overlapping shader-resource, shader-cache, test, and recompiler files, includingShaderResources.cpp,ShaderMemory.cpp,ShaderDiskCache.cpp,ResourceMaterializer.cpp, andResourceTracker.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
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.
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,main5cb015caaaaf83f8ee431414ee6a457b5b307d49, merged with--no-ffin a clean worktree (Debian 13 VM, 2× Xeon Gold 6136, GCC 14.2.0, lavapipe on Mesa 26.1.6 / LLVM 19, no GPU).The script's build and selected test run (2240 tests) and its validation-layer comparison (761 tests) are in the results below.
Results
git diff --checkcheck_conventions.pylibsagc_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_reductionagc_driver_image_sample_lod_clamp_shader_lanemain: it fails the same way with all 12 production files restored frommain(the baseline was the older096c4557)unwrap_self_…_destination_directory_groupos.chowngives EINVAL in the sandbox's/tmp. This Python tool test is unrelated to the diff.VUID--j1)Durations on lavapipe, run alone
main(main's production and ShaderMemory.cpp)agc_shader_selected_records_pair_limitagc_shader_selected_records_direct_pair_limitagc_shader_selected_records_image_limitagc_shader_selected_records_direct_image_limitagc_shader_image_limits(new)agc_shader_sampler_limits(new)lod_clamp failure, all production files from main
Negative control
I restored only
ShaderInfo.hppfrommain(MaxImages 64, MaxSamplers 32, MaxSampledPairs 64) and rebuilt. Both new image tests fail with the counted message:Then I restored every file from the merged tree and rebuilt.
git status --porcelainis empty.Findings
Blocking
On
main,FmaskFormatBaseis indexed per image and leaves room for only 64 images. Direct images 64 to 127 collide withMirrorUnnormalizedBase. Incore/shader/recompiler/PipelineSpecialization.hpp:50-51,FmaskFormatBaseis 57472 andMirrorUnnormalizedBaseis 57536 (main).DescriptorBindingBuilder.cpp:448pushesFmaskFormatBase + index, whereindexis the image index (main).SpirvImageEmitter.cppdeclaresFmaskFormatBase + resourcethe same way.DescriptorBindingBuilder.cpp:400pushesMirrorUnnormalizedBase + sampler(main).agc_shader_image_limitsplans) 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.MirrorUnnormalizedBasecame withmain'se2f17064b8. 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.FmaskFormatBase(and, to be safe,MinLodBase) a block ofShaderInfo::MaxImagesIDs, for example aboveMinLodBase + 128. Addstatic_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 inagc_shader_image_limits, or extend that check to the whole plan.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_limitwent from 6.2 s to 35.7 to 38.7 s, andagc_shader_selected_records_direct_pair_limitfrom 5.2 s to 31.2 to 37.8 s. Both were run alone on this machine.TableManySamplerSgprs,core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:4579,:4628), against the 256-pair limit.agc_shader_image_limits(ShaderMemory.cpp:4842) takes 32.7 s, because it plans and compiles 65, 128, 64+64 and 129 images.--image-limitsinto 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
-j1, which is close to the lavapipe configuration CI uses.To get this to a good state
FmaskFormatBase(andMinLodBase) to ranges that holdShaderInfo::MaxImagesentries, addstatic_asserts on every per-image and per-sampler range, and cover an FMASK direct image at index ≥ 64 in the duplicate-ID check.agc_shader_image_limitsand the two selected-record pair-limit tests under 30 s on lavapipe, by splitting or shrinking them, and report the times.main.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.
f3fb2905a4movesFmaskFormatBaseto its own range of 128 IDs, addsstatic_asserts on the per-image and per-sampler ranges, and checks for the collision in a test.4a58386f5fand #10000'sba833f42c0bring every focused test under 30 s.What changed since my last review
I last reviewed
9a7315f239. Since then:306ed92696: merges #10000'sba833f42c0. The pair-limit tests now take the capture without compiling the merged request.688024e6aa: mergesmain5cb015caaa.4a58386f5f: splitsagc_shader_image_limitsinto three tests:_table,_mixedand_refusals.f3fb2905a4:FmaskFormatBasegoes from 57472 to 57728.static_asserts atcore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp:22-30._mixedgains a direct FMASK image at index 64 next to a sampler that mirrors when unnormalized, and checks that no specialization ID is emitted twice.MinLodBaseandFmaskFormatBaserows.What I ran
Head
f3fb2905a405ae95167826f1935849272046f5a4,main4f41f4c375f5abb487dbd184fbc150f31994d762, merged with--no-ffinto5afbd1a249dbcc7a2d024a408e7c233bbd5c0cfbin 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.The script's build and selected run (2219 tests) and its validation comparison (771 tests) are included below.
git diff --checkcheck_conventions.pylibsmain. 114 skips, all expected.VUID--j1)agc_driver_image_sample_lod_clampskips for a device limitation.agc_driver_image_sample_lod_clamp_shader_lanemainin my last review.Durations on lavapipe, run alone
agc_shader_image_limits/_tableagc_shader_image_limits_mixedagc_shader_image_limits_refusalsagc_shader_selected_records_pair_limitagc_shader_selected_records_direct_pair_limitagc_shader_selected_records_image_limitagc_shader_selected_records_direct_image_limitagc_shader_sampler_limitsagc_driver_many_imagesagc_driver_many_direct_samplersNegative control
I restored only
PipelineSpecialization.hppandDescriptorBindingBuilder.cppfrommain. Both files had to go back, because the newstatic_asserts do not compile with the old base. I then rebuiltagc_shader_memory_tests.agc_shader_image_limits_mixedfails with the collision._tablestill passes, as expected, since it has no FMASK image.Then I restored both files from the merged tree and rebuilt.
_mixedpasses again.git status --porcelainlists only an untracked3rdparty/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
MirrorUnnormalizedBase: Resolved.PipelineSpecialization.hpp:48-52:MirrorUnnormalizedBase57536–57599MinLodBase57600–57727FmaskFormatBase57728–57855DescriptorBindingBuilder.cppandSpirvImageEmitter.cppindex is checked against the next base by thestatic_asserts.ImageComponentBase(65536) is the top range, so nothing sits above it.agc_shader_image_limits_tableat 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
VolumeGatherBaseplacement for #9183, and the author has agreed to re-place the ranges when that lands. It does not affect this tree.Not verified
f3fb2905a4, which only moves a spec-ID base.DescriptorBindingBuilder::Prepare), and it forces the sampler's explicit-LOD use on the plan's copy instead of deriving it from shader code.