agc: the storage image cache budget, heap-following since #7071, falls to its 512 MiB floor with heap budget still free (007 First Light, RTX 3080 10 GB) #10041
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 SleglJan on 2026-10-23T05:45:31Z.
What happens. In 007 First Light (PPSA11386) on an RTX 3080 10 GB, the storage image cache budget, which my #7071 made follow the heap's use, falls to its 512 MiB floor in early gameplay in 28 of the 56 runs below, 10-24 times in each of them (a lower bound: the
[gpu]budget line prints only when a budget moves by more than a tenth, at most every 10 s). At those lines 338-1,204 MiB of the heap budget is still free (plain runs; the heap budget as the texture budgets see it, 250 or 500 MiB below the driver's where the diagnostic below is set). Of those 56, the 33 that collapsed (as defined below) reached frames 1,574-1,785 by their 1,500 s end, except one, which collapsed by the uncached rule only and reached 2,141; the 23 clean ones reached 2,101-2,279 (frames: presents plus dropped frames, from the[present]lines); the prompt scene after Bond's fall starts at about frame 1,600. #7071's own measurements already showed this budget at its floor after the level entry (present 1298), and its debt entry names re-creation at each use as the cost. This report is about how often that happens in gameplay, and what changes it.The budget.
StorageTextureBudget(ShaderResources.cpp,main27c88a8d75) is 7/8 of the device-local heap budget B minus the heap's use other than the cached storage images, between a 512 MiB floor and a cap of B/4 (orTextureCacheBudget, 2,560 MiB on this card, if smaller); unchanged on currentmain0db47b263d(2026-10-23). Since the use is sampled textures alive + cached storage + other use, cached storage plus other use stays near 7/8 B minus sampled alive whenever the formula binds, in every run; the runs differ in other use. In one run that fell, from frame 1,398 to 1,435 cached storage went from 1,460 to 572 MiB and other use from 3,869 to 4,717 MiB, while use stayed at 7,311-7,516 MiB. No counter tells whether that growth is storage images the cache let go that are still alive, memory retained for reuse, or other allocations that pushed the cache out. Two parts are measured:DeviceBudgetinBufferPool.cpp, an eighth of the heap budget, 1,120 MiB here, with an image share of 280 MiB) held 0.8-1.1 GB at these lines in both kinds of run. With that tier off no run reached the floor (lowest budget 631, 712 and 2,106 MiB), though two of the three still collapsed by the uncached rule below.The
[gpu]lines at the same frame and headroom (diagnostic at -250 MiB), a run that fell against one that didn't, MiB, other use = use - sampled alive - cached storage:What we tried. Each run 1,500 s from launch; gameplay starts at 405-416 s. A run counts as collapsed when a
[gpu]line at frame 1,400 or later shows the storage budget at its floor, or when the sampled-texture cache's 10 s lines from frame 1,650 counted textures used uncached 3 times in a row reaching frame 1,700, or 8 times in a row. Headroom is a local diagnostic that lowers the heap budget only the two texture budgets see (and #8672's ceiling where it is in the tree); real VRAM is unchanged; "default" means it is unset.APS5_IMAGE_POOL_MIB=0)APS5_STAGING_POOL_MIB=0)79146e64f0max(512 MiB, min(TextureCacheBudget, heapBudget / 4))VK_ERROR_OUT_OF_DEVICE_MEMORY, host placements on both pathsSo the rule before #7071 kept the budget at its cap in all 6 runs and ran out of device memory in gameplay in 2 of them (it was changed because it did that at a level load). None of these changes prevents the collapse in every run.
78 runs from 2026-10-21 to 10-23; the table shows the 56 that ran to their end on these trees. Left out: 17 that stopped at frame 1,580, before the scene (7 plain, one of them fell; 3 with #7833; 7 with #9400, one fell), and 5 on this base plus #8608 and #8887 (one fell; the 3 at +250 MiB stayed clean). No run had an allocation failure that wasn't recovered. Level loads in all 78: no host placement, and recovered failures in 4 runs (1, 1, 1 and 3, the 3 in a run of the rule before #7071).
Earlier runs. On our bases from 2026-10-17 to 10-20, with #7071, 0 of 32 runs into this scene collapsed. Those scripts pressed the prompt and drove on, 22 of the 32 to frames 4,166-4,839; their lowest storage budget per run was 1,164-2,260 MiB and the heap budget about 8.8-9.0 GB. Our profiling script (perf sampling, longer stays in the scene) collapsed in 7 of 17 on the same bases. On 2026-10-21 the heap budget was 8,490-8,634 MiB in runs that fell and 8,779-8,868 MiB in clean ones. On
27c88a8d75at -250 MiB, the two clean runs in the table above have other use of 3,154 and 3,258-3,310 MiB at frames 1,429-1,434, close to the old runs' 2.7-3.2 GB; the two that fell, 4,594 and 4,612-4,717 MiB at frames 1,425-1,435. Whether a change between those bases contributes is not bisected.Setup. Linux 7.2.10 (CachyOS), RTX 3080 10 GB (one device-local heap), driver 615.78.08, Ryzen 9 7950X3D, 64 GB, Release builds, 3840x2160, warm shader cache from one seed,
APS5_PROFILE_DRAW=1,APS5_TRACE_SUMMARY_EVERY=60. Base:main27c88a8d75plus three open PRs our 007 runs carry (#6868 ataa8f734907, #5372 at0ccc15d0af, #6918 at955e7c3c78), none of which touches the texture budgets or the buffer pool; plus the headroom diagnostic in every tree of the table and local logging in the trees with my local change; scripted input, and the title's two feedback-wait limits widened in its executable as described in #6172 (local only). #8672 was cherry-picked with one conflict instorageBudget()resolved by hand. The runs never press the prompt, so each stays in that scene until its end.Open. What makes up the growth in other use is not measured: no counter splits the heap's use into the caches' own retained or still-referenced bytes and the rest. Such a split would let the budget tell its own leftovers from outside use; the rule before #7071 shows that a cap ignoring use ran out of device memory in 2 of 6 runs here.
Related: #7071 (mine), #7862 (the formula's sampled term, merged 2026-10-20), #7870 (the image share, merged 2026-10-20), #8672, #7833, #6194 (budget growth), #5961 and #6099 (storage images cycling through the cache in other titles), #5998 (retained storage images in the recorder budget), #8748 (device buffers placed in host memory kept for reuse).
AI-assisted: yes (Claude Code)