fix(agc): discard recorder batches after submission failure #3298
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3298"
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 mrcrapto on 2026-10-11T06:09:36Z.
What
If
vkEndCommandBufferorvkQueueSubmitfails afterRecorder::Submit()moves out the open batch, the batch destructor releases kept objects but leaves its Vulkan handles, label-table entries, completion counts and pending-write snapshot behind. Label entries can then refer to the destroyed batch.Discard the failed batch on unwind, removing only its labels and completion counts, refreshing the pending-write snapshot and releasing its handles without running its completions. Earlier in-flight batches remain tracked. Reuse the same label-removal helper on normal completion.
For
VK_ERROR_DEVICE_LOSTfrom queue submission, wait for device idle before discarding potentially in-use resources, accepting either success or device loss from that wait. This follows the Vulkan lost-device rules; queue-submit allocation failures instead leave submission state unaffected. The original submission error still propagates.Related to #3171: this fixes a deterministic cleanup defect, but is not a confirmed fix for the reported Windows heap corruption or Intel device loss.
Tested
Windows 11, WinLibs GCC 15.2, Release,
BUILD_TESTING=ON. Final base:de129cfd; no game dump is needed for these tests.agc_recorder_kept_byteswith six injected failure cases: host/device allocation failure from command-buffer end and queue submit, plus queue device loss with successful/device-lost idle waits. The tests check labels, snapshots, counters, callbacks, kept-resource lifetime, handle cleanup and preservation of an earlier submission. Passes with the procedure cache enabled and withAPS5_NO_PROC_TABLE=1.d7cfa728with 14 failed assertions before the fix.agc_driver,agc_driver_gated_dispatch_captureand recorder--completion-labels-onlypass.d7cfa728base:agc_driverpassed; patched gated-dispatch capture failed twice withVK_ERROR_DEVICE_LOST, while a single unchanged-upstream comparison passed. These observations do not establish the cause of the Intel failure. No complete-suite or Linux pass is claimed.cmake --build build-contribution --parallel 5.python tools/check_conventions.py --base origin/mainandgit diff --checkpass.Validation logs: https://gist.github.com/mrcrapto/7ff8c0744c2638a47672bc0dc3b394d2
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T06:09:47Z.
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
Pull request closed