fix(agc): release cached address space on device teardown #4849
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4849"
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 MarcZX10 on 2026-10-13T00:07:47Z.
What
GuestBufferMemory::AcquireRegisteredcan publish an address space that holds leases for every registered GPU allocation.ClearImageMirrorsused to release that cache only after confirming the mirror table belonged to the device. When lease mirrors are disabled, the mirror table has no device, so teardown returned early and left the address-space cache pinning allocations after the Vulkan device was destroyed.Clear the cached address space by its own device identity before the mirror-table early return. Add a focused mock-Vulkan regression that builds an address space with
APS5_NO_LEASE_MIRROR=1, tears it down, and confirms freeing its allocation does not need the pin waiter's cache-drop fallback. The regression fails against the old teardown logic.Related to #4846. The reported ProsperoEden exit hang also reproduces with
APS5_NO_ADDRESS_SPACE_CACHEenabled, so this cache cleanup is not established as the cause or fix for that issue. The test covers a separate lease cleanup regression when lease mirrors are disabled.Tested
Linux, GCC 12.2, Release, Ninja,
ANYPS5_ENABLE_SPIRV_TOOLS=OFF.agc_driver_address_space_teardownpasses. Restoring the old cleanup order makes it fail withdevice teardown left the cached address space pinning guest allocations.agc_driver_graphicspasses (15.78 s).python3 tools/check_conventions.py --base upstream/mainandgit diff --checkpass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T05:52:25Z.
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/Graphics.cppL2882-2883, L5597core/libs/prx/libSceAgcDriver/tests/Graphics.cppL5597Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T05:55:56Z.
Validation on the rebased head
abc997b0daf691918aa8ae681debdc10c43328d4:agc_driver_graphics_testscompleted.agc_driver_address_space_teardownpassed (1/1).tools/check_test_registration.py,tools/check_conventions.py --base upstream/main --head HEAD, andgit diff --checkpassed.The overlap report flags nearby changes to
Graphics.cppin #757 and #758. This fix does not depend on either; I’ll account for those edits if either lands first.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T08:05:05Z.
Please drop
Fixes #4846. The issue reproduces withAPS5_NO_ADDRESS_SPACE_CACHEset and with lease mirrors on, so this cache isn't what holds its lease; #4872 fixes the exit order and the title's run there goes from 134 to 0. The early return inClearImageMirrors(GuestBufferMemory.cpp:1791) is still a real leak, so this stays open on its own. Which run reaches it withoutAPS5_NO_LEASE_MIRROR?Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T08:11:51Z.
Thanks for the correction. The ProsperoEden report reproduces with
APS5_NO_ADDRESS_SPACE_CACHEenabled and lease mirrors on, and #4872 addresses the reported exit-order failure. I removed “Fixes #4846” and clarified that this PR only tests cache lease cleanup when lease mirrors are disabled; the current evidence does not establish that this change fixes the reported ProsperoEden hang.