perf(pipeline): reuse key storage and hash keys in blocks #1331
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1331"
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 TibixDev on 2026-10-07T23:43:12Z.
What
Reuse pipeline-key storage under the existing cache lock. Hash the serialized key in blocks and retain exact key comparison. Cache ownership and eviction rules stay the same.
Related: #1202 also reuses key storage through a separate last-pipeline cache. This smaller change applies to all lookups and also replaces the byte-at-a-time hash. It does not replace that PR's draw scheduling work.
Tested
Fedora 44, Release: graphics tests and RX 6600 pipeline tests with Vulkan validation. Checks key growth and shrinkage, changed state, unidentified shaders, cache clearing, and retained pipeline lifetime.
Earlier paired component tests on our combined branch measured 0.34/0.61/1.37 µs before and 0.16/0.26/0.45 µs after for 0/8/32 attributes. These are warm lookup timings, not game FPS. Windows was not tested.
Checklist
main; related #1202 checked and described above.Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-08T04:09:44Z.
Isolated measurements for the request in #1324. Baseline: upstream
a9ba39c927713cf294b8e1b7877ddb365d3a1d6f. Comparison: that revision plus this PR alone. Both use the same test harness; the baseline has no production changes. Separate shared libraries were checked through the loader.Linux, Ryzen 5 5600, Fedora 44, GCC 16 Release (
-O3 -DNDEBUG), llvmpipe. Runs pinned to CPU 3, in four ABBA cycles: eight processes per version. Each process warms the key, then measures nine passes of 65,536 realCachedPipelinelookups per key size. Medians below are over the eight process medians.The ranges of process medians do not overlap in any case. The key-identity, changed-state, unidentified-shader and cache-lifetime checks pass. The proposed version also passes Vulkan core and synchronization validation without errors.
This measures warmed CPU cache lookups. It does not measure frame time, pipeline compilation or game FPS. Command:
agc_driver_recorder_tests --benchmark-pipeline-cache.AI-assisted measurement and reply.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:22:04Z.
Conflicts with main in
Pipeline.cppandCMakeLists.txt; please rebase. InpipelineKey, keep main'sPipelineVariantId()(from #639) in the early return.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T23:12:50Z.
Rebased on current
mainourselves, keepingPipelineVariantId()in the early return as asked.Added:
agc_pipeline_cacheregistered in ctest (agc_driver_recorder_tests --pipeline-cache-only). The test was only reachable through a manual flag and the target isEXCLUDE_FROM_ALL, so CI never ran it.Checked: build and ctest for
libSceAgcDriver/libSceAgcgreen; the new test passes on a local driver and on lavapipe, and fails if thekey.clear()inpipelineKeyis removed. The timings in the description are not reproduced here. Merging once CI is green.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T23:14:51Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppL382-383core/libs/prx/libSceAgcDriver/CMakeLists.txtL493