AGC: the draw cache retains shader results outside its byte budget (GTA V, PPSA04264) #23485
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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-11-19T04:37:49Z.
What happens
After loading a GTA V Story save and leaving Michael standing in the same room, process private commit keeps increasing. With the default draw-cache budget, the cache reached 65,536 entries and reported zero byte-budget evictions. A run using a smaller draw-cache budget showed materially less host-heap growth in the same scene.
Title, test or build step
Grand Theft Auto V (PS5),
PPSA04264 01.011.001, Story, Performance mode. A 38.4% manual save loads into Michael's front hall.AnyPS5 commit
866864a5bc8ef8d90d28b5c3cd5a0c8e67ea4c90for the game observations. The draw-cache budget A/B used the same revision with a local allocation sampler inlibSceAgcDriver.System
Windows 11 Pro build 26300, Intel Core i7-12700H, 32 GiB RAM, NVIDIA GeForce RTX 3080 Laptop GPU, NVIDIA driver 621.14, Vulkan 1.4.357, MinGW-w64 GCC 15.2.0.
Host report
Steps to reproduce
APS5_HEAP_CACHE_MIB=512andAPS5_TRACE_MEMORY_BUDGET=1. Automatic screenshots were disabled.APS5_PIPELINE_JOURNAL_THREADS=0,APS5_HEAP_CACHE_MIB=128,APS5_TEXTURE_CACHE_MIB=1536, andAPS5_TRACE_DRAW_CACHE=1. Compare the default 256 MiB draw-cache budget withAPS5_DRAW_CACHE_BYTES=67108864, keeping those settings and the room the same.Log
The local memory guard ended the first run when system commit headroom fell to 3.94 GiB. In the draw-cache A/B, Windows heap snapshots showed about 1,101 MiB of growth with the default cap and 372 MiB with the smaller cap. The smaller cap caused byte-budget evictions with roughly 25,000–26,000 entries resident. The arms advanced about 808 and 990 presents, respectively, during those samples.
The draw-cache log recorded these ten-second windows.
What was checked
#9129 introduced a byte budget for the draw variants and documented the entry data it excludes. After #16234, a result copied and patched from a masked-memo donor bypasses the exact result memo. A cached draw variant can then keep that result and its descriptor data alive beyond its original use. The draw-cache byte estimate currently omits the retained result metadata. More entries can accumulate after #21467 raised the entry cap.
An ordinary cache eviction releases its reference to the shader result. Private commit covers the entire process. The draw-cache accounting explains part of the growth. Dedicated GPU memory was also growing, with sampled textures the largest category in the original Vulkan accounting.
In a longer replay with an earlier local accounting patch, the draw cache reported byte-budget evictions in all 21 ten-second windows between 6 min 39 s and 10 min 11 s. The number of resident draw entries varied between 24,073 and 30,028. During that interval the process still gained 598 MiB of private commit, Windows heap allocations gained 152 MiB and dedicated GPU memory gained 239 MiB. These accounting views may overlap. This report targets the draw-cache budget gap within the broader memory growth.