fix(shader): preserve runtime-proven formatted buffer read extents #19852
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19852"
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 lgqdaxia on 2026-11-14T03:10:48Z.
What
A valid stride-zero RGB32_FLOAT read can receive a one-byte SSBO view for a 12-byte element, losing components. Captured PPSA05813 backpack draws exercise this path and produce misplaced, deformed geometry.
Preserve the full element extent for proven base formatted reads, including zero offsets obtained from captured SRT fields. Recheck those conditions at materialization, retain the extent in binding/result caches, and serialize the proof in the shader disk cache. Unproved offsets, packed/typed loads, writes and atomics keep their existing bounds. Include the matching KeyMiss fixture correction. The memo key uses the compiled shader metadata and adds the runtime extent for qualifying formatted reads. The cache-miss diagnostics also account for the stored extent list when moving to the next binding.
This replaces #14944. PPSA05813 needs the complete fix for correct rendering, so we are submitting it directly to help it reach main sooner.
The original implementation and tests are by @lgqdaxia; @arcwiser carried them in #14944. Original authorship is preserved.
Tested
Windows 11 build 26300 at
07c38bf7d776.agc_driver_key_misspassed. A focused comparison of the diagnostic function now identifies the second binding correctly with either an empty or a populated extent list.On Linux at
7d4c68d37254,agc_shader_base_formatted_read_extentpassed. A four-output RGB32 read keeps its 12-byte extent when W repeats X. A read that misses Z still gets no full-element extent. CPU regressionWindows 11 build 26300, MinGW-w64 GCC 15.2, NVIDIA GeForce RTX 3080 Laptop GPU / 621.14, Khronos validation layer 1.4.366.
Same asset-free GPU fixture on main
860c2a432293and this branch454a7f5896e9:(1.25, 0, 0)— fails(1.25, -2.5, 19)— passes(0, 0, 0)— fails(1.25, -2.5, 19)— passesBoth GPU CTests pass on the correction. Guards remain intact; both variants require Vulkan, disable shader disk caching, load the validation layer and report zero skips, VUIDs or sync hazards. The corrected runtime test also checks nonzero/zero SRT transitions.
The two-frame PPSA05813 replay restores backpack position and shape with draw reuse enabled: 94 submissions, zero unfinished work, pacing timeouts or VUIDs. This visual evidence uses the gameplay integration; its prerequisites are listed in the Game bring-up discussion.
Earlier checks and source pins — 13–28 November 2026
On Linux,
agc_shader_disk_cachepassed at94b9d754ad22. It round-tripped the formatted-read extents and image-overwrite metadata in format 99 and rejected cache entries marked with main’s format 98. Linux disk-cache testOn Ubuntu 26.04.1 LTS (GCC 15.2.0), commit
3694bf43399bpassed the standard and masked result-memo associativity tests and the runtime formatted-read-extent test (3/3). The change keeps existing memo keys for buffers without formatted reads. Linux run.Windows CI on
e6c44a63bf45(merged onto mainff5b409dda05) found an eviction-test failure because the extra zero extent moved ordinary buffers to different memo sets. The fix above restores the original grouping. Windows run.On Ubuntu 26.04.1 LTS,
agc_shader_disk_cachepassed atba8868d734e5. The test writes both the formatted read extents and main's image overwrite metadata to a format-97 cache entry and verifies both on readback. Linux run.On 19 November, head
1da20710754dbuilt on Ubuntu 26.04.1 LTS with GCC 15.2.0. The existing formatted-read-extent CPU regression passed (1/1, zero skips). Run.The paired GPU CTests are
agc_driver_buffer_format_oob2_stride_zeroandagc_driver_buffer_format_oob2_runtime_offsets; fixture SHA-256ae361014cdf1d2c84c4938bfc523473b325f645a20d6c9a8ff542c95ede1d4f0is identical in both builds. The main control restores every changed production file, leaving only test additions. The configured-build registration audit passes for 2,722 test executables.Earlier CPU extent/proof, shader-disk-cache and KeyMiss checks pass at production
60a6eeb128b0/ test correctiona01f40414e1a, on main667dbde5131d. Their production changes are preserved by the rebase. These cover excluded/poisoned/null SRT inputs, cache round trips and resource-key layout. Separate-process cache persistence also passes.The visual replay uses gameplay integration
9f5ad4dafc93. Earlier #14944-based SDK controls and their asset-free reproducer remain in #14439/#14944; the pinned main comparison is the table above.The source-overlap check reports shared AGC/cache/debt regions, including 68 stale-head comparisons requiring manual inspection. The reported source differences were inspected: #14944 is the intentional replacement; no additional equivalent repair or direct prerequisite was found. The publication scan checked 1,603 open heads for cache-format overlap. Merged main
6903ec4d24d4on 16 November. Both independent binding fields and their cache accounting/serialization are preserved; the combined layout uses cache format 89.Checklist
mainat the pinned revision above; intentional replacement for overlapping #14944, explained aboveNotImplemented_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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T21:09:12Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected implementation at head
c061a30410c5154baccba2dd692bce83f6be08dbshows a bounded read-extent proof for eligible formatted base reads and carries that extent through descriptor sizing, resource keys, result memoization, and disk-cache serialization; I did not run checks, and several changed files were excluded from review.What I ran
Results
Findings
Blocking
None in the inspected code.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp.core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp,core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp,core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp,core/libs/prx/libSceAgcDriver/tests/KeyMiss.cpp,core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp, the three changed CMake test files,core/libs/prx/libSceAgcDriver/tests/execution/BufferFormatOob2StrideZero.cpp,core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/Resources.hpp,core/shader/recompiler/Optimization/include/Optimization/DescriptorBindingBuilder.hpp,core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp,core/shader/recompiler/Optimization/src/ResourceTracker.cpp,core/shader/recompiler/Recompiler.cpp,core/shader/recompiler/Recompiler.hpp,core/shader/recompiler/ShaderDiskCache.cpp,core/shader/recompiler/ShaderDiskCache.hpp, anddocs/dev/debt/libSceAgcDriver.md.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T10:24:25Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected implementation and fixtures support the stated formatted-read extent correction, but this review is incomplete because several changed files were not read and no checks were run.
What I ran
ef449dcf7f12834dab032a5520b58d8103db1956.repo_read.pytools. No build or tests were run.Results
Findings
Blocking
None identified in the inspected code.
Non-blocking
No code issue identified in the inspected ranges.
Not verified
The review bundle lists 20 changed files. Full text was read for 15;
ShaderResources.cpp,Graphics.cpp, andShaderMemory.cppwere read only at targeted ranges, and their full text was not inspected. No build, CTest, or hardware replay was run; the checks in the PR description are author-reported. Excluded or not fully inspected paths include the remainder of those three files and portions of other included files not read in full.To get this to a good state
Nothing is required. Optional: complete the review of the remaining changed code and run the focused checks before requesting a formal approval.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T02:37:07Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change based on the diff and source ranges inspected; the reported tests were not run during this review.
What I ran
Inspected head
1a22f48f9db1bd06eac97308114b2cf55cece269, the prepared description, commits, manifest and diff, plus targeted repository ranges throughrepo_read.py. No build or tests were run. The author-reported checks are not independent results from this review.The diff covered 21 changed files. Full text was available for 18; the full text of
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas excluded for size. I read targeted ranges in each through the pinned reader.Results
Negative control
Not run; no test executable or build environment was available in this review.
Findings
Blocking
None.
Non-blocking
The description reports focused CPU and GPU checks, but this review did not independently run them.
Sources
core/shader/recompiler/Optimization/src/ResourceTracker.cpp:2322tracks the read proof and its zero-offset conditions.core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp:786computes the extent only for eligible formats and component coverage.core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp:5515applies the extent subject to descriptor and access guards.core/shader/recompiler/ShaderDiskCache.hpp:16advances the disk cache format version.Not verified
Builds, tests, GPU behavior, and the author-reported replay were not independently verified. The three size-excluded files listed above were read only in targeted ranges; their remaining contents were not reviewed.
To get this to a good state
Nothing is required. Optional: rerun the reported focused CPU and GPU checks on this exact head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T05:40:14Z.
Review: APPROVED
Reviewed — looks good
The change at head
a7838683aaace3d64f65ebd7e5f72acf40c7c454confines expanded SSBO extents to proven base formatted reads, threads the extent through resource binding and cache identity, and adds regression fixtures; the code reviewed supports merging.What I ran
No build or tests were run in this review. I inspected the prepared diff and used
repo_read.pyto read changed source regions at the pinned head.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full changed contents of
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwere excluded from the review bundle; the relevant changed regions were read throughrepo_read.py. I did not run the reported tests, build, or console replay. The author-reported Windows GPU, Linux CPU, cache, and replay results were not independently verified.Files read:
review/description.md,review/commits.md,review/manifest.json,review/diff.patch; changed source regions inWrittenBuffers.cpp,ShaderResources.hpp,Draw.cpp,ShaderResources.cpp,Graphics.cpp,KeyMiss.cpp,ShaderDiskCache.cpp,ShaderMemory.cpp,agc_driver_buffer_format_oob2_stride_zero_tests.cmake,agc_driver_graphics_tests.cmake,agc_shader_memory_tests.cmake,BufferFormatOob2StrideZero.cpp,Resources.hpp,DescriptorBindingBuilder.hpp,DescriptorBindingBuilder.cpp,ResourceTracker.cpp,Recompiler.cpp,Recompiler.hpp,ShaderDiskCache.hpp; andreview/manifest.jsonfile listing.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T09:49:41Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
ba8868d734e590522b1bc7f6c759d372795de092using the prepared diff andrepo_read.pyfor targeted source reads. No build or tests were run in this review; the reported test results in the PR description are author-provided.Results
Findings
Blocking
None in the code inspected.
Non-blocking
None.
Not verified
The changed files
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cppandcore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppwere too large to be included in the review bundle. Targeted ranges were read from the pinned head for the first and third;Graphics.cppwas not read.core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppand the remaining included changed files listed in the manifest were not read in full. No local checks were run. PR-reported tests and GPU replay were not independently verified.To get this to a good state
Nothing is required. Optional: run the new CPU and GPU regression tests in CI on the reviewed head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T17:06:06Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the review found no verified blocking defect, but the excluded changed files and unrun checks prevent approval.
What I ran
Reviewed head
e6c44a63bf45c4e3fb805abb6cb2942f9420f439usingrepo_read.pyagainst the prepared diff and pinned repository files. No commands or tests were run. The author reports CPU, GPU, disk-cache, and replay checks in the PR description; these were not independently run here.Read all prepared review documents and the complete diff. Read the full text of 19 of 22 changed files:
WrittenBuffers.cpp,ShaderResources.hpp,Draw.cpp,KeyMiss.cpp,ShaderDiskCache.cpp,ShaderMemory.cpp(relevant range),agc_driver_buffer_format_oob2_stride_zero_tests.cmake,agc_driver_graphics_tests.cmake,agc_shader_memory_tests.cmake,BufferFormatOob2StrideZero.cpp,Resources.hpp,DescriptorBindingBuilder.hpp,DescriptorBindingBuilder.cpp,ResourceTracker.cpp,Recompiler.cpp,Recompiler.hpp,ShaderDiskCache.hpp,docs/dev/debt/changes/codex-fix-srt-zero-read-extents.md, andGraphics.cpp(relevant range).ShaderResources.cppwas read only in relevant ranges. The full text ofGraphics.cppandShaderMemory.cppwas excluded from the review folder as too large; their changed ranges were read through the pinned reader.Results
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
The author-reported checks were not independently reproduced. Full file text was not read for
ShaderResources.cpp,Graphics.cpp, andShaderMemory.cpp; targeted changed regions were read. No other changed files were excluded, and no claim is made about the unread portions of those files.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T04:08:52Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change based on the inspected code; the author-reported regression results support the stated fix.
What I ran
Head:
3694bf43399b3882c79e5cb802252f43180fcfd4. I inspected the prepared diff and manifest, then read targeted sections from the pinned repository usingrepo_read.py. I ran no commands or tests. The description reports Linux CPU tests and Windows GPU tests; those results were not independently run.Files read:
WrittenBuffers.cpp,ShaderResources.hpp,Draw.cpp,ShaderResources.cpp(targeted sections),Graphics.cpp(targeted sections),KeyMiss.cpp,ShaderDiskCache.cpp(targeted sections),ShaderMemory.cpp(diff only),agc_driver_buffer_format_oob2_stride_zero_tests.cmake,agc_driver_graphics_tests.cmake,agc_shader_memory_tests.cmake,BufferFormatOob2StrideZero.cpp(diff only),Resources.hpp,DescriptorBindingBuilder.hpp,DescriptorBindingBuilder.cpp(targeted sections),ResourceTracker.cpp(targeted sections),Recompiler.cpp(targeted sections),Recompiler.hpp,ShaderDiskCache.hpp, and the debt note.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full text of
ShaderResources.cpp,Graphics.cpp, andShaderMemory.cppwas not read;ShaderResources.cppandShaderMemory.cppwere excluded from the review bundle for size, andGraphics.cppwas inspected only around the added fixture. No build, test, cache round trip, or console replay was performed by the reviewer. The description's CI and GPU results remain author-reported.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-28T05:08:52Z.
Review: COMMENTED
Actionable comments posted: 1
f3611b3c-e802-43a2-afb7-a7ab52d576e1Reviewing files that changed from the base of the PR and between
4c7578e0a4and94b9d754ad.core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/KeyMiss.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_buffer_format_oob2_stride_zero_tests.cmakecore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_graphics_tests.cmakecore/libs/prx/libSceAgcDriver/tests/cmake/agc_shader_memory_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/BufferFormatOob2StrideZero.cppcore/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/Resources.hppcore/shader/recompiler/Optimization/include/Optimization/DescriptorBindingBuilder.hppcore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppcore/shader/recompiler/Optimization/src/ResourceTracker.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.hppdocs/dev/debt/changes/codex-fix-srt-zero-read-extents.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T07:10:48Z.
Review: COMMENTED
Reviewed — comments
The reviewed diff shows a possible flaw in the SRT zero-offset proof; I could not complete verification of all changed files, so a formal approval or change request is not justified.
What I ran
Reviewed head
7d4c68d37254f8831532d830496813e56082c167using the prepared diff and the pinned repository reader. No tests were run in this review. The author reports Linux CPU and Windows GPU test results in the PR description; those were not independently run here.Results
Findings
Blocking
None verified.
Non-blocking
core/shader/recompiler/Optimization/src/ResourceTracker.cpp:2705— The shift/mask proof combines shifts by left-shifting the mask, but does not track whether the constant mask was applied before or after the shift. For((SRT >> 5) & 0x7f), this proves bits 5–11 are zero; for((SRT & 0x7f) >> 5), the same transformation incorrectly checks bits 5–11 instead of bits 0–6. If the IR can express the latter form, a nonzero value in bits 0–4 can produce a nonzero runtime offset while the proof accepts the descriptor’s full read extent. Consider rejecting mask-before-shift forms or preserving operation order in the proof.Not verified
The full text of
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas excluded from the review folder and was not read through the reader. Other changed files listed as included inreview/manifest.jsonwere not all read in full. No test commands were executed. The author-reported test and hardware results were not independently confirmed.To get this to a good state
Nothing is required. Optional: preserve the order of shift and mask operations in the SRT zero-offset proof, or fail closed for mask-before-shift expressions.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T06:42:20Z.
Review: APPROVED
Reviewed — looks good
The review covers head
e26161f2469508a623b1c624acc34ec85344ba18; all 21 changed paths were inspected, and I found no verified blocking defects.What I ran
Read the prepared diff and manifest, then used
repo_read.pyto inspect targeted source ranges at the pinned head. Environment: Linux review container; no compiler or build system invoked. No tests were run. No merged-preview check was run.Results
Negative control
Not run; no test or source mutation was performed during this review.
Findings
Blocking
None.
Non-blocking
None.
Sources
The proof is limited to eligible read-only formatted base reads, and rejects unproved SRT offsets at materialization: ResourceTracker.cpp, DescriptorBindingBuilder.cpp.
The runtime extent is applied to eligible descriptor ranges and incorporated into resource identity and memo keys: ShaderResources.cpp, Recompiler.cpp.
Not verified
I did not run the submitted CPU/GPU tests or the PPSA05813 replay; their reported results in the PR description are author-provided. Full text was omitted by size for
ShaderResources.cpp,Graphics.cpp, andShaderMemory.cpp; I inspected their changed hunks and relevant source ranges usingrepo_read.py. No changed paths were excluded by rule.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T06:46:42Z.
Review: COMMENTED
🏛️ Architecture findings (1)
Advisory architecture findings (1)
💬 Code review
Actionable comments posted (1)
f9501e27-6aef-47b2-bfa6-5c3940e5aef2Reviewing files that changed from the base of the PR and between
7d4c68d372ande26161f246.core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_graphics_tests.cmakecore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppcore/shader/recompiler/Optimization/src/ResourceTracker.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T07:06:46Z.
Review: APPROVED
Reviewed — looks good
The changed code and regression-test hunks at
07c38bf7d776f915b2567b7d89eae98dd2419f8bconsistently carry proven formatted-read extents through descriptor sizing, cache identity, and queued read ranges.What I ran
Reviewed head
07c38bf7d776f915b2567b7d89eae98dd2419f8b. Read the prepared description, commit list, manifest, and diff; inspected changed hunks for all 21 files, usingrepo_read.pyfor the three files whose full text was excluded from the review folder. No build or test command was run.Results
Negative control
Not run; no source mutation or test execution was performed for a negative control.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
No build, CPU test, GPU test, physical-console behavior, or gameplay replay was independently verified. The author-reported checks in the PR description were not rerun. The full files
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwere excluded from the prepared folder due to size; their changed hunks were inspected throughrepo_read.py.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T07:10:53Z.
Review: COMMENTED
🏛️ Architecture findings (1)
Advisory architecture findings (1)
💬 Code review
3eba6345-b154-42b1-b981-946372a7665aReviewing files that changed from the base of the PR and between
e26161f246and07c38bf7d7.core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/KeyMiss.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T12:38:17Z.
Review: APPROVED
I read the diff at
07c38bf7d7. Windows 11, GCC 15.2, merged intomainatdaa61711afetogether with other open PRs (so not an isolated build), withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1andVK_LAYER_KHRONOS_validationon an RTX 5080 (621.24) and a Radeon iGPU (26.11.2).agc_shader_memory,agc_shader_base_formatted_read_extent,agc_shader_disk_cacheandagc_driver_graphics: pass on both GPUs. The loader log shows the layer inserted and no "was not found" line, and neither run has aVUID-orSYNC-HAZARDline.agc_shader_memoryran with one other PR of the tree taken out, because that one fails it.Not checked: a title.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T16:32:57Z.
Review: COMMENTED
On Linux/lavapipe,
agc_driver_gcn_scalar_buffer_baseandagc_shader_memorypassed on main atba0ff896612band with this head integrated. The addedagc_driver_buffer_format_oob2_runtime_offsetsandagc_shader_base_formatted_read_extentcases also passed. The paired Vulkan runs and the extra runtime-offset case loaded Khronos validation 1.4.369 with Vulkan required and the shader cache disabled. No missing-layer warnings or VUIDs appeared.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-03T20:00:43Z.
Review: COMMENTED
Actionable comments
bufferReadExtentTests.core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp, lines1800–1802· 🗄️ Data Integrity & Integration · ⚡ Quick winOverwriteAliasedsizes each stride-zero buffer element frombufferExtentonly. A formatted read can now copybufferReadExtentbytes, which can exceedbufferExtent(for example, 12 versus 4 bytes for RGB32 reads built from single-dword loads). A storage-image range that overlaps the unchecked tail is then not treated as aliased.OverwriteClaimForcan accept the claim. The claim makesDiscardPendingCovereddrop pending texture data in that range, which the tail read may need. Include the binding read extent in the overlap size, as the element size already does forbufferExtent.Suggested fix
0844bcd2-3472-45aa-a7c2-12b342c3d325Reviewing files that changed from the base of the PR and between
07c38bf7d7anda0fa602594.core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_graphics_tests.cmakecore/shader/recompiler/Optimization/src/ResourceTracker.cppcore/shader/recompiler/ShaderDiskCache.hppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T20:36:02Z.
Review: APPROVED
Reviewed — looks good
The reviewed change is sound; I found no blocking defects in the changed hunks at head
463877e6f839fc72ba791ee3dbd1bb3af6b3ec1f.What I ran
Read the prepared description, commits, manifest, diff, and all 21 changed files’ hunks; used
repo_read.pyfor targeted source and caller context pinned to the stated head. No tests or builds were run.Results
Negative control
Not run; no binary-only negative control was available in the prepared review inputs.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
Tests and GPU behavior were not independently run. For the three large files omitted from
files/(ShaderResources.cpp,Graphics.cpp, andShaderMemory.cpp), I read the changed hunks and relevant source context; unchanged portions were not read. Author-reported test results were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T12:31:51Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: correct the SRT bit-mask proof and add a regression for an AND-before-shift offset.
What I ran
Reviewed head
c16d1407bb1082d1f6f4c412608fca8c4da1127aby inspecting the prepared diff and usingrepo_read.pyfor source context. No tests were run.The reader returned the requested source lines, then reported that it could not write its read log because the filesystem is read-only.
Results
Negative control
Not run; no test was run to confirm the proposed regression fails before the fix.
Findings
Blocking
core/shader/recompiler/Optimization/src/ResourceTracker.cpp:2713: the proof shifts the accumulated mask left whenever it encounters a logical right shift. For(SRT & 0x0000ff00) >> 8, the mask should remain0x0000ff00; this code changes it to0x000ff000. An SRT value of0x00000100therefore produces a nonzero offset while passing the zero proof. That can incorrectly qualify the read for a full formatted-element extent. Preserve the actual zero condition for each supported operation ordering and add a regression for this expression.Non-blocking
None.
Sources
Not verified
No tests were run. The full file text was not read for
ShaderResources.cpp,Graphics.cpp, orShaderMemory.cpp; their changed hunks were inspected indiff.patch. All 21 files listed underreviewedinfiles.jsonwere covered at the changed-hunk level;files.jsonlists no excluded files.To get this to a good state
Correct the proof mask handling and add an AND-before-shift regression. On the new head, rerun the
agc_shader_memorycoverage and the formatted-read GPU tests, includingagc_driver_buffer_format_oob2_runtime_offsets.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T13:31:28Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
04c6422ff5016e7df6f4ac540a613d9b5e17feb8using the prepared diff and targeted reads throughrepo_read.py. No tests were run; the reported CI and GPU checks are author-reported.Results
Negative Control
Not run; no test binary was executed.
Findings
Blocking
None.
Non-blocking
None.
Sources
The extent proof and captured SRT checks are in DescriptorBindingBuilder.cpp and ResourceTracker.cpp. Binding sizing and cache identity include the proved extent in ShaderResources.cpp and Recompiler.cpp. The disk cache format is advanced in ShaderDiskCache.hpp.
Not verified
Read changed hunks for all 21 paths in
files.jsonunderreviewed. The three files whose full text was not included in the review folder—ShaderResources.cpp,Graphics.cpp, andShaderMemory.cpp—were read at the pinned head withrepo_read.py.files.jsonlists no excluded paths. Tests, CI results, GPU behavior, and the gameplay replay were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-04T16:29:07Z.
Review: APPROVED
Re-verified head
04c6422ff5on Windows 11 with GCC 15.2, applied alone to main484b0368d3. The new commit adds the mask-before-shift offsets toShaderMemory.cpp.agc_shader_memory,agc_shader_base_formatted_read_extent,agc_shader_disk_cacheandagc_driver_graphics: 4 of 4 pass with both the NVIDIA and the AMD loader selected. On main the three that exist there pass too. This timeagc_shader_memoryran on its own, with no other PR in the tree.VUID-.As before there is no behavioural control: the tests use the new fields and do not compile against main's sources.
Not checked: a title.
AI-assisted: yes (Claude Code)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.