fix(agc): include retained storage images in recorder budget #5998

Merged
MarcZX10 merged 2 commits from upstream-pr/5998 into main 2026-10-18 15:37:36 +00:00
MarcZX10 commented 2026-10-14 18:44:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T18:44:59Z.


What

Charge storage images retained by recorded batches only after their storage-cache ownership has ended. Use each image's allocation/guest size, and rely on the recorder's per-batch owner deduplication. This bounds evicted or invalidated images that a batch can release without charging cached images that remain alive independently of the batch.

Related: #5961

Tested

  • Rebased onto current main at 9f03c4fe0b5cff4b58ab64e365207ee5421c8f5b.
  • CMake Release configure with BUILD_TESTING=ON passed.
  • ninja -C /tmp/anyps5-storage-account-build -j8 agc_recorder_kept_bytes_tests passed (70/70 build steps), compiling and linking the modified AGC library and test binary.
  • ctest --test-dir /tmp/anyps5-storage-account-build -R '^agc_recorder_kept_bytes$' --output-on-failure stopped before test code at the host CPU feature gate: this Xeon E5-1620 v2 lacks required instructions including AVX2/FMA/BMI/LZCNT.
  • Independent Linux validation on RADV passed the storage-budget tests and AGC CTest; the full agc_ run was 597/598 pass or skip, with the sole failure reproduced on plain main.
  • Astro Bot (PPSA21564) was run on Linux with an NVIDIA GeForce RTX 3080 Ti 12 GB, driver 615.71.09. In a composition of main 44df21632, #5390, this PR (c1a9f6957), #5997, #6492, #6465 and #6464, the run reached 650 storage images and continued for about 40 minutes in Sky Garden without the earlier vkAllocateMemory -2 failure; VRAM stayed at 10.2–10.6 GB. It ended at the 50-minute time cap. This validates that composition on that setup, not this PR in isolation.
  • git diff --check upstream/main...HEAD passed.

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
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3080 Ti 12 GB, driver 615.71.09, Linux (distribution not reported)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4862788822 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T18:44:59Z. --- ### What Charge storage images retained by recorded batches only after their storage-cache ownership has ended. Use each image's allocation/guest size, and rely on the recorder's per-batch owner deduplication. This bounds evicted or invalidated images that a batch can release without charging cached images that remain alive independently of the batch. Related: #5961 ### Tested - Rebased onto current `main` at `9f03c4fe0b5cff4b58ab64e365207ee5421c8f5b`. - CMake Release configure with `BUILD_TESTING=ON` passed. - `ninja -C /tmp/anyps5-storage-account-build -j8 agc_recorder_kept_bytes_tests` passed (70/70 build steps), compiling and linking the modified AGC library and test binary. - `ctest --test-dir /tmp/anyps5-storage-account-build -R '^agc_recorder_kept_bytes$' --output-on-failure` stopped before test code at the host CPU feature gate: this Xeon E5-1620 v2 lacks required instructions including AVX2/FMA/BMI/LZCNT. - Independent Linux validation on RADV passed the storage-budget tests and AGC CTest; the full `agc_` run was 597/598 pass or skip, with the sole failure reproduced on plain main. - Astro Bot (PPSA21564) was run on Linux with an NVIDIA GeForce RTX 3080 Ti 12 GB, driver 615.71.09. In a composition of main `44df21632`, #5390, this PR (`c1a9f6957`), #5997, #6492, #6465 and #6464, the run reached 650 storage images and continued for about 40 minutes in Sky Garden without the earlier `vkAllocateMemory -2` failure; VRAM stayed at 10.2–10.6 GB. It ended at the 50-minute time cap. This validates that composition on that setup, not this PR in isolation. - `git diff --check upstream/main...HEAD` passed. ### Checklist - [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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository - [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: NVIDIA GeForce RTX 3080 Ti 12 GB, driver 615.71.09, Linux (distribution not reported) - [x] AI-assisted: yes
CnRJay commented 2026-10-14 19:16:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-14T19:16:51Z.

Review: COMMENTED


Accounting for evicted storage images is the right target for #5961. Charging every image a draw or dispatch references is a different thing, though, and it will cost frame time.

KeptBytesBudget is 512 MiB per open batch. When it is reached, BoundKeptBytes submits the batch. Once in-flight kept bytes pass 1 GiB, it finishes the oldest batch, which means a CPU wait on the GPU. With this change, every storage image a recorded draw samples or renders to counts toward that budget once per batch, through keepRecordedDraw, the dispatch paths and the recipe hits. At 4K, a deferred renderer's targets alone (G-buffer, depth, HDR colour, post chain at 33–130 MB each) come close to 512 MiB within one frame. Batches would then be cut every frame or more often, and with two or three frames in flight the 1 GiB bound starts waiting on the GPU. That removes the CPU/GPU overlap the recorder exists to provide.

Those images are also not what the budget is meant to bound. A cached storage image stays alive through its cache entry whether or not a batch references it, so waiting for the batch frees nothing. The bytes that retiring a batch actually releases are those of images whose last owner is the batch: the evicted and invalidated ones in cachedStorageTexture and ClearCachedTextures, and the evicted vector in VulkanDevice::dispatch. Charging only those paths would bound the memory #5961 is about without putting backpressure on every frame.

Two smaller points:

  • KeepStorageImageBytes builds a std::unordered_set for each call, and it runs per recorded draw. KeepBytes already deduplicates by owner per batch (keptOwners), so the set only adds an allocation per draw.
  • The PR's own test didn't run (the CPU lacks AVX2), and there is no title run. A change to batch-splitting behaviour needs at least agc_recorder_kept_bytes and the agc_driver_* tests on a supported CPU. It also needs the summary lines of one title before and after, so the number of submits per frame is visible.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5523370587 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#pullrequestreview-5523370587). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-14T19:16:51Z. **Review:** COMMENTED --- Accounting for evicted storage images is the right target for #5961. Charging every image a draw or dispatch references is a different thing, though, and it will cost frame time. `KeptBytesBudget` is 512 MiB per open batch. When it is reached, `BoundKeptBytes` submits the batch. Once in-flight kept bytes pass 1 GiB, it `finish`es the oldest batch, which means a CPU wait on the GPU. With this change, every storage image a recorded draw samples or renders to counts toward that budget once per batch, through `keepRecordedDraw`, the dispatch paths and the recipe hits. At 4K, a deferred renderer's targets alone (G-buffer, depth, HDR colour, post chain at 33–130 MB each) come close to 512 MiB within one frame. Batches would then be cut every frame or more often, and with two or three frames in flight the 1 GiB bound starts waiting on the GPU. That removes the CPU/GPU overlap the recorder exists to provide. Those images are also not what the budget is meant to bound. A cached storage image stays alive through its cache entry whether or not a batch references it, so waiting for the batch frees nothing. The bytes that retiring a batch actually releases are those of images whose last owner is the batch: the evicted and invalidated ones in `cachedStorageTexture` and `ClearCachedTextures`, and the `evicted` vector in `VulkanDevice::dispatch`. Charging only those paths would bound the memory #5961 is about without putting backpressure on every frame. Two smaller points: - `KeepStorageImageBytes` builds a `std::unordered_set` for each call, and it runs per recorded draw. `KeepBytes` already deduplicates by owner per batch (`keptOwners`), so the set only adds an allocation per draw. - The PR's own test didn't run (the CPU lacks AVX2), and there is no title run. A change to batch-splitting behaviour needs at least `agc_recorder_kept_bytes` and the `agc_driver_*` tests on a supported CPU. It also needs the summary lines of one title before and after, so the number of submits per frame is visible.
MarcZX10 commented 2026-10-14 19:30:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T19:30:11Z.


Thanks, I agree with the distinction. I updated the accounting so cache-owned images do not add to keptBytes; the image is charged only after Cached() becomes false. This preserves the eviction/invalidation case while avoiding batch submissions caused by large render targets that the storage cache still owns. I also removed the per-call unordered_set and rely on Recorder::KeepBytes to deduplicate each owner within a batch.

The current head is ad3c53f2, based on 9f03c4fe. On that base, the focused AGC target builds successfully (70/70 steps) and git diff --check passes. CTest still aborts before test code on this Xeon CPU feature gate. I cannot run Wolverine or provide a title submit/frame comparison here, so that runtime/performance validation remains outstanding.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6176602344 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6176602344). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T19:30:11Z. --- Thanks, I agree with the distinction. I updated the accounting so cache-owned images do not add to `keptBytes`; the image is charged only after `Cached()` becomes false. This preserves the eviction/invalidation case while avoiding batch submissions caused by large render targets that the storage cache still owns. I also removed the per-call `unordered_set` and rely on `Recorder::KeepBytes` to deduplicate each owner within a batch. The current head is `ad3c53f2`, based on `9f03c4fe`. On that base, the focused AGC target builds successfully (70/70 steps) and `git diff --check` passes. CTest still aborts before test code on this Xeon CPU feature gate. I cannot run Wolverine or provide a title submit/frame comparison here, so that runtime/performance validation remains outstanding.
CnRJay commented 2026-10-14 19:38:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-14T19:38:49Z.


Thanks, that removes the per-frame backpressure: a cache-owned image now costs one atomic load per reference, and keptOwners does the deduplication.

One case is still not charged, and it is the one #5961 is about. An image is referenced by a draw while it is cached (charged 0), then evicted from the storage cache while that batch still holds it. In the for (const auto& image : evicted) loop in cachedStorageTexture, only the ShaderResources that RemoveImage returns get KeepStorageImageBytes. When no shared resource set references the evicted image, nothing charges it, and the batch keeps the whole allocation alive uncounted. Under eviction churn, these are exactly the images that pile up.

Charging the evicted image itself in that loop (recorder->KeepBytes(image.get(), image->BudgetBytes()) when the recorder is recording and image.use_count() > 1, so something besides the vector still holds it) covers that. A test that references an image in an open batch, evicts it by creating others past the budget, and checks OpenKeptBytes() would pin it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6176763002 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6176763002). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-14T19:38:49Z. --- Thanks, that removes the per-frame backpressure: a cache-owned image now costs one atomic load per reference, and `keptOwners` does the deduplication. One case is still not charged, and it is the one #5961 is about. An image is referenced by a draw while it is cached (charged 0), then evicted from the storage cache while that batch still holds it. In the `for (const auto& image : evicted)` loop in `cachedStorageTexture`, only the `ShaderResources` that `RemoveImage` returns get `KeepStorageImageBytes`. When no shared resource set references the evicted image, nothing charges it, and the batch keeps the whole allocation alive uncounted. Under eviction churn, these are exactly the images that pile up. Charging the evicted image itself in that loop (`recorder->KeepBytes(image.get(), image->BudgetBytes())` when the recorder is recording and `image.use_count() > 1`, so something besides the vector still holds it) covers that. A test that references an image in an open batch, evicts it by creating others past the budget, and checks `OpenKeptBytes()` would pin it.
MarcZX10 commented 2026-10-14 19:45:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T19:45:50Z.


Added eviction-time accounting for storage images retained by an open recorder batch, including the path with the shared resource cache disabled. The focused target builds, and local plus CI convention checks pass. CTest could not execute on this Linux host: the Xeon E5-1620 v2 lacks the emulator-required AVX2, FMA, BMI1/2, MOVBE, and LZCNT extensions. Current commit: c1a9f6957.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6176899034 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6176899034). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T19:45:50Z. --- Added eviction-time accounting for storage images retained by an open recorder batch, including the path with the shared resource cache disabled. The focused target builds, and local plus CI convention checks pass. CTest could not execute on this Linux host: the Xeon E5-1620 v2 lacks the emulator-required AVX2, FMA, BMI1/2, MOVBE, and LZCNT extensions. Current commit: c1a9f6957.
Ondra97 commented 2026-10-14 19:54:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-14T19:54:37Z.


@MarcZX100 @tv7, could you review the separate sampled-view cleanup in #5997, particularly its lock ordering and preservation of resources referenced by recorded GPU work? My Windows build and 12 targeted Vulkan tests passed, but Wolverine remains untested. When testing #5998, could you also compare it with #5997 applied to check for regressions or additional benefit?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6177060897 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6177060897). Originally posted by [Ondra97](https://github.com/Ondra97) on 2026-10-14T19:54:37Z. --- @MarcZX100 @tv7, could you review the separate sampled-view cleanup in #5997, particularly its lock ordering and preservation of resources referenced by recorded GPU work? My Windows build and 12 targeted Vulkan tests passed, but Wolverine remains untested. When testing #5998, could you also compare it with #5997 applied to check for regressions or additional benefit?
tv7 commented 2026-10-14 20:02:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-14T20:02:57Z.


@MarcZX100 a first Wolverine run on c1a9f6957, with the same local counters as in #5961. It was cut short, so treat it as partial.

Why it stopped early: the run did not abort on its own. The tool I run it from stopped it for low system memory after about 6 minutes (22:54:37 to 23:00:51 local), while the game process held about 17 GB of RAM. (An earlier version of this comment said the PC has about 16 GB usable. That was wrong: it has 32 GB, but its commit limit is only about 39 GB because the page file is small.) I haven't measured the game's memory on plain main in this scene, so I can't yet say whether the PR changes it. A full rerun with memory sampling is in progress.

Setup: Windows 11, RTX 3070 8 GB (driver 617.14), GCC 15.2.0 UCRT, Release, --to-intel, your head c1a9f6957 with the local counters cherry-picked on top.

What the 6 minutes showed:

main e34c47921 (#5961) c1a9f6957 (6 min, partial)
vkAllocateMemory ... -2 yes, then the presentation abort 0
Evicted images still alive (most at one report) 1,873 (8.3 GiB) 625 (3.6 GiB)
Typical survivors between reports hundreds to over a thousand alternates between about 490 (3 GiB) and 2 (20 to 36 MiB)
Live Vulkan allocations, peak (incl. about 5 GiB host imports) 19.3 GiB 13.9 GiB
Evictions about 10,000 to 13,000 by the abort about 108,000 in 6 minutes

So in this window, the survivors are bounded and released in step with batches, and no device allocation failed. The eviction churn itself continues, as expected. I'll repeat the run for the full 900 s with more free RAM and post the result here.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6177215765 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6177215765). Originally posted by [tv7](https://github.com/tv7) on 2026-10-14T20:02:57Z. --- @MarcZX100 a first Wolverine run on c1a9f6957, with the same local counters as in #5961. It was cut short, so treat it as partial. **Why it stopped early:** the run did not abort on its own. The tool I run it from stopped it for low system memory after about 6 minutes (22:54:37 to 23:00:51 local), while the game process held about 17 GB of RAM. (An earlier version of this comment said the PC has about 16 GB usable. That was wrong: it has 32 GB, but its commit limit is only about 39 GB because the page file is small.) I haven't measured the game's memory on plain `main` in this scene, so I can't yet say whether the PR changes it. A full rerun with memory sampling is in progress. Setup: Windows 11, RTX 3070 8 GB (driver 617.14), GCC 15.2.0 UCRT, Release, `--to-intel`, your head c1a9f6957 with the local counters cherry-picked on top. What the 6 minutes showed: | | `main` e34c47921 (#5961) | c1a9f6957 (6 min, partial) | |---|---|---| | `vkAllocateMemory ... -2` | yes, then the presentation abort | **0** | | Evicted images still alive (most at one report) | 1,873 (8.3 GiB) | 625 (3.6 GiB) | | Typical survivors between reports | hundreds to over a thousand | alternates between about 490 (3 GiB) and 2 (20 to 36 MiB) | | Live Vulkan allocations, peak (incl. about 5 GiB host imports) | 19.3 GiB | 13.9 GiB | | Evictions | about 10,000 to 13,000 by the abort | about 108,000 in 6 minutes | So in this window, the survivors are bounded and released in step with batches, and no device allocation failed. The eviction churn itself continues, as expected. I'll repeat the run for the full 900 s with more free RAM and post the result here. AI-assisted: yes
tv7 commented 2026-10-14 20:39:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-14T20:39:07Z.


@MarcZX100 @Ondra97 full runs, as promised. Same setup as above (Windows 11, 32 GB RAM, RTX 3070 8 GB, driver 617.14, Release, --to-intel, local counters on top), 900 s each, with the game's memory sampled every 30 s:

main e34c47921 (#5961) #5998 c1a9f6957 #5998 + #5997 fd9525a2e
Result device-memory abort after a few minutes ran the full 900 s ran the full 900 s
vkAllocateMemory ... -2 yes 0 0
Evicted images still alive, most at one report 1,873 (8.3 GiB) 664 (3.9 GiB) 652 (3.7 GiB)
At the last report n/a 4 (28 MiB) 8 (180 MiB)
Live Vulkan allocations, peak (incl. about 5 GiB host imports) 19.3 GiB 13.9 GiB 14.2 GiB
Evictions in 900 s n/a (about 10,000 to 13,000 before the abort) about 362,000 about 360,000

So #5998 removes the abort here, and #5997 on top changes nothing measurable in this title, either way. That is consistent with the earlier count in #5961, where almost no survivor was held by a sampled view.

One thing worth knowing, though not caused by these PRs as far as I can tell: the game process itself grows to about 31 GiB private (up to 22 GiB working set) in this scene, in both runs. That leaves about 0.5 GiB of commit headroom on this PC (32 GB RAM, about 39 GB commit limit), and it is why the earlier run was stopped for low system memory. I haven't been able to compare against plain main, because main aborts before reaching that point.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6177947036 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6177947036). Originally posted by [tv7](https://github.com/tv7) on 2026-10-14T20:39:07Z. --- @MarcZX100 @Ondra97 full runs, as promised. Same setup as above (Windows 11, 32 GB RAM, RTX 3070 8 GB, driver 617.14, Release, `--to-intel`, local counters on top), 900 s each, with the game's memory sampled every 30 s: | | `main` e34c47921 (#5961) | #5998 c1a9f6957 | #5998 + #5997 fd9525a2e | |---|---|---|---| | Result | device-memory abort after a few minutes | ran the full 900 s | ran the full 900 s | | `vkAllocateMemory ... -2` | yes | 0 | 0 | | Evicted images still alive, most at one report | 1,873 (8.3 GiB) | 664 (3.9 GiB) | 652 (3.7 GiB) | | At the last report | n/a | 4 (28 MiB) | 8 (180 MiB) | | Live Vulkan allocations, peak (incl. about 5 GiB host imports) | 19.3 GiB | 13.9 GiB | 14.2 GiB | | Evictions in 900 s | n/a (about 10,000 to 13,000 before the abort) | about 362,000 | about 360,000 | So #5998 removes the abort here, and #5997 on top changes nothing measurable in this title, either way. That is consistent with the earlier count in #5961, where almost no survivor was held by a sampled view. One thing worth knowing, though not caused by these PRs as far as I can tell: the game process itself grows to about 31 GiB private (up to 22 GiB working set) in this scene, in both runs. That leaves about 0.5 GiB of commit headroom on this PC (32 GB RAM, about 39 GB commit limit), and it is why the earlier run was stopped for low system memory. I haven't been able to compare against plain `main`, because `main` aborts before reaching that point. AI-assisted: yes
CnRJay commented 2026-10-14 20:45:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-14T20:45:54Z.


Checked c1a9f6957. The evicted image is now charged under its own pointer, and KeepBytes deduplicates it against the charge KeepStorageImageBytes makes for the same image through its resources, so nothing is counted twice. That covers the case I raised. @tv7's runs show the result: no -2, and survivors drop to single digits once batches retire.

Those runs also show something that is now the bigger cost, though it isn't this PR's to fix: about 362,000 storage-image evictions in 900 s, roughly 400 per second. Each one destroys an image that the title evidently wants again soon, so it is recreated, re-uploaded from guest memory and possibly written back. In other words, the storage cache thrashes on an 8 GB card in this scene. It no longer crashes, but the creation and upload traffic will dominate frame time there. It's worth tracking separately against the cache budget (#5483 sizes it from the reported budget). [storage] creation and upload counts per 10 s, next to the summary lines, would show how much of Wolverine's frame it costs.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6178072996 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6178072996). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-14T20:45:54Z. --- Checked c1a9f6957. The evicted image is now charged under its own pointer, and `KeepBytes` deduplicates it against the charge `KeepStorageImageBytes` makes for the same image through its resources, so nothing is counted twice. That covers the case I raised. @tv7's runs show the result: no `-2`, and survivors drop to single digits once batches retire. Those runs also show something that is now the bigger cost, though it isn't this PR's to fix: about 362,000 storage-image evictions in 900 s, roughly 400 per second. Each one destroys an image that the title evidently wants again soon, so it is recreated, re-uploaded from guest memory and possibly written back. In other words, the storage cache thrashes on an 8 GB card in this scene. It no longer crashes, but the creation and upload traffic will dominate frame time there. It's worth tracking separately against the cache budget (#5483 sizes it from the reported budget). `[storage]` creation and upload counts per 10 s, next to the summary lines, would show how much of Wolverine's frame it costs.
tv7 commented 2026-10-14 21:11:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-14T21:11:30Z.


@CnRJay the churn numbers you asked for, with #5483 for comparison. Same setup, 900 s each, with local counters counting LRU evictions and storage-image creations in cachedStorageTexture:

#5998 #5998 + #5483 (64ffeb8c9)
Storage cache budget 2,048 MiB about 1,807 MiB (a quarter of the 7,249 MiB reported budget)
Storage images created 362,695 367,651
of which re-creations of a surface evicted earlier 361,203 (99.6 %) 366,158 (99.6 %)
LRU evictions (all of them LRU, none from the mip or metadata paths) 361,913 367,365
Distinct base addresses involved 284 285
-2, most evicted-but-alive images 0, 664 (3.9 GiB) 0, 737 (4.2 GiB)

So it is about 400 creations per second either way. The scene cycles about 1,400 distinct surfaces (about 5.4 GiB by heldBytes, measured in #5961) through a cache of about 2 GiB, so a budget anywhere near 2 GiB thrashes about equally. #5483 neither helps nor hurts here. I haven't measured upload bytes per creation yet.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6178599536 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6178599536). Originally posted by [tv7](https://github.com/tv7) on 2026-10-14T21:11:30Z. --- @CnRJay the churn numbers you asked for, with #5483 for comparison. Same setup, 900 s each, with local counters counting LRU evictions and storage-image creations in `cachedStorageTexture`: | | #5998 | #5998 + #5483 (64ffeb8c9) | |---|---|---| | Storage cache budget | 2,048 MiB | about 1,807 MiB (a quarter of the 7,249 MiB reported budget) | | Storage images created | 362,695 | 367,651 | | of which re-creations of a surface evicted earlier | 361,203 (99.6 %) | 366,158 (99.6 %) | | LRU evictions (all of them LRU, none from the mip or metadata paths) | 361,913 | 367,365 | | Distinct base addresses involved | 284 | 285 | | `-2`, most evicted-but-alive images | 0, 664 (3.9 GiB) | 0, 737 (4.2 GiB) | So it is about 400 creations per second either way. The scene cycles about 1,400 distinct surfaces (about 5.4 GiB by `heldBytes`, measured in #5961) through a cache of about 2 GiB, so a budget anywhere near 2 GiB thrashes about equally. #5483 neither helps nor hurts here. I haven't measured upload bytes per creation yet. AI-assisted: yes
MarcZX10 commented 2026-10-15 01:24:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T01:24:14Z.


Thanks for the review and the follow-up validation. The current head charges an image only after storage-cache ownership ends, so batch references to still-cached render targets do not trigger batch splitting or waits. The full 900-second runs confirm the allocation failure is gone. The remaining 99.6% storage-image re-creation churn is now tracked separately in #6099, since the working set exceeds the cache budget and is a different issue.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6182220978 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6182220978). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T01:24:14Z. --- Thanks for the review and the follow-up validation. The current head charges an image only after storage-cache ownership ends, so batch references to still-cached render targets do not trigger batch splitting or waits. The full 900-second runs confirm the allocation failure is gone. The remaining 99.6% storage-image re-creation churn is now tracked separately in #6099, since the working set exceeds the cache budget and is a different issue.
github-actions[bot] commented 2026-10-15 10:12:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T10:12:48Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt L2020

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.

Pull request Shared files not compared
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4072 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5441 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5958 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6082 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6176 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6177 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6194 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6222 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6223 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6259 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6279 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6320 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6360 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6373 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6414 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6490 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6503 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6529 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6553 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6683 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6741 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6786 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6905 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6972 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7464 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7505 core/libs/prx/libSceAgcDriver/CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6189680556 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6189680556). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T10:12:48Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6937](https://www.github.com/boykopovar/AnyPS5/pull/6937) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` [L2020](https://github.com/boykopovar/AnyPS5/blob/a0f3dc40148ee82964c8021826cb44111aebe877/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L2020) | | | 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. | Pull request | Shared files not compared | |---|---| | [PR 1191](https://www.github.com/boykopovar/AnyPS5/pull/1191) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 1341](https://www.github.com/boykopovar/AnyPS5/pull/1341) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 4040](https://www.github.com/boykopovar/AnyPS5/pull/4040) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 4072](https://www.github.com/boykopovar/AnyPS5/pull/4072) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 4650](https://www.github.com/boykopovar/AnyPS5/pull/4650) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 5371](https://www.github.com/boykopovar/AnyPS5/pull/5371) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5426](https://www.github.com/boykopovar/AnyPS5/pull/5426) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5441](https://www.github.com/boykopovar/AnyPS5/pull/5441) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 5609](https://www.github.com/boykopovar/AnyPS5/pull/5609) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 5958](https://www.github.com/boykopovar/AnyPS5/pull/5958) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6082](https://www.github.com/boykopovar/AnyPS5/pull/6082) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6176](https://www.github.com/boykopovar/AnyPS5/pull/6176) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6177](https://www.github.com/boykopovar/AnyPS5/pull/6177) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6194](https://www.github.com/boykopovar/AnyPS5/pull/6194) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6197](https://www.github.com/boykopovar/AnyPS5/pull/6197) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6222](https://www.github.com/boykopovar/AnyPS5/pull/6222) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6223](https://www.github.com/boykopovar/AnyPS5/pull/6223) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6259](https://www.github.com/boykopovar/AnyPS5/pull/6259) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 6279](https://www.github.com/boykopovar/AnyPS5/pull/6279) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6320](https://www.github.com/boykopovar/AnyPS5/pull/6320) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6360](https://www.github.com/boykopovar/AnyPS5/pull/6360) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 6373](https://www.github.com/boykopovar/AnyPS5/pull/6373) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6414](https://www.github.com/boykopovar/AnyPS5/pull/6414) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6490](https://www.github.com/boykopovar/AnyPS5/pull/6490) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6499](https://www.github.com/boykopovar/AnyPS5/pull/6499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6503](https://www.github.com/boykopovar/AnyPS5/pull/6503) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 6529](https://www.github.com/boykopovar/AnyPS5/pull/6529) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6535](https://www.github.com/boykopovar/AnyPS5/pull/6535) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6539](https://www.github.com/boykopovar/AnyPS5/pull/6539) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6553](https://www.github.com/boykopovar/AnyPS5/pull/6553) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6683](https://www.github.com/boykopovar/AnyPS5/pull/6683) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6741](https://www.github.com/boykopovar/AnyPS5/pull/6741) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6747](https://www.github.com/boykopovar/AnyPS5/pull/6747) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6763](https://www.github.com/boykopovar/AnyPS5/pull/6763) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6786](https://www.github.com/boykopovar/AnyPS5/pull/6786) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6905](https://www.github.com/boykopovar/AnyPS5/pull/6905) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6972](https://www.github.com/boykopovar/AnyPS5/pull/6972) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 7223](https://www.github.com/boykopovar/AnyPS5/pull/7223) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7464](https://www.github.com/boykopovar/AnyPS5/pull/7464) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 7505](https://www.github.com/boykopovar/AnyPS5/pull/7505) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` |
coltken95 commented 2026-10-15 18:56:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-15T18:56:11Z.


Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with c1a9f6957 merged into main b7cedd900. This host passes the HostCpu check, so ctest runs.

  • agc_recorder_kept_bytes, agc_driver_storage_cache_budget and agc_driver_storage_cache_retained_batch pass.
  • Full ctest -R '^agc_': 597 of 598 pass or skip (42 skip on lavapipe). The one failure, agc_driver_mesh_index_cache, aborts with LLVM ERROR: Cannot emit physreg copy instruction inside llvmpipe, and does the same on plain main b7cedd900, so it isn't from this PR.
  • No comparison against main for the storage-cache tests: StorageCacheBudget.cpp calls StorageTexture::BudgetBytes(), which this PR adds, so it doesn't build without the change.

No title run here (no Wolverine).

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6199903713 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6199903713). Originally posted by [coltken95](https://github.com/coltken95) on 2026-10-15T18:56:11Z. --- Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with c1a9f6957 merged into main b7cedd900. This host passes the HostCpu check, so ctest runs. - `agc_recorder_kept_bytes`, `agc_driver_storage_cache_budget` and `agc_driver_storage_cache_retained_batch` pass. - Full `ctest -R '^agc_'`: 597 of 598 pass or skip (42 skip on lavapipe). The one failure, `agc_driver_mesh_index_cache`, aborts with `LLVM ERROR: Cannot emit physreg copy instruction` inside llvmpipe, and does the same on plain main b7cedd900, so it isn't from this PR. - No comparison against main for the storage-cache tests: `StorageCacheBudget.cpp` calls `StorageTexture::BudgetBytes()`, which this PR adds, so it doesn't build without the change. No title run here (no Wolverine). AI-assisted: yes (Claude Code)
mrfelek commented 2026-10-16 01:04:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-16T01:04:07Z.


Astro Bot (PPSA21564): storage-image memory growth and vkAllocateMemory -2 on a 12 GB card

Setup

  • Build: origin/main 44df21632 + #5390 (ad572ebb1), Release, Linux, no #5998 in this build
  • Title: ASTRO BOT (PPSA21564), save file from a previous session
  • Host: Ryzen 9 5950X, RTX 3080 Ti 12 GB, NVIDIA 615.71.09

Two runs, both ended the same way

Storage images Storage cache (MiB)
400 3387
450 4061
600 5450
650 5491

The [texture] N storage images (X MiB) line grows steadily. The run then ends with presentation failed: AGC graphics: vkAllocateMemory texture: Vulkan result -2, followed by terminate called (exit 134). The first run ended about 9 minutes in and the second about 35 minutes in.

Memory-fix build (#5998, #5997, #6492, #6465 on top of #5390)

  • Same save, 15-minute run: 400 images at 3531 MiB, no -2 error, no crash. The run was stopped at the time cap, so it did not reach the point where the earlier runs failed.
  • We are running it longer to see whether it passes 650 images.

Not established

  • Whether the growth comes from the game or from the cache. The numbers above are the storage cache only.
  • Whether the memory-fix build avoids the failure; the longer run is still pending.

@coltken95 you tested #5998 on lavapipe earlier. If this data helps with the storage budget, we are happy to share the logs.

AI-assisted; the build and runs are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6205645413 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6205645413). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-16T01:04:07Z. --- ## Astro Bot (PPSA21564): storage-image memory growth and `vkAllocateMemory -2` on a 12 GB card **Setup** - Build: `origin/main` `44df21632` + #5390 (`ad572ebb1`), Release, Linux, no #5998 in this build - Title: ASTRO BOT (PPSA21564), save file from a previous session - Host: Ryzen 9 5950X, RTX 3080 Ti 12 GB, NVIDIA 615.71.09 **Two runs, both ended the same way** | Storage images | Storage cache (MiB) | |---|---| | 400 | 3387 | | 450 | 4061 | | 600 | 5450 | | 650 | 5491 | The `[texture] N storage images (X MiB)` line grows steadily. The run then ends with `presentation failed: AGC graphics: vkAllocateMemory texture: Vulkan result -2`, followed by `terminate called` (exit 134). The first run ended about 9 minutes in and the second about 35 minutes in. **Memory-fix build (#5998, #5997, #6492, #6465 on top of #5390)** - Same save, 15-minute run: 400 images at 3531 MiB, no `-2` error, no crash. The run was stopped at the time cap, so it did not reach the point where the earlier runs failed. - We are running it longer to see whether it passes 650 images. **Not established** - Whether the growth comes from the game or from the cache. The numbers above are the storage cache only. - Whether the memory-fix build avoids the failure; the longer run is still pending. @coltken95 you tested #5998 on lavapipe earlier. If this data helps with the storage budget, we are happy to share the logs. AI-assisted; the build and runs are from my machine.
MarcZX10 commented 2026-10-16 15:59:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T15:59:32Z.


Thanks for the two Astro Bot runs and the matched 15-minute data point. This is useful evidence that the fix lowers growth at 400 storage images, but it does not yet establish whether the longer run avoids the prior 600–650-image failure window. Please add the result when the extended run finishes; I have kept that limitation explicit.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6219417302 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6219417302). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T15:59:32Z. --- Thanks for the two Astro Bot runs and the matched 15-minute data point. This is useful evidence that the fix lowers growth at 400 storage images, but it does not yet establish whether the longer run avoids the prior 600–650-image failure window. Please add the result when the extended run finishes; I have kept that limitation explicit.
MarcZX10 commented 2026-10-16 16:33:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T16:33:24Z.


I reviewed the current #5997 head and posted the source review there. I found no lock-order cycle: storage-cache locking ends before the sampled-cache drain, and the other sampled-cache paths do not hold that mutex while acquiring the storage-cache mutex. Evicted images stay strongly held through cleanup, and recorder-kept descriptor resources preserve images used by recorded work.

I also compared #5997 with #5998 using a merge preview; they compose cleanly. #5998 may conservatively charge an image while a sampled view still holds it immediately before #5997 drains that view, but I found no correctness regression from that ordering. The current #5997 workflow passes conventions, eligibility and report; platform build jobs are skipped. I have not triggered or run a full platform build, so that remains unverified.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6220080567 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6220080567). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T16:33:24Z. --- I reviewed the current #5997 head and posted the source review there. I found no lock-order cycle: storage-cache locking ends before the sampled-cache drain, and the other sampled-cache paths do not hold that mutex while acquiring the storage-cache mutex. Evicted images stay strongly held through cleanup, and recorder-kept descriptor resources preserve images used by recorded work. I also compared #5997 with #5998 using a merge preview; they compose cleanly. #5998 may conservatively charge an image while a sampled view still holds it immediately before #5997 drains that view, but I found no correctness regression from that ordering. The current #5997 workflow passes conventions, eligibility and report; platform build jobs are skipped. I have not triggered or run a full platform build, so that remains unverified.
MarcZX10 commented 2026-10-16 21:23:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T21:23:19Z.


Thanks for checking the cache ownership and retained-image accounting across those paths. The Linux RADV run and the Wolverine results also close the validation gap I had called out; I appreciate the thorough review.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6224966811 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6224966811). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T21:23:19Z. --- Thanks for checking the cache ownership and retained-image accounting across those paths. The Linux RADV run and the Wolverine results also close the validation gap I had called out; I appreciate the thorough review.
mrfelek commented 2026-10-16 21:27:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-16T21:27:27Z.


Astro Bot (PPSA21564), extended run as asked: Linux, RTX 3080 Ti 12 GB, NVIDIA 615.71.09. Build main 44df21632 + #5390 + this PR (c1a9f6957) + #5997 + #6492 + #6465 + #6464 (#6464 is needed past the start of Sky Garden; see below). About 40 minutes in Sky Garden with a DualSense, stopped by our 50-minute time limit, no crash.

  • Storage images reached 650, where earlier runs without these PRs stopped with vkAllocateMemory ... Vulkan result -2.
  • VRAM stayed at 10.2–10.6 GB for the whole level (nvidia-smi, every 2 minutes).
  • Without #6464 the same build stopped about 8 minutes into the level on conservative rasterization with centroid interpolation is unsupported, at 400 storage images, before reaching that range.
  • Note: the MiB figure on the [texture] N storage images line counts every image created, not what is held, so VRAM is the better measure.

AI-assisted: this comment was drafted with the help of Claude Code and checked against the logs by us.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6225028360 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6225028360). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-16T21:27:27Z. --- Astro Bot (PPSA21564), extended run as asked: Linux, RTX 3080 Ti 12 GB, NVIDIA 615.71.09. Build `main` `44df21632` + #5390 + this PR (`c1a9f6957`) + #5997 + #6492 + #6465 + #6464 (#6464 is needed past the start of Sky Garden; see below). About 40 minutes in Sky Garden with a DualSense, stopped by our 50-minute time limit, no crash. - Storage images reached 650, where earlier runs without these PRs stopped with `vkAllocateMemory ... Vulkan result -2`. - VRAM stayed at 10.2–10.6 GB for the whole level (`nvidia-smi`, every 2 minutes). - Without #6464 the same build stopped about 8 minutes into the level on `conservative rasterization with centroid interpolation is unsupported`, at 400 storage images, before reaching that range. - Note: the MiB figure on the `[texture] N storage images` line counts every image created, not what is held, so VRAM is the better measure. AI-assisted: this comment was drafted with the help of Claude Code and checked against the logs by us.
MarcZX10 commented 2026-10-16 21:44:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T21:44:49Z.


Thanks for completing the extended run. Reaching 650 storage images and running about 40 minutes in Sky Garden without the earlier allocation failure is a useful result; the 10.2–10.6 GB VRAM range also gives a clearer measure than the created-image counter. I’ve updated my assessment: this validates the fix on this setup, with the tested composition including #5997, #6492, #6465 and #6464, and the run ending at the 50-minute cap rather than at a failure.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6225282022 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6225282022). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T21:44:49Z. --- Thanks for completing the extended run. Reaching 650 storage images and running about 40 minutes in Sky Garden without the earlier allocation failure is a useful result; the 10.2–10.6 GB VRAM range also gives a clearer measure than the created-image counter. I’ve updated my assessment: this validates the fix on this setup, with the tested composition including #5997, #6492, #6465 and #6464, and the run ending at the 50-minute cap rather than at a failure.
MarcZX10 commented 2026-10-18 14:35:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T14:35:14Z.


Rebased onto the latest main and kept both the existing dirty-image eviction coverage and the upstream retained-batch case. Convention and diff checks pass. I could not configure a fresh full build here because the checkout’s third-party submodule directories are empty; CI is now checking the pushed head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6251150659 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5998#issuecomment-6251150659). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T14:35:14Z. --- Rebased onto the latest `main` and kept both the existing dirty-image eviction coverage and the upstream retained-batch case. Convention and diff checks pass. I could not configure a fresh full build here because the checkout’s third-party submodule directories are empty; CI is now checking the pushed head.
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!5998
No description provided.