perf(shader): store cached SPIR-V compressed with zstd #22692
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22692"
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 Logan1h on 2026-11-18T03:05:27Z.
What
Store
ShaderDiskCachecompiled SPIR-V payloads as level-1 zstd frames when compression shrinks them (keeping raw otherwise), and decompress on demand behind a bounded LRU.FormatVersionbumps from99to100.TL;DR
4.94 vs 14.79 GiBon EA SPORTS UFC 6 (-66.5%on Crimson Desert:5.00 vs 14.91 GiB).5.1×per hit):-75.8%I/O and-29.7%read time on cold SSD (14.6 vs 15.7 ms/hit), and22.75 s (~3.8 s wall)vs147.0 s (~25 s wall)(2.80 vs 14.2 ms/hit) on repeat launch because the compressed cache fits in OS page cache while the 23.3 GiB raw cache spills out of 32 GiB RAM.-206…-571 MiBPeak Private RAM,+3.5%…+8.0%presents (-0.74…-1.05 msp50) inwarm235:5, and no cold-boot regression.29decompressions (1.8 mstotalZSTD_decompressDCtx),0LRU evictions,0re-decompressions,1.0 MiBheld in the 64 MiB LRU.Review Guide
The PR touches 39 unique files (matching
Files changed), split into 2 clean, independently buildable/testable commits. Commit 1 is the mechanicalSharedSpirv::Leasemigration (34 files); all substantive zstd/LRU/format-100 logic is isolated in the 9 files of commit 2 (4 of them —Recompiler.hpp,Recompiler.cpp,tests/ShaderDiskCache.cpp,tests/Graphics.cpp— are also touched by commit 1):refactor(shader): route SPIR-V reads through SharedSpirv::Lease(38bcecbde60, 34 files) — mechanical migration of SPIR-V readers toSharedSpirv::Lease(Words(),Magic(),Version()), plus single-lease patching inPipeline.cppand decompression-free header checks inDraw.cppandVulkanDevice.cpp.perf(shader): store cached SPIR-V compressed with zstd(01514d734a0, 9 files) — all substantive zstd/LRU/format-100 logic:Recompiler.hpp,Recompiler.cpp,CompiledVariant.hpp,ShaderDiskCache.hpp,ShaderDiskCache.cppcore/shader/recompiler/CMakeLists.txt(links vendored3rdparty/zstd),docs/dev/ENVIRONMENT.mdtests/ShaderDiskCache.cpp,tests/Graphics.cppDesign
SharedSpirvretains only the mapped encoded bytes, word count,header[0..1](magic,version), and 128-bitSpirvContentHash.SharedSpirv::Words()materializes on demand into an alignedstd::make_unique_for_overwrite<std::uint32_t[]>buffer (SharedSpirv::Buffer) shared across concurrent leases viaweak_ptr.MaterializedSpirv): 64 MiB default (APS5_SPIRV_MATERIALIZED_MB), immortal singleton matchingstore()/lifecycle(). Hits refresh recency (re-retaining live-leased entries if evicted); evicted buffers drop outside the mutex;Retain()rolls backretainedonindex.emplacefailure for strong exception safety.Magic()/Version()readheader[0..1]without decompression (Draw.cppstencil replay,VulkanDevice.cppcompute magic guard);declaresAtomicLockTableis persisted in format 100;dumpFinalSpirv()checksAPS5_DUMP_SPIRVbefore leasing;Pipeline::Pipelineshares oneWords()lease across all patch branches.ZSTD_CCtx/ZSTD_DCtxand an uninitialized scratch buffer are owned viaThreadOwned(safe against MinGW emutls teardown order).Safety & Validation
16,777,216words (64 MiB) before encode/decode allocation.ZSTD_findFrameCompressedSize == payload.size(),ZSTD_getFrameContentSize == wordCount * 4,header[0..1]matches (also covered by on-diskFileHeader::payloadHash), and the single-pass 128-bitHashSpirvContentmatches on first decompression. Corrupted/truncated entries become counted load failures.Compatibility
FormatVersionbumps99 -> 100.APS5_NO_SHADER_CACHE_ZSTD=1writes uncompressed format-100 entries; both compressed and raw format-100 entries remain readable. Pipeline journal encoding continues to receive rawEncodeResultbytes.Tested
1.4.341.1>=VK_HEADER_VERSION335), WinLibs GCC 15.2.0 Release.upstream/mainfb41bd71986vs PR01514d734a0, bit-identical tree to1016ec82d9e):ctest --test-dir build-zstd -R "^(agc_shader_disk_cache.*|agc_shader_memory.*|agc_spirv_module|agc_driver_(graphics|mesh|prepared_graphics|prepared_shaders|stencil_replay|bda_anchor_reads|runtime_buffer_spans))$" -VwithANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer.main(fb41bd71986): 15/15 passed, 8×Insert instance layer "VK_LAYER_KHRONOS_validation", 0 missing-layer warnings, 0VUID-.01514d734a0): 15/15 passed, 8×Insert instance layer "VK_LAYER_KHRONOS_validation", 0 missing-layer warnings, 0VUID-.38bcecbde60) independently built and passedagc_shader_disk_cache,agc_shader_memory,agc_spirv_module(3/3).python tools/check_conventions.py --base upstream/mainandgit diff --check fb41bd71986: passed.Paired A/B Benchmark — EA SPORTS UFC 6 (
PPSA23566v01.005, 1920×1080 HDR10)All runs use identical flags (
APS5_PROFILE_DRAW=1,APS5_TRACE_SUMMARY_EVERY=10,APS5_TRACE_SECONDS=35:5,APS5_NO_PAD_INPUT=1,SDL_AUDIODRIVER=dummy, isolated shader & NVIDIA caches per arm). Zero load/write failures.ms/hit35:5presents /p50main_cold(fb41bd719869)pr_cold(1016ec82d9e1)main_warm2_1(cold SSD)pr_warm2_1(cold SSD)main_warm2_2(repeat; spills RAM)pr_warm2_2(repeat; fits OS cache)29decompressions (1.8 mstotalZSTD_decompressDCtx,0.1 msalloc,0.2 mshash,1.0 MiBout),0re-decompressions,0LRU evictions,0.0 msLRU lock wait,1.0 MiB / 64 MiBheld.Raw
aps5-summary.jsonllines (warm2_2,seconds 35:5:fb41bd719869vs1016ec82d9e1)Earlier
warm1run (Windows Standby RAM eviction artifact) & historical external cross-checksIn the initial sequential
main_cold -> pr_cold -> main_warm1 -> pr_warm1run,main_warm1read 7.5 GiB from warm Windows Standby RAM (479 MiB/s) while writing 7.2 GiB that evictedcache_prto NVMe (112 MiB/s):main_warm1:14,791.8 MiBon disk,7,579.7 MiB / 17.30 sread,7,947 / 10,298 MiBWS/Private,35:5:177presents /27.66 msp50.pr_warm1:4,943.7 MiB(-66.6%) on disk,2,567.8 MiB / 24.13 sread (cold NVMe),7,994 / 10,471 MiBWS/Private,35:5:163presents /30.29 msp50.Historical external validations on earlier heads:
milescoviello(Ubuntu 26.04.1, RTX 4070 Ti, driver 615.71): Crimson Desert (PPSA25286) cold A/B at 150 s —14.91 GiBonmainvs5.00 GiBwith PR (-66.5%).domx4q(Arch Linux, RTX 4090, driver 620.70.06, Khronos layer 1.4.363.1): 73 focused tests passed onmainand PR, 98 layer insertions,0 VUID-.Colewiz7(Linux, Mesa 26.2.6 RADV, RX 7900 XT & 7800X3D iGPU) andupipibi(Windows, NVIDIA): no new failures or validation errors.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T10:54:35Z.
Review: COMMENTED
Reviewed — comments
Changes are not ready for a formal approval because the full review is incomplete: three changed files were not read, and no checks were run in this review session.
What I ran
Reviewed head
184e5fafcc3f91fa7b2fe3709b0255a96b4c0965. Read the prepared description, commit list, manifest, diff, review folder README, and targeted repository ranges usingrepo_read.pytools. No build or tests were run; test results in the PR description are author-reported.Results
Findings
Blocking
None identified in the code inspected.
Non-blocking
None.
Not verified
Did not read
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, orcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp; these files were excluded from the prepared folder because they were too large and were not inspected through the repository reader. The remaining changed files were listed in the review bundle but their full added-line ranges were not all read. No local build, tests, or performance measurements were run. The claimed Windows and Linux results remain author-reported.To get this to a good state
Nothing is required. Optional: complete inspection of the unread changed lines and run relevant checks before requesting approval.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T14:53:26Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: fix the changed test helpers that return spans backed by temporary
SharedSpirv::Leaseobjects.What I ran
Reviewed head
15fa00e699b0e4a06de681becd8cf8c121604218using the pinnedrepo_read.pyreader. No build or tests were run during this review. The description reports builds and tests on a different rebased head (184e5fafcc3f91fa7b2fe3709b0255a96b4c0965); those results were not independently run here.Results
Findings
Blocking
Lease; once the temporary is destroyed, its owner is released and the returned span can dangle. This affects thepixel,vertex, anddomainhelpers atcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:7637,:7687,:7797,:7816,:7942,:8159,:8370, and the texel-offset helper at:10158. For example,count(pixel(false))consumes the returned span after theLeasecreated byRecompile(request).spirv.Words()has gone out of scope. Keep the lease alive for the span's full use, or copy the words into an owning vector before returning. The lease ownership contract is implemented incore/shader/recompiler/Recompiler.hpp:814-835and:909-918.Non-blocking
Not verified
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwere excluded fromfiles/because they are large. Relevant changed regions inVulkanDevice.cpp,Graphics.cpp, andShaderMemory.cppwere read through the pinned reader; the rest of those files was not reviewed.To get this to a good state
Update the affected test helpers to retain a
SharedSpirv::Leasewhile their spans are used (or return owning vectors), then rerun the affected test targets on this exact head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T22:26:26Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected implementation and tests support the stated compressed-cache behavior.
What I ran
Reviewed head
297077df664cbd3370d2f67d75e34023f8ef38e7using the prepared diff and pinned repository readerrepo_read.py. No build or tests were run by me; the build and test results in the PR description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The changed files
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwere not read in full; their changed hunks were visible in the prepared diff. Other changed files were read as included in the review bundle. Files excluded from the diff by preparation rules were not reviewed. Runtime performance measurements and the author-reported build, tests, and hardware runs were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T13:03:45Z.
Review: COMMENTED
Reviewed — no blocking findings
No blocking defect was verified in the targeted cache and lease paths; the review is incomplete, so a formal approval is not justified.
What I ran
668aefef7289d3eea538326df6881bca0146d8e1.repo_read.pywas unavailable as a callable command in this session.Recompiler.hpp,ShaderDiskCache.cpp, andShaderDiskCache.hpp.Results
Findings
Blocking
None verified in the targeted cache codec and lease implementation.
Non-blocking
None.
Not verified
The manifest lists 35 changed files. I read targeted implementation lines in three head files and reviewed portions of
diff.patch; I did not inspect every added line in every changed file. Full text was excluded forVulkanDevice.cpp,tests/Graphics.cpp, andtests/ShaderMemory.cpp. The remaining changed files were not individually reviewed in full. Build, test, merge-preview, and hardware behavior were not independently verified; results in the description are author-reported.To get this to a good state
Nothing is required. Complete review of the remaining changed lines before treating this as an approval.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T17:39:05Z.
Review: COMMENTED
Reviewed — comments
The cache codec and lease changes show no verified blocking defect, but I did not read every changed file, so a formal approval is not justified.
What I ran
I inspected head
37bc12813694dee4840d3ffc15ec1fe0bb06f9b1usingrepo_read.pyto read the prepared description, commits, manifest, diff, and selected source ranges. I ran no build or tests; test results in the description are author-reported.Results
Negative control
Not run; no tests were run during this review.
Findings
Blocking
None verified in the code inspected.
Non-blocking
None.
Sources
Inspected
core/shader/recompiler/Recompiler.hpp,core/shader/recompiler/ShaderDiskCache.cpp, and relevant hunks inreview/diff.patchfor lease ownership, bounded decode, zstd framing, and hash validation. The diff changes are pinned to commit37bc12813694dee4840d3ffc15ec1fe0bb06f9b1.Not verified
I read the prepared description, commits, manifest, diff, and selected ranges of
Recompiler.hppandShaderDiskCache.cpp. The manifest lists 39 changed files; I did not read all of their full text or all call-site hunks. In particular, the changedVulkanDevice.cpp,Graphics.cpp, andShaderMemory.cppfiles were excluded fromreview/files/by size, and I did not read their full text through the reader. I did not run builds or tests, verify reported CI, or validate the performance measurements.To get this to a good state
Nothing is required. Optional: complete review of the remaining changed files and run the affected build and tests before making a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T19:14:06Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the notes below are optional.
What I ran
Reviewed head
fa72c03be8327855de8322b0423e8a18759068e1using the prepared diff andrepo_read.py; I did not run build or test commands.Results
Findings
Blocking
None.
Non-blocking
Spirv()checks raw byte count and can return mapped words directly, while compressed payloads verify their hash when materialized. Consider checking the hash for raw cache entries too, or clarify that the outer entry hash is the integrity check. Changed lines:core/shader/recompiler/ShaderDiskCache.cpp:456-465.Not verified
Recompiler.hpp,ShaderDiskCache.cpp,VulkanDevice.cpp,Pipeline.cpp,PipelineSpecialization.hpp, andtests/Graphics.cpp. The full contents of changed files were not all read.VulkanDevice.cppandtests/Graphics.cppwere excluded from the review bundle as too large; selected ranges were read throughrepo_read.py. Other changed files were reviewed through their diff only.To get this to a good state
Nothing is required. The optional raw-entry integrity check is noted above.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T19:30:44Z.
Review: COMMENTED
Reviewed — no blocking findings
No concrete defect was verified in the cache codec and SPIR-V lease changes, but checks were not run and the supplied test report names a different head from the pinned revision.
What I ran
Reviewed head
cb15b5d0bdaa39a3739704a48449a521b25b8d5cusingrepo_read.pyreader tools. No shell commands or tests were run. The description reports checks for37bc12813694dee4840d3ffc15ec1fe0bb06f9b1, so those results do not establish checks on this pinned head.Results
Negative control
Not run; no tests were run in this review.
Findings
Blocking
None verified.
Non-blocking
None.
Sources
Not verified
The three changed files marked excluded in the manifest were not read at the pinned head:
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp. Other changed source files were inspected in the prepared diff, not read in full at the pinned head. Build, focused tests, CI, and console behavior oncb15b5d0bdaa39a3739704a48449a521b25b8d5cwere not verified.To get this to a good state
Nothing is required. Optional: run the reported checks on the pinned head and update the description with those results before seeking a formal approval.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-28T07:30:23Z.
Review: COMMENTED
Actionable comments posted: 2
b323629a-1003-4827-92e6-3740b0c6ced1Reviewing files that changed from the base of the PR and between
6329c2edc8and5a2dc23a9a.core/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/PipelineSpecialization.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Mesh.cppcore/libs/prx/libSceAgcDriver/tests/MeshOutputStaging.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/SpirvModule.cppcore/libs/prx/libSceAgcDriver/tests/VertexLayerExport.cppcore/libs/prx/libSceAgcDriver/tests/execution/BdaAnchorReads.cppcore/libs/prx/libSceAgcDriver/tests/execution/GdsIntegerAtomics64.cppcore/libs/prx/libSceAgcDriver/tests/execution/GpuBufferFormat.cppcore/libs/prx/libSceAgcDriver/tests/execution/LayeredVolumeDraw.cppcore/libs/prx/libSceAgcDriver/tests/execution/MeshWaves.cppcore/libs/prx/libSceAgcDriver/tests/execution/PackedIntegerNative.cppcore/libs/prx/libSceAgcDriver/tests/execution/PreparedExports.cppcore/libs/prx/libSceAgcDriver/tests/execution/PreparedGraphics.cppcore/libs/prx/libSceAgcDriver/tests/execution/PreparedPublication.cppcore/libs/prx/libSceAgcDriver/tests/execution/PreparedShaders.cppcore/libs/prx/libSceAgcDriver/tests/execution/RectListCorner.cppcore/libs/prx/libSceAgcDriver/tests/execution/RuntimeBufferSpans.cppcore/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cppcore/libs/prx/libSceAgcDriver/tests/execution/ScratchPool.cppcore/libs/prx/libSceAgcDriver/tests/execution/StencilNullFeedback.cppcore/libs/prx/libSceAgcDriver/tests/execution/StencilReplay.cppcore/libs/prx/libSceAgcDriver/tools/ShaderReplay.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.hppcore/shader/recompiler/SpirvBackend/src/BarycentricGeometryShader.cppcore/shader/recompiler/SpirvBackend/src/RectListShaders.cppcore/shader/recompiler/SpirvBackend/src/TessellationCaptureShader.cppdocs/dev/ENVIRONMENT.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:33:16Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed cache codec and SPIR-V lease changes have no verified blocking defects; the draft review folder does not include the full text of every changed file, so the review is incomplete for approval.
What I ran
5a2dc23a9ab2b06d3d8a9c117f4f3b9e3cc1cbbcusingrepo_read.pyreader tools.Results
Findings
Blocking
None verified in the source inspected.
Non-blocking
None.
Not verified
manifest.jsonmarksVulkanDevice.cppand test filesGraphics.cppas too large for the review folder; the full diff also contains many caller and test adaptations that were not individually inspected.files.jsonwas not available through the reader, so the complete excluded-file list could not be confirmed.description.md,commits.md,manifest.json,diff.patch, targeted ranges ofShaderDiskCache.cpp,Recompiler.hpp, andVulkanDevice.cpp. Exclusions: see limitations above; remaining changed-file full texts were not read.To get this to a good state
Nothing is required. Optional: confirm the excluded changed-file paths and review their relevant hunks before relying on this review as complete.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T09:00:55Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected cache codec and lease changes show no verified blocking defect, but the full changed-file set and reported checks were not independently verified.
What I ran
Reviewed head
1f991009703b99300ff51b3d80f156ab784de53ausing the prepared diff and pinnedrepo_read.pyreader. No build or tests were run; the description’s build, test, and measurement results are author-reported.Results
Negative control
Not run; no test execution was performed.
Findings
Blocking
None verified in the inspected code.
Non-blocking
None.
Not verified
Only targeted ranges of four changed repository files were read in full-file context:
core/libs/prx/libSceAgcDriver/CMakeLists.txt,core/shader/recompiler/Recompiler.hpp,core/shader/recompiler/ShaderDiskCache.cpp, andcore/shader/recompiler/ShaderDiskCache.hpp. The prepared diff covered all 39 changed files, but full text was not read for the remaining 35; three changed files were excluded from the review folder because they were too large. I did not verify author-reported CI, build/test output, or performance captures and traces.To get this to a good state
Nothing is required. Optional: independently review the remaining changed-file ranges and verify the reported checks and performance evidence before making a formal approval decision.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-28T09:05:16Z.
Review: COMMENTED
Actionable comments posted: 2
7cae812d-a800-463c-86fa-cb3072927d32Reviewing files that changed from the base of the PR and between
5a2dc23a9aand1f99100970.core/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/execution/LayeredVolumeDraw.cppcore/libs/prx/libSceAgcDriver/tests/execution/StencilNullFeedback.cppcore/libs/prx/libSceAgcDriver/tools/ShaderReplay.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.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 coderabbitai[bot] on 2026-11-28T13:42:22Z.
Review: COMMENTED
Actionable comments posted: 1
80be9584-ab8e-45de-ba06-62e5b39e5719Reviewing files that changed from the base of the PR and between
722effb12eandb724fefeeb.core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/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-11-28T13:48:10Z.
Review: COMMENTED
Reviewed — comments
The cache compression and lazy SPIR-V access changes are supported by the code inspected at head
b724fefeeb008586d755f73a8dc0d5754ea5ef9d; tests were not run as part of this review.What I ran
Read the prepared description, commits, manifest, diff, and targeted source ranges through
repo_read.py. No tests or builds were run.Results
Findings
Blocking
None.
Non-blocking
Not verified
VulkanDevice.cpp,Graphics.cpp, andShaderMemory.cppwere read only at relevant targeted ranges or not read in full; other changed files were not all inspected at their added lines. In particular, no review was made of every changed caller or test hunk.To get this to a good state
Nothing is required. The verification note above is optional.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T14:07:11Z.
Review: COMMENTED
Reviewed — comments
The review found one non-blocking mismatch between the stated cache format version and the changed constant; the review is incomplete because not every changed file was read.
What I ran
Reviewed the prepared diff and targeted source at head
6269ed482384238fd206a3e75d54bae98f0bf658using the PR reader. No build or tests were run.Results
Findings
Blocking
None identified in the inspected code.
Non-blocking
FormatVersionbecomes 97, but the changed constant is 99 (core/shader/recompiler/ShaderDiskCache.hpp:1931). Please correct the description so it matches the implementation.Sources
review/description.md,review/commits.md,review/manifest.json, andreview/diff.patch.core/shader/recompiler/Recompiler.hpp,core/shader/recompiler/ShaderDiskCache.cpp.Not verified
The full text of the changed files excluded from the review bundle was not read:
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp. Other included changed files were listed but not individually inspected. Tests and build results in the PR description were not independently run.To get this to a good state
Nothing is required. Optional: correct the format-version statement in the description.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T08:05:11Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the points below are optional.
What I ran
6ef5f0500a7e243b92d5fcc0a02b27679d2c5720.repo_read.py; no build or tests were run by me.Results
Findings
Blocking
None.
Non-blocking
Not verified
VulkanDevice.cpp,Graphics.cpp, andShaderMemory.cppwere excluded from the review bundle; only targeted ranges were read throughrepo_read.py.To get this to a good state
Nothing is required. The optional point above is for confidence in the rebased head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-02T17:10:45Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
ef9780536833807a3287b7264711e3b8eeed2fc4from the prepared diff and targeted source excerpts. No tests or builds were run. The pinnedrepo_read.pyreader failed while logging a read because the run folder is read-only.Results
Findings
Blocking
None verified in the inspected hunks.
Non-blocking
None.
Not verified
Full source for
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas unavailable infiles/; the pinned reader could not retrieve it. Tests, builds, and runtime behavior were not independently verified. The manifest lists 39 changed paths and no rule-excluded files.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T00:59:04Z.
Review: COMMENTED
Reviewed — no blocking findings
I reviewed head
c19f4dfe67ef4531df5129ed203d6f5dfa7e06c9; the inspected cache codec and SPIR-V lease paths look sound, but I did not inspect every changed source file or the performance artifacts, so a formal decision is not justified.What I ran
Read the prepared description, commit list, manifest, diff, and file list. Inspected targeted source ranges at the pinned head; no tests, builds, or other executable checks were run.
Results
Negative control
Not run; no test was executed.
Findings
Blocking
None identified in the inspected code.
Non-blocking
None.
Sources
Not verified
The manifest lists 39 reviewed files. I read targeted source ranges in
ShaderDiskCache.cpp,ShaderDiskCache.hpp,Recompiler.hpp,Recompiler.cpp,CMakeLists.txt,VulkanDevice.cpp, andGraphics.cpp, plus the changed cache tests; remaining changed files were not individually inspected beyond the prepared diff. The two files omitted fromfiles/due to size were not read in full. Author-reported test results were not independently confirmed. The prepared review folder did not include performance captures, traces, or digest output, so those artifacts were not verified.To get this to a good state
Nothing is required. Optional: inspect the remaining changed files and performance artifacts before making a formal review decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T14:26:37Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: bump the shader-cache format version so entries written with the new SPIR-V record layout cannot be mistaken for format 98 entries.
What I ran
Reviewed head
f3e21c0670f2af8d57feffe491a582adf494248b. Inspected the prepared diff and manifest, then read focused source ranges withmcp__pr__read_file. No tests or builds were run.Results
Negative control
Not run; no tests were executed.
Findings
Blocking
core/shader/recompiler/ShaderDiskCache.cpp:411changes the serialized SPIR-V record to include a codec, word count, content hash, and payload byte count. However,ShaderDiskCache.hppleavesFormatVersionat 98, the same version used by the prior record layout. Existing entries can therefore pass the format check and be parsed using the incompatible new layout, instead of being rejected as stale. Bump the format version to 99. Pinned source · Pinned version definitionNon-blocking
None.
Sources
Reviewed the prepared diff and focused ranges in
ShaderDiskCache.cpp,ShaderDiskCache.hpp,Recompiler.hpp, andCMakeLists.txtat the pinned head. The manifest lists 39 changed files; changed hunks were present in the diff, but full source context was not read for every file.files.jsonlists no rule-excluded files.Not verified
Tests, builds, and runtime behavior were not independently verified. Full source context for all 39 changed files was not read; the finding above is based on the changed serialization code and the version definition.
To get this to a good state
Bump
FormatVersionto 99, then rerun the relevant cache tests on the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T15:12:58Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected cache paths show no verified blocking defect; this review remains non-approving because source context for 31 changed files was not checked.
What I ran
Reviewed prepared metadata and diff for head
9f2e9b095549cc4e5531a1c8884bcf9023774028, plus targeted reader output forRecompiler.hpp,ShaderDiskCache.cpp,VulkanDevice.cpp,Graphics.cpp, andShaderMemory.cpp. No tests or builds were run. The PR description reports Windows and Linux test/build runs; those are author-reported, not independently verified.Results
Negative control
Not run; no behavioral test was executed during this review.
Findings
Blocking
None verified in the inspected areas.
Non-blocking
Retainappends entries and trims from the front, but cache hits do not refresh recency (core/shader/recompiler/ShaderDiskCache.cpp:224). Frequently reused modules can therefore be evicted behind newer, colder modules. If LRU behavior is intended, refresh the entry on a materialized hit.Sources
Not verified
Source context was read for 5 of the 36 changed files listed under
reviewedinfiles.json; full source context for the other 31 changed files was not read. No files were excluded by the review-folder rule. Tests, builds, and runtime behavior were not independently verified.To get this to a good state
Nothing is required. Optional: refresh retention recency on cache hits if LRU semantics are intended.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T15:46:27Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
91817c2846648040c87277145997f2a13a593e35. I inspected the prepared diff and targeted source context withrepo_read.py; I did not run tests, a build, or other checks.Results
Findings
Blocking
None identified in the inspected code.
Non-blocking
MaterializedSpirvis described as an LRU, but reuse of an already retained vector does not refresh its position inretained. Eviction therefore follows insertion order, so frequently reused older modules can be dropped before less-used newer ones and decompressed again. Consider refreshing the entry on reuse.core/shader/recompiler/ShaderDiskCache.cpp:224Not verified
The manifest lists 38 changed files. Targeted source context was read for
Recompiler.hpp,ShaderDiskCache.cpp,VulkanDevice.cpp,CMakeLists.txt, andtests/ShaderDiskCache.cpp; the diff and manifest were also inspected. The full text forVulkanDevice.cpp,tests/Graphics.cpp, andtests/ShaderMemory.cppwas excluded from the prepared folder; only targeted context was read forVulkanDevice.cpp. I did not inspect every changed hunk or source context for the remaining changed files, and did not verify runtime behavior, platform-specific behavior, or author-reported test results.To get this to a good state
Nothing is required. Optionally, refresh retained entries on reuse so eviction matches the documented LRU behavior.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T17:11:57Z.
Review: COMMENTED
I built and tested
91817c2846againstmainat9d362fb088on Linux with Mesa lavapipe.agc_driver_gcn_scalar_buffer_base,agc_shader_disk_cache, andagc_spirv_modulepassed on both revisions. Both runs required Vulkan and disabled the shader cache through the environment. The loader insertedVK_LAYER_KHRONOS_validation1.4.369 in both runs, with no missing-layer warnings orVUID-messages. The scalar execution test exercises the SPIR-V path through Vulkan, and the other two cover the cache fixture and module handling. This comparison used software Vulkan.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T23:39:03Z.
Review: COMMENTED
Reviewed — comments
The inspected cache paths show bounds and integrity checks, but I did not complete inspection of all changed files, so a formal decision is not justified.
What I ran
Reviewed prepared metadata and diff for head
80df566c3b5dbbf8654052b5c1046d62996567c6, then usedrepo_read.pyto inspect targeted source ranges inRecompiler.hpp,ShaderDiskCache.cpp,Recompiler.cpp,CompiledVariant.hpp, andCMakeLists.txt. No tests, builds, or other automated checks were run.Results
Negative control
Could not run a negative control; no test was run.
Findings
Blocking
None identified in the inspected paths.
Non-blocking
No code issue identified in the inspected paths. The review remains incomplete, so this is not a conclusion about all changed code.
Sources
SharedSpirv::Wordsand lease ownershipNot verified
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppas too large forfiles/; other changed files were also not inspected at the head.To get this to a good state
Nothing is required. Optional: complete review of the remaining changed files before treating this as a formal approval.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T00:17:38Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
91a9ee95a764dacc5acc983a184ae6f2479300a4againstmain. No merged preview was run. Environment: read-only workspace; source context was read throughrepo_read.py. No tests or build checks were run.Results
Negative control
Not run; no tests were executed.
Findings
Blocking
None observed in the code inspected.
Non-blocking
None.
Sources
Not verified
The prepared diff and manifest were inspected.
files.jsonlists 40 changed files underreviewedand none underexcluded; I did not read every listed file at the pinned head. In particular, full source for the oversizedVulkanDevice.cpp,Graphics.cpp, andShaderMemory.cppwas not opened through the reader. Author-reported test and benchmark results were not independently run or verified.To get this to a good state
Nothing is required. The optional point is that this review does not establish a formal approval because the complete source review was not finished.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T09:45:17Z.
Review: COMMENTED
Reviewed — no blocking findings
The cache and SPIR-V lease changes show no verified blocking defect; performance and Vulkan runs reported in the description do not cover the exact reviewed head.
What I ran
Reviewed head
1016ec82d9e1b0133e2e32442b743e91f51064f5using the prepared diff and manifest, plus targetedrepo_read.pysource reads. No tests, builds, or runtime checks were run.Results
Negative control
Not run; no tests were run on this head.
Findings
Blocking
None.
Non-blocking
91a9ee95a76and80df566c3b5), while the reviewed head is1016ec82d9e1b0133e2e32442b743e91f51064f5. The follow-up changes include cache and materialization optimizations, so those results do not establish behavior or performance on this head.Sources
Not verified
files/; their changed hunks and relevant source ranges were reviewed withrepo_read.py.To get this to a good state
Nothing is required. Optional: rerun the reported test and benchmark checks on this exact head and include the corresponding capture and trace artifacts.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T14:09:49Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected excerpts show no verified blocking defect, but this review is incomplete because three changed files were excluded from the review folder.
What I ran
Reviewed head
01514d734a0dede5402b6d03338e013635628fd6usingrepo_read.pyand the prepared diff. No tests or builds were run.Results
Negative control
Not run; no tests were run.
Findings
Blocking
None verified in the inspected excerpts.
Non-blocking
None.
Sources
Not verified
Targeted excerpts were read from
Recompiler.hpp,ShaderDiskCache.cpp,Recompiler.cpp,ShaderDiskCache.hpp,CompiledVariant.hpp, andtests/ShaderDiskCache.cpp. Full text was unavailable forcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp; their behavior was not verified. Other changed files were not inspected in full. The author-reported test and benchmark results were not rerun.To get this to a good state
Nothing is required. The review remains incomplete; the excluded files need inspection before a complete approval decision.
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.