fix(agc): throw instead of aborting when a heap mirror cannot be made #1085
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1085"
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 Celegans12 on 2026-10-07T10:13:03Z.
What
When the device refused a heap mirror's buffer, or a new mirror would go past
APS5_HEAP_MIRROR_MIB,acquireMirrorprinted a FATAL line and calledabort(), so one address-based build short of host memory ended the process. PPSA26344 v1.008 hit it at 478 s, with 6.8 GiB of heap mirrors next to the host imports in the 16 GiB host-visible heap.APS5_HEAP_MIRROR_MIBfirst sweeps the mirrors whose range the guest freed since the last build's sweep, before its allocation. If it still does not fit, the build throwsheap mirror of 0x...+0x...: past the budget; heap mirrors hold ....heap mirror of 0x...+0x...: vkAllocateMemory buffer: Vulkan result -2; heap mirrors hold ..., so the draw or dispatch fails like any other allocation; there is no second try. Nothing is registered for the range.sweepMirrorsandacquireMirrorelsewhere; both merge cleanly, and the tests pass merged with them.Tested
main9619edff: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)VK_DRIVER_FILES): 405/405 pass;agc_driver_flat_storeis left out there because it takes several minutes on Windows llvmpipeagc_driver_graphics(APS5_HEAP_MIRROR_MIB=4, mock memory limit): a mirror past the budget is made in the memory of the expired mirror swept first; a refused one fails its build withVulkan result -2after one allocation attempt, and is made once the limit is lifted. Fails on main:FATAL: heap mirror of ...: past the budget, thenabort().Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T03:25:36Z.
acquireMirrorretries the allocation after the device refuses it (GuestBufferMemory.cpp:793-811). Retrying after an error isn't allowed here (#182); please sweep before the first allocation if you want the sweep, and keep the throw. Theruntime_errorinstead ofabort()is good.Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-08T04:17:05Z.
Thanks for pointing me at #182, I hadn't counted a retry after the device refuses as an error-driven fallback, but it is one. I've dropped it in 6ab850ec9: when a new heap mirror would go past
APS5_HEAP_MIRROR_MIB,acquireMirrornow sweeps the mirrors whose range is gone before the first and only allocation, and a refusal throws theruntime_errorstraight away. The test counts allocation attempts now and checks that a refused mirror fails after exactly one. If you'd rather not have the sweep there at all, I can take it out too.