fix(agc): count transient copy buffers toward the recorder budget #6320
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6320"
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 fdfawef324 on 2026-10-15T11:24:02Z.
What
Read-only GPU-copy input snapshots and the linear scratch buffer used by depth-copy refresh were retained with a zero byte charge. These allocations could accumulate without contributing to the recorder's existing 512 MiB batching budget.
Charge each temporary buffer's requested size while retaining its owner. The existing submission and fence-retirement boundaries stay in place. This accounts for the buffers' logical sizes; it is not a cap on all physical allocations.
Tested
Windows, GCC 15.2 Release/O3, rebased head
ea02128b5b2fbased on mainf3059421f:agc_copy_input_kept_bytes,agc_depth_copy_kept_bytes,agc_recorder_kept_bytes,agc_pipeline_library_clear_waits_for_buildandagc_pipeline_store_lazy_buffer_pool, 5/5 passed. Tests exercise the actual production copy paths, immutable input snapshots, mip offsets/aspects, exact budget boundaries, oldest-batch retirement and owner lifetime through fence completion.agc_driver_depth_compare_copy,agc_driver_depth_plane_guest_layers,agc_driver_recorded_kept_bytes(real Vulkan) andagc_driver_graphics(CPU/mock), 4/4 CTest cases passed in 11.48 seconds with no skipped CTest cases andANYPS5_REQUIRE_VULKAN=1. The recorded-kept-bytes suite explicitly reported that its draw-snapshot subcases were not tested on this configuration; its other cases ran. All four actual executables were freshly built for this head and pinned with their runtime libraries before and after the managed-slot run.The two new copy tests mock Vulkan and do not execute GPU copies. The three adjacent hardware suites exercise surrounding recorder/depth behavior. Clean merge into main
fc623324awas checked separately; the tests above ran on the stated head. No title memory reduction or FPS improvement has been measured for this change. Earlier test reports in comments apply to their explicitly named older heads.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)Co-Authored-By: Codex [email protected]
Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-15T12:06:29Z.
Rebased onto
main341613ab6to resolve the conflict with #5304 in the Graphics test dispatch (both branches kept). The production diff is unchanged.On the new head
fb4bf56ea(Windows, GCC 15.2 Release), all 52 ctest cases ofagc_driver_graphics_testsandagc_driver_recorder_testspass; 41 of them ran on the RTX 3060. Reverting both charges makes both new tests fail. The Tested section is updated.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:18:40Z.
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.cppL4456core/libs/prx/libSceAgcDriver/CMakeLists.txtL1890core/libs/prx/libSceAgcDriver/CMakeLists.txtL1890core/libs/prx/libSceAgcDriver/CMakeLists.txtL1890core/libs/prx/libSceAgcDriver/CMakeLists.txtL1890Some 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/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.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/tests/Graphics.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/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-16T19:53:47Z.
Rebased onto main at
c84249186: head is now bc0708789; the one conflict was in themain()dispatch oftests/Graphics.cpp, where--pipeline-journallanded next to our two new flags, and we kept all three.The production change is unchanged: the two
Keep()calls (GPU-copy input snapshot, depth-copy linear buffer) still pass their byte counts to the recorder.Tests:
agc_copy_input_kept_bytes,agc_depth_copy_kept_bytesandagc_recorder_kept_bytespass on the rebased build, and the first two fail with the two byte arguments reverted. GPU neighbours on the RTX 3060 (driver 591.86, Windows Server 2025):agc_driver_graphics,agc_driver_depth_compare_copy,agc_driver_depth_plane_guest_layersandagc_driver_recorded_kept_bytespass (4 of 4).AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-18T22:55:51Z.
Rebased onto main
f3059421f; new headea02128b5b2f. The Graphics conflicts preserve main's atomic live-object counter and both newer pipeline handlers alongside the copy test handlers. The two production byte charges are unchanged.Fresh checks on this exact head: five CPU/mock tests pass, and reverting only the two byte arguments makes both new copy tests fail at their budget assertions. After restoration/rebuild, the five tests pass again. The managed-slot adjacent batch passes 4/4 CTest cases: three real Vulkan suites (
depth_compare_copy,depth_plane_guest_layers,recorded_kept_bytes) plus mockgraphics. The recorded-kept-bytes suite reports its draw-snapshot subcases were not tested; its other cases ran. All actual executables and runtime libraries were freshly built and hash-pinned. Full GPU details and current qualifications are in Tested.Clean merge into main
fc623324achecked separately. No title memory/FPS improvement measured. Earlier comments refer to their named historical heads; the obsolete later-main paragraph has been removed from the body.AI-assisted: yes