fix(agc): keep small device buffers in the small pool tier #7056
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7056"
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 danielcadev on 2026-10-17T09:17:45Z.
What
Small device-local buffers currently share the device tier with large scratch allocations. Releasing two buffers that together exceed that tier's byte budget evicts a previously retained 256-byte buffer, so the next small request allocates again.
Route device allocations with a capacity below 1 MiB to the existing small tier. Keep the shared-pool mode and disabled-staging mode unchanged, along with existing byte/slot budgets, memory-property keys, allocation lifetimes and exact Vulkan buffer sizes.
Add a regression through
DeviceBufferthat forces large-buffer eviction, checks reuse of the small allocation and verifies final object cleanup. Separate processes cover shared pooling and disabled staging because the configuration is cached per process.Related: #4472 changes VRAM-pressure retention; this PR changes size-based tier selection and has no dependency on it. The broader Linux/Yōtei investigation is tracked in discussion #2884. No title FPS or RAM improvement is claimed for this isolated change.
Overlap review: #6882 and #7057 address slab-allocation cleanup and failed memory binding, respectively. The retention fixture and its default-suite call have been moved away from their insertion points;
git merge-treenow combines this branch cleanly with their reviewed heads. #6943 still overlaps the command-line test dispatcher (main), not the production tier selection. Its selector needs to be reconciled when either branch lands; there is no production dependency on #6943. The conflicting-base BufferPool deltas in #5987 and #6553 were also inspected: they change allocation fallback/placement, nottierFor.Tested
Branch base:
ef674f5af3e4d0fe44fda10e46d36ead2c262c0e(main). The focused tests, complete runtime build and native smoke test usedmainf05fc7d953d30160cb05411875b2824fd10acc15plus this correction; the subsequent rebase only adds upstream #7055, which changes the LoadExec test cleanup, with no production changes. Fedora 44 x86-64, GCC 16.2.1, Release, defaultANYPS5_ENABLE_SPIRV_TOOLS=OFF.agc_buffer_pool,agc_buffer_pool_small_device_sharedandagc_buffer_pool_small_device_no_staging: passed.tierForcondition, rebuild and runAPS5_STAGING_POOL_MIB=256 agc_buffer_pool_tests --small-device-retention. It exits 1 with both retention/reallocation assertions failing. Restore the correction and rebuild for the final passing run.agc_device_memory_fallback: passed.agc_driver_pooled_buffer_range: passed on AMD Radeon RX 9060 XT 16 GB, locally modified Mesa 26.2.3 RADV, Fedora Linux. This real-GPU compatibility test checks exact buffer sizes and robust reads beyond the requested range; the new eviction regression itself uses the existing mock Vulkan allocator.agc_buffer_pool_tests; all three buffer-pool CTests passed again.tools/check_conventions.py: passed with the proposed title/body.tools/tests/test_test_registration.py: 27 tests passed.libs) and the relinker, reconverted PPSA26344 01.512.000 and checked imports: no unresolved imports. A separate cold-AnyPS5-cache native run ended in cgroup OOM after about 122 s at the 12 GiB RAM cap (1.22 GiB swap peak). No wolf/tree capture or title performance benefit was established; this is not a paired pool comparison. The original runtime was preserved.Validation is scoped to buffer allocation and retention. The full test suite and Windows were not run.
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositorypooled_buffer_rangecompatibility test)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T09:29:21Z.
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.
main)core/libs/prx/libSceAgcDriver/tests/BufferPool.cppL605-606Some 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.
core/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cppcore/libs/prx/libSceAgcDriver/tests/BufferPool.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cppcore/libs/prx/libSceAgcDriver/tests/BufferPool.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cppcore/libs/prx/libSceAgcDriver/tests/BufferPool.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txt