fix(shader-cache): remove stale temporary files from the cache root #7731
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7731"
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 tibzejoker on 2026-10-19T03:39:57Z.
What
The shader cache's housekeeping removes
*.tmp.*files older than one hour, but only in the current version subdirectory. The Vulkan pipeline cache (vk-pipelines-*.bin) is saved withWriteFileAtomicallyin the cache root, one level up. A run that stops while that file is being saved (killed, crashed, closed during the save) leaves its temporary file in the root, and nothing ever removes it.For a large title the pipeline cache is big: here it is 2.5 GB, and three runs stopped during the save left 7.2 GB of
vk-pipelines-*.bin.tmp.*files inshader_cache/. Housekeeping now applies the same one-hour rule to the root as well. Only regular files whose name contains.tmp.are removed; recent ones are kept because another run may still be writing them. USAGE.md now describes this.Tested
Windows 11, MinGW GCC 15.2:
agc_shader_disk_cache(--housekeepingchild process). The cache root holds a pipeline cache file, a temporary file two hours old, and a recent temporary file. A process looks up a shader there and shuts the cache down. The old temporary file must be gone; the other two must remain. Onmainit fails witha temporary file left in the cache root by an interrupted write survived housekeeping.ctest -R "agc_shader_disk_cache|agc_driver_graphics|agc_driver_pipeline|agc_driver_recorder|agc_driver_shutdown": 26/26.tools/check_conventions.py --base upstream/main: passed.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)🤖 Generated with Claude Code
https://claude.ai/code/session_01XBXM4pgkMHYEtqN1EQni2P
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T03:58:40Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
docs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mddocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mddocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mddocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mdcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mddocs/user/USAGE.mdcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mddocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppImported from boykopovar/AnyPS5. Originally posted by tibzejoker on 2026-10-19T04:00:29Z.
Overlap with #6771 (@XairRrR): that PR moves
vk-pipelines-*.bininto the version subdirectory, where the existing one-hour rule already removes temporary files. If #6771 merges, the pipeline cache's own temporaries are covered without this change. What this PR would still do then is remove the files that older builds left in the root. That is a one-off cleanup, and deleting them by hand works just as well.So: if #6771 is going in, I'm fine closing this one; it may be worth adding the root cleanup there instead. If #6771 stalls, this is the smaller fix for the leak. The USAGE.md line conflicts textually either way. I'll rebase whichever stays open.
Written with AI assistance (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by tibzejoker on 2026-10-20T09:18:55Z.
Closing this as superseded by #6771 (merged as
907c9cd1b).#6771 moved
vk-pipelines-*.bininto the current version's subdirectory, so the*.tmp.*file left by an interrupted save now lands there. The existing housekeeping already removes stale temporaries in that subdirectory, so the case this PR fixed no longer happens onmain.One thing is still left over. Files that older builds wrote to the cache root stay there: a
vk-pipelines-*.binfrom before #6771, and any*.tmp.*beside it. Here that came to 2.5 GB for the old pipeline file plus 7.2 GB of temporaries. Deleting them by hand is safe. If you would rather have a one-time cleanup of the root, I can open a small PR for it.AI-assisted: yes (Claude Code)
Pull request closed