Skip to content

fix(agc): count transient copy buffers toward the recorder budget - #6320

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
fdfawef324:codex/copy-transfer-budget-current-1015
Oct 18, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
fdfawef324:codex/copy-transfer-budget-current-1015

Conversation

@fdfawef324

@fdfawef324 fdfawef324 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

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 ea02128b5b2f based on main f3059421f:

  • CPU/mock: agc_copy_input_kept_bytes, agc_depth_copy_kept_bytes, agc_recorder_kept_bytes, agc_pipeline_library_clear_waits_for_build and agc_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.
  • Reverting only the two byte arguments makes both new copy tests fail at their specific budget assertions. Restored the exact source, rebuilt and reran the five tests successfully. Import watching is disabled in the input mock to avoid platform-dependent capability probes.
  • Adjacent regression batch: agc_driver_depth_compare_copy, agc_driver_depth_plane_guest_layers, agc_driver_recorded_kept_bytes (real Vulkan) and agc_driver_graphics (CPU/mock), 4/4 CTest cases passed in 11.48 seconds with no skipped CTest cases and ANYPS5_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.
  • Conventions passed. The Graphics test rebase preserves main's atomic live-object counter and newer pipeline handlers alongside the two copy handlers. The two production charges are unchanged by the rebase. Linux execution was not 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 fc623324a was 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

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none on its own
  • GPUs tested: NVIDIA GeForce RTX 3060 12 GB, driver 591.86 (32.0.15.9186), Vulkan 1.4.325, Windows Server 2025 10.0.26100, for the three adjacent hardware suites; graphics and the two new copy tests mock Vulkan
  • AI-assisted: yes

Co-Authored-By: Codex noreply@openai.com

@github-actions github-actions Bot added build agc libSceAgc* needs rebase Conflicts with main, rebase needed labels Oct 15, 2026
@fdfawef324
fdfawef324 force-pushed the codex/copy-transfer-budget-current-1015 branch from 72ecb87 to fb4bf56 Compare October 15, 2026 12:05
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 15, 2026
@fdfawef324

Copy link
Copy Markdown
Contributor Author

Rebased onto main 341613ab6 to 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 of agc_driver_graphics_tests and agc_driver_recorder_tests pass; 41 of them ran on the RTX 3060. Reverting both charges makes both new tests fail. The Tested section is updated.

AI-assisted: yes

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6636 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp L4456
PR 6973 core/libs/prx/libSceAgcDriver/CMakeLists.txt L1890
PR 6987 core/libs/prx/libSceAgcDriver/CMakeLists.txt L1890
PR 6989 core/libs/prx/libSceAgcDriver/CMakeLists.txt L1890
PR 6995 core/libs/prx/libSceAgcDriver/CMakeLists.txt L1890

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.

Pull request Shared files not compared
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 1324 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5441 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5500 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6177 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6194 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6218 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6312 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6360 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6414 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6447 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6454 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6472 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6486 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6529 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6548 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6563 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6606 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6683 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6701 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6856 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6941 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6963 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6970 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6971 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6972 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7002 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7332 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7615 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7644 core/libs/prx/libSceAgcDriver/CMakeLists.txt

@fdfawef324

Copy link
Copy Markdown
Contributor Author

Rebased onto main at c842491: head is now bc07087; the one conflict was in the main() dispatch of tests/Graphics.cpp, where --pipeline-journal landed 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_bytes and agc_recorder_kept_bytes pass 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_layers and agc_driver_recorded_kept_bytes pass (4 of 4).

AI-assisted: yes

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 16, 2026
@adriadam10 adriadam10 self-assigned this Oct 18, 2026
Charge read-only GPU-copy input snapshots and depth-copy linear scratch for their requested bytes while the batch retains them. Exercise both production paths with CPU Vulkan mocks, including the budget boundary and fence-governed resource retention.

Co-Authored-By: Codex <noreply@openai.com>
@fdfawef324
fdfawef324 force-pushed the codex/copy-transfer-budget-current-1015 branch from bc07087 to ea02128 Compare October 18, 2026 22:55
@fdfawef324

Copy link
Copy Markdown
Contributor Author

Rebased onto main f3059421f; new head ea02128b5b2f. 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 mock graphics. 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 fc623324a checked 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

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 18, 2026
@adriadam10
adriadam10 merged commit 58242e7 into boykopovar:main Oct 18, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants