perf(shader): cache decoded image table columns across resolutions #28414
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28414"
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 muhmuhkuh on 2026-11-30T15:07:35Z.
What
Cache decoded image-table column entries (
ColumnDecode) acrossResourceMaterializer::ResolveImageTablescalls keyed by(SharedValues<DescriptorValue>, interfaceId)(building on #28410).ColumnDecodeEntries = 256,ColumnDecodeWords = 1 << 22, minimum column size64entries) inResourceMaterializer.cppthat stores per-code atomic decode results (either mode index orDecodeFailed | poisonReason) for non-sampler, non-nested, fault-free RDNA2 image-table columns.decodeTableEntry, avoiding redundant per-word hash lookups and descriptor decoding when repeated resolutions reference the sameSharedValues<DescriptorValue>column and decode interface.ImageTableReuseCounts::columnHitsand addsverifyColumnDecodeMemounit test coverage incore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp.Tested
python tools/check_conventions.py --base pr-fork/perf/materializer-shared-decode-memoandpython tools/check_conventions.py --base origin/main— both passed.ctest --test-dir D:/gta6/build-column-decode -R "^(agc_shader_memory|agc_shader_disk_cache|agc_shader_table_.*)$"— 7/7 Passed (includingverifyColumnDecodeMemo).ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer):agc_driver_image_tableandagc_driver_image_table_reuse— 2/2 Passed,VK_LAYER_KHRONOS_validationloaded in both tests (notfound=0), 0VUID-validation errors (matchesorigin/mainbaseline).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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T15:09:24Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected changes implement shared image decode memoization and column caching; I found no verified blocking defect, but the full review is incomplete because I read only the changed test sections and did not run checks.
What I ran
Reviewed head
214c841eaafe1c968861db7c180f80d937973044using the prepared patch andrepo_read.py. No commands or tests were run. The author reports convention checks, CPU tests, and Vulkan validation in the PR description; those results were not independently verified.Results
Findings
Blocking
None verified in the inspected code.
Non-blocking
None.
Sources
Not verified
The full contents of
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwere not read; only the changed test region and its invocation were inspected. No build, CPU test, Vulkan validation, or performance comparison was run. The PR description reports results, but those are author-reported. The changed files werecore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp,core/shader/recompiler/Optimization/include/Optimization/ResourceMaterializer.hpp, andcore/shader/recompiler/Optimization/src/ResourceMaterializer.cpp; the test file was excluded from the prepared review folder because it was too large, and was read in targeted ranges throughrepo_read.py.To get this to a good state
Nothing is required. Optional: complete review of the remaining test file and run the reported checks on this head before making a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T15:17:26Z.
Review: COMMENTED
Actionable comments posted: 3
Architecture findings (1)
Advisory architecture findings (1)
dc94520c-b8d9-4b11-96c6-2be4d07922c7Reviewing files that changed from the base of the PR and between
7cca3db6e8and214c841eaa.core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Optimization/include/Optimization/ResourceMaterializer.hppcore/shader/recompiler/Optimization/src/ResourceMaterializer.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 MarcZX10 on 2026-11-30T18:06:59Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Inspected head
7d8ad85c030a977b60ae87232f8adfc8647ed8f5with the pinnedrepo_read.pyreader. No build or tests were run. The CPU and Vulkan results in the PR description are author-reported, not independently verified.Results
Negative control
Not run; no negative control was available in this review.
Findings
Blocking
None.
Non-blocking
mainand PR performance capture with traces and digest. Add that evidence to substantiate the performance claim. This is optional feedback, not a verified code defect. (core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:5386)Sources
Not verified
The full changed-file texts were not read. Reviewed the changed lines and relevant source context in
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp,core/shader/recompiler/Optimization/include/Optimization/ResourceMaterializer.hpp, andcore/shader/recompiler/Optimization/src/ResourceMaterializer.cpp. The test file’s full text was unavailable in the review folder because of its size; its changed lines were read throughrepo_read.py.files.jsonlists no rule-based exclusions.Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T20:01:09Z.
Review: COMMENTED
columnDecodesearches a snapshot of the cache, unlocks, then inserts without checking whether a concurrent resolution already installed an equal column. Two threads can keep separateColumnDecodeinstances for the same key. Both consume the retention budget and both redo the atomic-slot population. Please check for an equal entry again under the insertion lock, or give each key a single publication path. The current fixture's sequential resolutions cannot catch this.Source review at
7d8ad85c03. The head trial-merges ontod2e04ef9b3. Paired Vulkan execution is queued.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-03T22:09:26Z.
Review: COMMENTED
Actionable comments
152fdb37-7fb3-4bc9-911c-cee82e9e2e08Reviewing files that changed from the base of the PR and between
7d8ad85c03and2668003847.core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Optimization/include/Optimization/ResourceMaterializer.hppcore/shader/recompiler/Optimization/src/ResourceMaterializer.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T00:42:54Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
2668003847d9795b00047c618ecd4734bc56b5ee. I inspected the prepared diff and targeted source ranges usingrepo_read.py; I did not run tests or builds.Results
Negative control
Not run; the changed tests were inspected but not executed.
Findings
Blocking
None.
Non-blocking
Sources
Not verified
Read targeted changed hunks and relevant functions/types in all three changed files:
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp,core/shader/recompiler/Optimization/include/Optimization/ResourceMaterializer.hpp, andcore/shader/recompiler/Optimization/src/ResourceMaterializer.cpp. The full test file was too large forfiles/; its changed hunk and test entry point were read throughrepo_read.py.files.jsonlists no files excluded by omission rules. Unchanged portions and runtime behavior were not verified; CPU and Vulkan results are author-reported, not independently run.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-04T11:48:24Z.
Review: COMMENTED
Actionable comments
ac18535c-0bff-4eea-9d52-31bf81f0665fReviewing files that changed from the base of the PR and between
2668003847andb44f4c9ad8.core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Optimization/include/Optimization/ResourceMaterializer.hppcore/shader/recompiler/Optimization/src/ResourceMaterializer.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T12:07:57Z.
Review: COMMENTED
Reviewed — no blocking findings
The cache changes and added test cases look sound, but the performance report needed to assess this performance change was not available in the prepared materials.
What I ran
Reviewed head
b44f4c9ad84e8e99005e251316779bbb5aa1d69fin the read-only review workspace. I read the prepared description, commit list, manifest, diff, and file list; inspected the changed code and targeted source context withrepo_read.py. No tests, builds, or performance captures were run.Results
Negative control
Not run; no negative control was performed.
Findings
Blocking
None.
Non-blocking
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp:2138.Sources
Not verified
ShaderMemory.cpp,ResourceMaterializer.hpp, andResourceMaterializer.cpp; targeted source context includedResourcePlan.hpp. The unchanged portions of those files were not read.ShaderMemory.cppfull text was not copied into the review folder because of its size; its changed test hunk was read fromdiff.patch.files.jsonlists no files excluded by rule.To get this to a good state
Nothing is required.
Optional: include or link the matched baseline/change performance captures, summary records, traces, and digest so the performance claim can be assessed.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-04T15:29:26Z.
Review: COMMENTED
Actionable comments
2d1e0c8f-34e7-4158-9cab-b85b0a2b8e92Reviewing files that changed from the base of the PR and between
b44f4c9ad8and0e8813cf23.core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Optimization/include/Optimization/ResourceMaterializer.hppcore/shader/recompiler/Optimization/src/ResourceMaterializer.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 MarcZX10 on 2026-12-04T15:48:14Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the point below is optional.
What I ran
Reviewed head
0e8813cf23ea4b1fa8489265fd2380a6c8e3ded8usingrepo_read.pyat the pinned head and the prepared diff. I did not run tests or performance captures. The PR description reports CPU and Vulkan tests; I did not independently verify those results.Results
Negative control
Not run; no tests were run or modified during this review.
Findings
Blocking
None.
Non-blocking
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp:2123adds a performance optimization, but the PR description does not include paired baseline and change captures, summary lines, traces, or digest output. The repository’s performance report form calls for same-machine, same-scene captures and these artifacts. Adding them would let reviewers assess the claimed improvement.Sources
Not verified
The reported CPU and Vulkan test results, runtime behavior on hardware, and actual performance change were not independently verified. Reviewed changed files:
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp,core/shader/recompiler/Optimization/include/Optimization/ResourceMaterializer.hpp, andcore/shader/recompiler/Optimization/src/ResourceMaterializer.cpp. No files were excluded by the prepared review manifest.To get this to a good state
Nothing is required.
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.