fix(agc): preserve pipeline cache entries during concurrent Windows saves #28492
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28492"
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-12-01T03:51:21Z.
What
Two AnyPS5 processes sharing a Vulkan pipeline cache can read the same old file. When both save, the later replacement can drop entries the other process already wrote.
Hold the same per-cache operating-system lock across reading the current file, merging and atomically replacing it. Periodic saves use the existing retry when the lock is busy. An explicit save retries the file lock for up to one second. If the file is still busy, the save leaves the existing cache alone. The lock implementation comes from the pipeline journal.
On POSIX, processes using the same cache directory under different accounts need read and write access to the per-cache
.lockfile, in addition to the directory permissions for saving. If the lock cannot be opened, the save leaves the existing cache alone.Tested
772de0c63d79failed the contention check. At998853baec26, the busy save returned while the first writer still held the lock. A later save kept both entries.Earlier Windows cache validation on 2026-12-01
At
bbfd9c12632c,agc_pipeline_cache_headerpassed on the same Windows GPU listed below. Native saves still persisted the cache across a path longer thanMAX_PATH. The Khronos validation layer loaded and reported zero Vulkan validation or synchronization errors.Windows 11 build 26300. In the two-process comparison against main
75b480e9c78e, one process saved an entry and the other replaced the file without it. The fix kept both entries. All five focused cache tests passed.Windows 11 build 26300, NVIDIA GeForce RTX 3080 Laptop GPU, driver 621.14. Both revisions passed
agc_pipeline_cache_fileandagc_pipeline_cache_header, covering native cache persistence, reload and Windows paths longer thanMAX_PATH. Both runs loaded the Khronos validation layer and reported zero Vulkan validation or synchronization 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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T03:53:20Z.
Review: APPROVED
Reviewed — looks good
The reviewed changes at head
772de0c63d79d57982a7e7ca626b00b8a6c33926serialize pipeline-cache file reads and replacements across processes; I found no verified blocking defects.What I ran
Read the prepared diff and changed-file text, then used
repo_read.pyto inspect the changed Recorder hunks at the pinned head. No tests or builds were run.Read: all six changed files included in
files/, plus the changed Recorder hunks through the reader. The full Recorder file was omitted from the review folder because it was too large; its changed hunks were inspected.files.jsonlists no excluded files.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
The author reports focused cache tests and Windows Vulkan validation runs; these were not independently run. Runtime behavior on other operating systems and hardware was not verified.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T04:01:39Z.
Review: COMMENTED
🏛️ Architecture findings (1)
Advisory architecture findings (1)
169f30e8-4d82-44b2-ae9e-35738aff9a70Reviewing files that changed from the base of the PR and between
75b480e9c7and772de0c63d.core/libs/prx/libSceAgcDriver/Graphics/src/CacheFileLock.hppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/tests/PipelineCacheConcurrentSave.cmakecore/libs/prx/libSceAgcDriver/tests/PipelineCacheFailures.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_pipeline_cache_allocation_tests.cmakeIncluded 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-01T04:16:59Z.
Review: APPROVED
Reviewed — looks good
The reviewed changes at
bbfd9c12632c3aa0c4c26e0205e3d36037b31d2cserialize pipeline-cache saves across processes and preserve the journal’s existing lock behavior.What I ran
Reviewed the prepared diff and manifest at the exact head above, with
mainas the base; no merged-preview check was run. I used the pinnedrepo_read.pyreader and shell in the read-only review environment. No tests or builds were run.Results
Negative control
Not run; no test was modified to confirm that it fails when the fix is removed.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
No tests or CI were run. The Windows test results in the PR description are author-reported and were not independently confirmed. All seven paths listed as reviewed in
files.jsonwere inspected;Recorder.cppwas too large to include in the review folder, so its changed sections were read throughrepo_read.py.files.jsonlists no excluded paths.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T04:20:52Z.
Review: COMMENTED
🏛️ Architecture findings (1)
Advisory architecture findings (1)
💬 Code review
Actionable comments posted (1)
5f1fadd2-7a02-48bf-8e4a-8ec45c71b588Reviewing files that changed from the base of the PR and between
772de0c63dandbbfd9c1263.core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cppcore/libs/prx/libSceAgcDriver/tests/PipelineCacheFailures.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-01T04:33:02Z.
Review: APPROVED
Reviewed — looks good
The change serializes pipeline-cache reads, merges, and writes under a per-cache lock, and I found no verified blocking defect in the changed lines.
What I ran
Reviewed head
998853baec2638d4c8189d0c7532defb93da7c49. I inspected the prepared diff and manifest, then usedrepo_read.pyto read changed source lines and relevant context. I ran no builds or tests. The author reports Windows validation on this head; I did not independently verify that run.Results
Negative control
Not run; no test was executed, so the new concurrency test was not checked against a deliberately failing implementation.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
No tests or builds were run. Windows behavior and the author's reported Windows test results were not independently verified. POSIX runtime behavior, including access across different user accounts, was not exercised. The changed Recorder lines were read from the pinned source because that file was too large for the review folder.
files.jsonlists seven reviewed files and no rule-excluded files.To get this to a good state
No changes are required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T04:35:23Z.
Review: COMMENTED
🏛️ Architecture findings (1)
Advisory architecture findings (1)
💬 Code review
Actionable comments posted (1)
daa0455f-da1b-40ec-a66c-eb8f5e6be151Reviewing files that changed from the base of the PR and between
bbfd9c1263and998853baec.core/libs/prx/libSceAgcDriver/tests/PipelineCacheFailures.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T10:41:19Z.
Review: APPROVED
I read the diff at
998853baec. Windows 11, GCC 15.2, merged intomainatb97867d3ce6together 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_pipeline_cache_allocation_testsand the 177 ofagc_driver_recorder_tests(two skip on both): pass on both GPUs. The loader log shows the layer inserted and no "was not found" line, and neither run has aVUID-orSYNC-HAZARDline.main's):agc_pipeline_cache_concurrent_savefails on both GPUs: "an overlapping pipeline cache save lost the other process's entry".The open thread asks for one more failure case in the test; the code path is the same one the test covers.
Not checked: two copies of a title.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:07:45Z.
Review: COMMENTED
Compared
agc_driver_gcn_scalar_buffer_baseand the three pipeline-cache allocation cases on main and the patched tree on the same Linux llvmpipe device with Vulkan required, shader cache disabled, and validation layer 1.4.369. All four passed on both trees. The loader inserted the layer and neither log contained a missing-layer diagnostic or aVUID-entry. The new concurrent-save fixture also passed and retained both entries on Linux. Native Windows behavior remains unverified.AI-assisted: yes.
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.