fix(agc): track submitted batches before profiling #7065
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7065"
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 Ondra97 on 2026-10-17T09:52:21Z.
What
With an active
FrameTiming, recording thequeue_submitmetric can throwstd::bad_allocaftervkQueueSubmitsucceeds.CommandBatchstill reports itself as unsubmitted then, so stack unwinding releases its command buffer and fence without checking completion. A caller that catches the profiling error cannotWait()for that submission either.Set
pendingandsubmittedimmediately after the successful Vulkan call, before recording the metric. The existing destructor completion check and explicit wait then remain valid through a profiling failure. End/submit errors retain their unsubmitted cleanup path.Uses the allocation-failure injector and native resource fixture from #6882, now merged into
main. #7057 independently handles device-buffer binding failures; #6943 handles returning slab slots. The command-batch probes remain separate from those fixtures. The same six regression cases run against CPU mocks and real Vulkan work. Vulkan requires completion before command-buffer release and fence destruction.Tested
Rebased upstream base:
e09dbc2b4231103552a108b2c582cee52e46be68. Tested head:85bc66e5c4904906e41de8dfaaa48ad4009fc9fc. Both original PR-owned patches are unchanged according togit range-diff; the carried #6882 merge is removed. The application, all patched libraries and selected test executables were rebuilt on this head. Release,BUILD_TESTING=ON, SPIRV-Tools disabled. In commands below,builddenotes the prepared build directory for the stated platform.The fixture installs a
FrameTimingcontext explicitly even with general timing logging disabled. A one-shot host allocation failure is armed after a successful submit; physical memory is not exhausted.Windows (native host)
AMD Ryzen 9 7900X, 32 GB RAM, NVIDIA GeForce RTX 4070 Ti SUPER, driver 617.42 / 32.0.16.1742, Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0; Tracy enabled.
Full application/library targets
relinkerandlibs, plus all 23 selected test executable targets, built successfully. 23/23 related tests passed, 0 failed, 0 skipped, withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andANYPS5_GPU=NVIDIA GeForce RTX 4070 Ti SUPER:The native command-batch fixture selected NVIDIA Vulkan (
vendor=0x10de,device=0x2705). Each of its four successful submissions passed a 256-byte GPU fill/readback. Both profiling-fault paths retained the submission state and completed without premature release or guard intervention. End/submit failure controls made no submission and required no completion wait. The mocked fixture passed the same six cases. Conventions, whitespace, main synchronization and test registration passed.The following table retains the original regression comparison: upstream
ef674f5af3e4d0fe44fda10e46d36ead2c262c0e, baseline321f9bb267cf670a529ade91d6d6601dee00503f(that main plus #6882 and the new regressions), original fixed head5c3f5f1b405b83f7acaba1f403f0763c35daa376. Each case ran once per variant on the Windows host above. These baseline measurements were not repeated during this rebase; the fixed cases were rerun at the tested head above.In that baseline run, the safety guard intercepted both native release attempts and waited before real destruction; both fences were still
VK_NOT_READY. The regression executables areagc_command_batch_failure_tests.exeandagc_driver_pooled_buffer_range_tests.exe.Windows build command
Linux (VirtualBox)
Ubuntu 24.04.5 LTS, kernel 7.0.0-38-generic, GCC 13.3.0, 4 vCPU and 8 GiB assigned RAM; VirtualBox 7.2.20r175154 on the Windows host above. Tracy disabled. Graphics: not exercised.
The same Git head was transferred with SHA-256 verification and tested in a separate checkout on the native Linux filesystem. Full application/library build passed, including compilation of the modified native Vulkan fixture. 9/9 CPU tests passed, 0 failed, 0 skipped; all six mocked command-batch cases passed. Conventions and test registration passed.
Linux graphics/Vulkan tests: NOT RUN — intentionally excluded from VirtualBox validation.
Native/bare-metal Linux was not tested.
Native Linux GPU validation: not tested.
Full hosted Windows/Linux builds require a collaborator's manual dispatch for this new head. No retail title run, FPS improvement or other GPU-vendor result is claimed.
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-17T10:10:52Z.
Some 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/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/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Resources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/execution/PooledBufferRange.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/Graphics/src/Resources.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/Graphics/src/Resources.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.txtImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T11:12:52Z.
#6882 just merged (
20a84154f) and touches the same files (BufferPool.cpp, the AllocationFailure test helpers, tests/BufferPool.cpp, PooledBufferRange.cpp, CMakeLists.txt), so this PR no longer merges cleanly into main. Could you rebase onto current main? Once the new head is up we'll rerun full CI; the review is otherwise done.Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-17T11:48:48Z.
@oneandonlydean I rebased this onto
e09dbc2b4231103552a108b2c582cee52e46be68and pushed85bc66e5c4904906e41de8dfaaa48ad4009fc9fc, addressing your rebase request. Both PR-owned patches are unchanged according togit range-diff. #6882 is now supplied bymain, and I removed its carried merge.Validation on the new head: full application/library builds on Windows (native host) and Linux (VirtualBox); 23/23 Windows tests, including real NVIDIA RTX 4070 Ti SUPER Vulkan fill/readback, and 9/9 Linux (VirtualBox) CPU tests, with no failures or skips. Linux graphics/Vulkan tests were intentionally not run.
The new head is ready for the full CI rerun you offered.
AI-assisted: yes. — Codex