docs(usage): document the shader cache directory and its environment variables #5525

Merged
ahmedmakroum merged 1 commit from upstream-pr/5525 into main 2026-10-14 21:46:38 +00:00
ahmedmakroum commented 2026-10-13 22:23:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ahmedmakroum on 2026-10-13T22:23:27Z.


What

Documents the shader cache in docs/user/USAGE.md under Runtime layout: its default shader_cache/ directory, ANYPS5_SHADER_CACHE_DIR, ANYPS5_NO_SHADER_CACHE, the per-version shader subdirectories and their cleanup, the vk-pipelines-*.bin files, and that deleting the directory is safe.

Each statement was checked against the source:

  • Default directory beside the executable, ANYPS5_SHADER_CACHE_DIR, and ANYPS5_NO_SHADER_CACHE (any non-empty value other than 0) turning off both caches: ShaderCacheDirectory in core/shader/recompiler/ShaderDiskCache.cpp, used by DiskStore there and by core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp.
  • Shader subdirectory named after the source version, and removal of other versions' subdirectories unused for 14 days: DiskStore and DiskStore::housekeeping in core/shader/recompiler/ShaderDiskCache.cpp. The store, and so the cleanup, starts at the first shader lookup (findOrCompileVariant in core/shader/recompiler/Recompiler.cpp).
  • One vk-pipelines-*.bin file per GPU and driver version (vendor ID, device ID, driver version and pipeline cache UUID in the name): core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp.
  • Rebuilt after deletion: DiskStore::housekeeping creates the directory, and WriteFileAtomically in core/shader/recompiler/ShaderCacheDirectory.hpp creates missing parent directories.

Tested

Documentation only. python3 tools/check_conventions.py passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes, written with Claude Code and reviewed by me
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4850250721 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5525). Originally posted by [ahmedmakroum](https://github.com/ahmedmakroum) on 2026-10-13T22:23:27Z. --- ### What Documents the shader cache in `docs/user/USAGE.md` under Runtime layout: its default `shader_cache/` directory, `ANYPS5_SHADER_CACHE_DIR`, `ANYPS5_NO_SHADER_CACHE`, the per-version shader subdirectories and their cleanup, the `vk-pipelines-*.bin` files, and that deleting the directory is safe. Each statement was checked against the source: - Default directory beside the executable, `ANYPS5_SHADER_CACHE_DIR`, and `ANYPS5_NO_SHADER_CACHE` (any non-empty value other than `0`) turning off both caches: `ShaderCacheDirectory` in `core/shader/recompiler/ShaderDiskCache.cpp`, used by `DiskStore` there and by `core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp`. - Shader subdirectory named after the source version, and removal of other versions' subdirectories unused for 14 days: `DiskStore` and `DiskStore::housekeeping` in `core/shader/recompiler/ShaderDiskCache.cpp`. The store, and so the cleanup, starts at the first shader lookup (`findOrCompileVariant` in `core/shader/recompiler/Recompiler.cpp`). - One `vk-pipelines-*.bin` file per GPU and driver version (vendor ID, device ID, driver version and pipeline cache UUID in the name): `core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp`. - Rebuilt after deletion: `DiskStore::housekeeping` creates the directory, and `WriteFileAtomically` in `core/shader/recompiler/ShaderCacheDirectory.hpp` creates missing parent directories. ### Tested Documentation only. `python3 tools/check_conventions.py` passes. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes, written with Claude Code and reviewed by me
MarcZX10 commented 2026-10-13 22:27:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T22:27:05Z.

Review: APPROVED


The documentation matches the current cache implementation: both cache controls, the source-version shader subdirectory and 14-day stale-version cleanup, and GPU/driver-specific Vulkan cache files are represented clearly. I verified the statements against the cited source paths in the PR body. The docs checks pass; full build jobs are skipped, as expected for this documentation-only change.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5510804332 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5525#pullrequestreview-5510804332). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T22:27:05Z. **Review:** APPROVED --- The documentation matches the current cache implementation: both cache controls, the source-version shader subdirectory and 14-day stale-version cleanup, and GPU/driver-specific Vulkan cache files are represented clearly. I verified the statements against the cited source paths in the PR body. The docs checks pass; full build jobs are skipped, as expected for this documentation-only change.
MarcZX10 commented 2026-10-13 23:33:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T23:33:39Z.

Review: APPROVED


Rechecked the requested head ; it is unchanged from the head I reviewed earlier. The cache paths, versioned subdirectory and stale-version cleanup description still match the implementation. Documentation checks pass; full build jobs are skipped for this docs-only change. AI-assisted: yes; reviewed by MarcZX100.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5511310297 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5525#pullrequestreview-5511310297). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T23:33:39Z. **Review:** APPROVED --- Rechecked the requested head ; it is unchanged from the head I reviewed earlier. The cache paths, versioned subdirectory and stale-version cleanup description still match the implementation. Documentation checks pass; full build jobs are skipped for this docs-only change. AI-assisted: yes; reviewed by MarcZX100.
adriadam10 commented 2026-10-14 21:46:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T21:46:28Z.


Checked each statement against main (ShaderCacheDirectory, DiskStore::housekeeping, the vk-pipelines-*.bin naming in PipelineCache.cpp); they match. Conventions green; merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179201121 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5525#issuecomment-6179201121). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T21:46:28Z. --- Checked each statement against main (`ShaderCacheDirectory`, `DiskStore::housekeeping`, the `vk-pipelines-*.bin` naming in `PipelineCache.cpp`); they match. Conventions green; merging.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5525
No description provided.