fix(agc): retain GPU copy buffers before fallible diagnostics (standalone patch for review) #8659
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 VicRaster on 2026-10-20T20:13:23Z.
Standalone correctness patch for review. The diff below has no mail-format author metadata and includes only the lifetime fix and synthetic regressions. AI-assisted: yes.
At submission, main is
9a97ac784da5d40cc7b7d968898ffbf5b8b5377a. The four contribution files are unchanged since the tested base, and the patch applies cleanly to this newer main. The newer main was not rebuilt; the GPU results below apply to the stated tested base.What
With
APS5_CAPTURE_GPU_COPIES=1, diagnostic readback allocation can fail after the input copy has been recorded. The batch keeps the destination later, so unwinding can return that buffer to the pool while its command is still pending.Keep the destination before recording the copy, and keep the readback buffer before recording commands that use it. Add deferred-fence mock and real Vulkan CTest regressions, including a successful-readback control. This change is independent of experimental memory policies.
Tested
Windows 11 Pro build 26300, WinLibs MinGW-w64 GCC 15.2.0, NVIDIA GeForce RTX 3080 Ti, driver 610.88.
2185dbf92e8d9013a1620d2dfc95de50494e19f8.agc_copy_input_failure_lifetimeandagc_driver_copy_input_lifetime: both fail before the fix because the destination is reusable before its fence; both pass afterward with identical test sources.agc_buffer_pool,agc_driver_graphics,agc_driver_bda_device,agc_driver_bda_span_reads,agc_driver_guest_memory_lifetime,agc_driver_host_import_windowsandagc_copy_input_kept_bytes; 7/7 pass on both sides.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Full logs positively show validation instance/device insertion and the RTX 3080 Ti, with zeroVUID-messages, no missing-layer warnings and no skipped GPU tests. Convention and patch-application checks pass.Overlap review covered 770 open PRs. The upstream checker found no confirmed direct conflict; its 59 stale shared-file warnings were inspected separately. In particular, #6185 and #6186 change allocation usage and later shadow copies, while leaving this diagnostic ownership sequence unchanged. No duplicate fix or dependency was identified.
The separate native allocation failure during completion-callback registration was not fault-injected. Tests use synthetic memory; no game compatibility or performance improvement is claimed.
Proposed patch
Header-free standalone diff: four files
Imported from boykopovar/AnyPS5. Originally posted by VicRaster on 2026-10-20T20:33:16Z.
The fix and synthetic regression tests are now in PR #8667: https://github.com/boykopovar/AnyPS5/pull/8667. Closing this standalone patch-review issue so review can continue on the PR. The fix is awaiting review and has not been merged or released.