fix(agc): free a completed batch's command buffer instead of keeping it #9565

Merged
EagleBearerYS merged 5 commits from upstream-pr/9565 into main 2026-10-30 11:16:35 +00:00
EagleBearerYS commented 2026-10-22 02:28:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T02:28:35Z.


What

The recorder keeps up to 64 completed command buffers for reuse and begins new batches on them. fable-void found that on Windows drivers, a command buffer keeps the host memory of its largest recording until it is freed. Neither the implicit reset at begin nor a releasing reset gives that memory back. So every kept command buffer holds the peak of its own recordings. In one of his title runs, the driver's command arenas grew by 3.4 GiB in 17 s, until the run hit the RAM cap.

This adapts fable-void's dfbbdfdaf4 from his fork (wip/new-gpu-path). His recorder keeps a pool and a spare list per stream, and main has one of each:

  • c6bb8c52bd: Recorder::release frees a batch's command buffer, and every batch allocates its own from the context's pool. The pool then holds only what batches still recording or in flight need. Fences are still kept for reuse. The spare list's comment, which described command buffers being kept, goes with them.
  • 22bf8fcc92 (counter): with APS5_PROFILE_DRAW set, the [recorder] submits line also gives command buffers freed at batch release N, fences kept for reuse N. Without the profile it costs one test of a static const bool.

The cost is one vkAllocateCommandBuffers per batch, where main reused a kept one.

fable-void's own test, idle_command_memory, reads Windows private bytes through a test fixture main doesn't have, so it isn't carried.

Overlap: checked with git merge-tree against every open PR touching these files, on main 8c26eac3cd. Two conflict:

  • #9289 (Celegans12) gives each batch chunk command buffers, keeps idle ones for reuse in Recorder::release, and keeps main's reuse of the batch's own command buffer. The two touch the same lines of release. Composed, the batch's own command buffer is freed and the chunk handling stays as #9289 has it. This PR goes first, as Celegans12 agreed (reply), and #9289 rebases over it (note).
  • #7048 (AlxcBTW) adds a test mode next to this one in tests/Recorder.cpp's main(). Their library changes don't meet: #7048's are in Texture.cpp. Neither needs to wait, and whichever merges second keeps both test modes (note).

Tested

  • Red/green on GitHub's Linux runner (run), on Mesa llvmpipe. agc_recorder_command_buffer_release (new mode --command-buffer-release-only of the recorder tests) counts the recorder's vkAllocateCommandBuffers and vkFreeCommandBuffers calls through a resolver probe, over three completed batches. Each batch must free the command buffer it allocated.
    • Red: with main's code, it fails ×3 with "command buffer release: after 1 completed batches 1 command buffers were allocated and 0 freed (a completed batch kept its command buffer)".
    • Green: it passes ×10, and so do 49 of the other 55 AGC tests of that run; the other 6 skip on llvmpipe, and none fail.
    • The libc and libkernel suites pass.
  • GitHub's Windows runner (same run): it builds, and the libc and libkernel suites pass. It has no Vulkan device, so the recorder tests skip there.
  • Linux, whole tree: both commits are part of a port of twelve of fable-void's fixes, mirrored as CI's Linux job on main cf2c667060: 1812/1818, with the same 6 failures as main.
  • Validation layer, main against this PR (CONTRIBUTING's AGC rule), on one GitHub Linux runner (run). Both runs used VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 and ctest -V, with VK_LOADER_DEBUG=layer to show the layer loading. The device was llvmpipe (LLVM 20.1.2) on Mesa 25.2.8, Ubuntu 24.04.5, Khronos validation layers 1.3.275.
    • Tests: this PR's agc_recorder_command_buffer_release, plus the 56 tests whose build inputs this PR touches, such as agc_storage_write_back, agc_host_import_unmap and agc_pipeline_cache: 57 with this PR and 56 on main, where the new test doesn't exist. On both trees 6 of them skip on llvmpipe, agc_unit_shadow among them, and none fail: main ran its other 50 once and this PR its other 51 three times.
    • The loader inserted the layer 54 times on main and 153 with this PR, and neither log has was not found.
    • Both logs report the same two messages, VUID-VkImageViewCreateInfo-usage-02275 and VUID-vkCmdCopyBuffer-srcBuffer-00118, from tests this PR doesn't change. This PR adds no VUID- message.
  • jotitadev's run (review): Ubuntu 26.04, GCC 15.2.0, this PR's 22bf8fcc9 merged onto main 6ef5a1c4c, ANYPS5_NO_SHADER_CACHE=1.
    • agc_recorder_command_buffer_release passes 3 of 3 on an NVIDIA GeForce RTX 3070 (proprietary driver) and on llvmpipe (LLVM 21.1.8).
    • With Recorder.cpp and Recorder.hpp at main and the test kept, it fails on both devices with the expected message.
    • The recorder and graphics ^agc tests have the same pass set as main on the 3070 (lds_atomics64, driver_flip and display_buffer_dcc left out).
  • Scramblrrrr's Windows run (comment): Windows 11 10.0.26200, NVIDIA GeForce RTX 5070 Ti (617.42), WinLibs GCC 15.2 r7, Release. This PR's 22bf8fcc92 on main 7e2ba73e4 plus other open PRs, with this PR's change the only difference between the two arms.
    • With main's Recorder.cpp and Recorder.hpp and the new test, it fails after batch 1, with 1 command buffer allocated and 0 freed. With this PR it passes.
    • All 74 existing recorder modes pass without this PR, and all 75 with it, in a set of 233 cases: 231 pass and 2 skip as expected.
    • Validation: Khronos layers 1.4.363, loaded and inserted 191 times with this PR, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and ctest -V. Both arms log the same two VUID-VkImageViewCreateInfo-usage-02275 errors, from agc_sampled_storage_base_level_usage. This PR adds no VUID- message.
  • 1da6feaf16, main 4777caca34 merged in (clean; the PR's own diff is unchanged), on GitHub's runners (run): On Linux, agc_recorder_command_buffer_release and 49 of the other 55 AGC tests run with it pass 10 of 10, and 6 skip; none fail. On Windows all 69 build: 3 pass 10 of 10 and the other 66, the new test among them, skip without a Vulkan device. On Linux's one run with main's implementation, agc_recorder_command_buffer_release fails, agc_gpu_timing_complete times out, 48 pass and 6 skip. libkernel's suite passes on both and libc's on Windows. On Linux libc's one failure is precise_wait, a timing test this PR doesn't touch.
  • 3c447086be, main b7d1d47a5f merged in (clean; the PR's own diff is unchanged), on GitHub's runners (run): agc_recorder_command_buffer_release and the AGC tests run with it pass 10 of 10. On Linux that is 56 tests, 6 of them skipped. On Windows all 69 build and pass, and 66 skip without a Vulkan device. On Linux agc_recorder_command_buffer_release fails with main's implementation. The libc and libkernel suites pass on both runners. The libc and libkernel suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • check_conventions.py passes, with no comment lines added.
  • Resident Evil Village (PPSA01556), 5 minutes at the static main menu, on the RTX 3070 Laptop GPU (NVIDIA 617.42, Windows 11), on a local tree with this PR and our other two ports of fable-void's shared fixes, with APS5_PROFILE_DRAW=1; no fatal error. The last [recorder] line reads submits 44845, ... command buffers freed at batch release 44844, fences kept for reuse 44844, so the release path runs for every batch in this title.
  • Not measured: the memory this saves on Windows. The Resident Evil Village pair run didn't use a matching control, so it gives no memory figure, and this PR makes no claim about the size of the saving. The counter above shows the path runs for every batch.
  • 3629538bc0, a merge of main f3eb573e6f (run). The one conflict was the Windows set_tests_properties list in core/libs/prx/libSceAgcDriver/CMakeLists.txt, where Astronaut10's #11696 adds agc_repeat_storage_guard and this PR adds agc_recorder_command_buffer_release; the merge keeps both. This PR's other changed lines are the same. On Linux, agc_recorder_command_buffer_release fails with main's code and passes 10 runs in a row with the change, run with the recorder and AGC tests that share its executable and #11696's agc_repeat_storage_guard. Linux: 75 run, 68 pass, 7 skip, 0 fail; the skips (agc_driver_unit_shadow, agc_driver_unit_shadow_budget, agc_import_settle_initial_dcc, agc_pipeline_cache_file, agc_shadowed_key_stores, agc_storage_clear_hand_over and agc_unit_shadow) skip with main's code too. Windows: 91 run, 4 pass, 87 skip (the Vulkan device tests), 0 fail. Suites: libc and libkernel pass on Linux (171 and 289). On Windows libc passes (199), and libkernel passes 309 of 312: exec_arguments, guest_timed_join_import_libkernel_sys and guest_timed_join_import_libkernel_web fail at their setup in the verify's Windows build (FileNotFoundError starting the title, or copying the libraries they load), with main's code too, and pass in main's own Windows job at 1829def9bf (job). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.

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 (merges before #9289, agreed in its thread; no order with #7048; see Overlap)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: Mesa llvmpipe (LLVM 20.1.2), Ubuntu 24.04, GitHub's Linux runner, with the validation comparison (Mesa 25.2.8); NVIDIA GeForce RTX 3070 (proprietary driver) and llvmpipe (LLVM 21.1.8), Ubuntu 26.04, in jotitadev's run. NVIDIA GeForce RTX 5070 Ti (617.42), Windows 11, in Scramblrrrr's run. GitHub's Windows runner has no Vulkan device.
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4961183328 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9565). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-22T02:28:35Z. --- ### What The recorder keeps up to 64 completed command buffers for reuse and begins new batches on them. fable-void found that on Windows drivers, a command buffer keeps the host memory of its largest recording until it is freed. Neither the implicit reset at begin nor a releasing reset gives that memory back. So every kept command buffer holds the peak of its own recordings. In one of his title runs, the driver's command arenas grew by 3.4 GiB in 17 s, until the run hit the RAM cap. This adapts fable-void's dfbbdfdaf4 from his fork ([`wip/new-gpu-path`](https://github.com/fable-void/AnyPS5/tree/wip/new-gpu-path)). His recorder keeps a pool and a spare list per stream, and `main` has one of each: - **c6bb8c52bd:** `Recorder::release` frees a batch's command buffer, and every batch allocates its own from the context's pool. The pool then holds only what batches still recording or in flight need. Fences are still kept for reuse. The spare list's comment, which described command buffers being kept, goes with them. - **22bf8fcc92 (counter):** with `APS5_PROFILE_DRAW` set, the `[recorder] submits` line also gives `command buffers freed at batch release N, fences kept for reuse N`. Without the profile it costs one test of a `static const bool`. The cost is one `vkAllocateCommandBuffers` per batch, where `main` reused a kept one. fable-void's own test, `idle_command_memory`, reads Windows private bytes through a test fixture `main` doesn't have, so it isn't carried. **Overlap:** checked with `git merge-tree` against every open PR touching these files, on `main` 8c26eac3cd. Two conflict: - #9289 (Celegans12) gives each batch chunk command buffers, keeps idle ones for reuse in `Recorder::release`, and keeps `main`'s reuse of the batch's own command buffer. The two touch the same lines of `release`. Composed, the batch's own command buffer is freed and the chunk handling stays as #9289 has it. This PR goes first, as Celegans12 agreed ([reply](https://github.com/boykopovar/AnyPS5/pull/9289#issuecomment-6338381661)), and #9289 rebases over it ([note](https://github.com/boykopovar/AnyPS5/pull/9289#issuecomment-6332865473)). - #7048 (AlxcBTW) adds a test mode next to this one in `tests/Recorder.cpp`'s `main()`. Their library changes don't meet: #7048's are in `Texture.cpp`. Neither needs to wait, and whichever merges second keeps both test modes ([note](https://github.com/boykopovar/AnyPS5/pull/7048#issuecomment-6332865820)). ### Tested - **Red/green on GitHub's Linux runner** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39707601451)), on Mesa llvmpipe. `agc_recorder_command_buffer_release` (new mode `--command-buffer-release-only` of the recorder tests) counts the recorder's `vkAllocateCommandBuffers` and `vkFreeCommandBuffers` calls through a resolver probe, over three completed batches. Each batch must free the command buffer it allocated. - Red: with `main`'s code, it fails ×3 with "command buffer release: after 1 completed batches 1 command buffers were allocated and 0 freed (a completed batch kept its command buffer)". - Green: it passes ×10, and so do 49 of the other 55 AGC tests of that run; the other 6 skip on llvmpipe, and none fail. - The libc and libkernel suites pass. - **GitHub's Windows runner** (same run): it builds, and the libc and libkernel suites pass. It has no Vulkan device, so the recorder tests skip there. - **Linux, whole tree:** both commits are part of a port of twelve of fable-void's fixes, mirrored as CI's Linux job on `main` cf2c667060: 1812/1818, with the same 6 failures as `main`. - **Validation layer, `main` against this PR** (CONTRIBUTING's AGC rule), on one GitHub Linux runner ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39730195424)). Both runs used `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1` and `ctest -V`, with `VK_LOADER_DEBUG=layer` to show the layer loading. The device was llvmpipe (LLVM 20.1.2) on Mesa 25.2.8, Ubuntu 24.04.5, Khronos validation layers 1.3.275. - Tests: this PR's `agc_recorder_command_buffer_release`, plus the 56 tests whose build inputs this PR touches, such as `agc_storage_write_back`, `agc_host_import_unmap` and `agc_pipeline_cache`: 57 with this PR and 56 on `main`, where the new test doesn't exist. On both trees 6 of them skip on llvmpipe, `agc_unit_shadow` among them, and none fail: `main` ran its other 50 once and this PR its other 51 three times. - The loader inserted the layer 54 times on `main` and 153 with this PR, and neither log has `was not found`. - Both logs report the same two messages, `VUID-VkImageViewCreateInfo-usage-02275` and `VUID-vkCmdCopyBuffer-srcBuffer-00118`, from tests this PR doesn't change. This PR adds no `VUID-` message. - **jotitadev's run** ([review](https://github.com/boykopovar/AnyPS5/pull/9565#pullrequestreview-5609224664)): Ubuntu 26.04, GCC 15.2.0, this PR's 22bf8fcc9 merged onto `main` 6ef5a1c4c, `ANYPS5_NO_SHADER_CACHE=1`. - `agc_recorder_command_buffer_release` passes 3 of 3 on an NVIDIA GeForce RTX 3070 (proprietary driver) and on llvmpipe (LLVM 21.1.8). - With `Recorder.cpp` and `Recorder.hpp` at `main` and the test kept, it fails on both devices with the expected message. - The recorder and graphics `^agc` tests have the same pass set as `main` on the 3070 (`lds_atomics64`, `driver_flip` and `display_buffer_dcc` left out). - **Scramblrrrr's Windows run** ([comment](https://github.com/boykopovar/AnyPS5/pull/9565#issuecomment-6336724220)): Windows 11 10.0.26200, NVIDIA GeForce RTX 5070 Ti (617.42), WinLibs GCC 15.2 r7, Release. This PR's 22bf8fcc92 on `main` 7e2ba73e4 plus other open PRs, with this PR's change the only difference between the two arms. - With `main`'s `Recorder.cpp` and `Recorder.hpp` and the new test, it fails after batch 1, with 1 command buffer allocated and 0 freed. With this PR it passes. - All 74 existing recorder modes pass without this PR, and all 75 with it, in a set of 233 cases: 231 pass and 2 skip as expected. - Validation: Khronos layers 1.4.363, loaded and inserted 191 times with this PR, with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `ctest -V`. Both arms log the same two `VUID-VkImageViewCreateInfo-usage-02275` errors, from `agc_sampled_storage_base_level_usage`. This PR adds no `VUID-` message. - **1da6feaf16, `main` 4777caca34 merged in** (clean; the PR's own diff is unchanged), on GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39772412815)): On Linux, `agc_recorder_command_buffer_release` and 49 of the other 55 AGC tests run with it pass 10 of 10, and 6 skip; none fail. On Windows all 69 build: 3 pass 10 of 10 and the other 66, the new test among them, skip without a Vulkan device. On Linux's one run with `main`'s implementation, `agc_recorder_command_buffer_release` fails, `agc_gpu_timing_complete` times out, 48 pass and 6 skip. libkernel's suite passes on both and libc's on Windows. On Linux libc's one failure is `precise_wait`, a timing test this PR doesn't touch. - **3c447086be, `main` b7d1d47a5f merged in** (clean; the PR's own diff is unchanged), on GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39796252522)): `agc_recorder_command_buffer_release` and the AGC tests run with it pass 10 of 10. On Linux that is 56 tests, 6 of them skipped. On Windows all 69 build and pass, and 66 skip without a Vulkan device. On Linux `agc_recorder_command_buffer_release` fails with `main`'s implementation. The libc and libkernel suites pass on both runners. The libc and libkernel suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - `check_conventions.py` passes, with no comment lines added. - **Resident Evil Village (PPSA01556), 5 minutes at the static main menu, on the RTX 3070 Laptop GPU (NVIDIA 617.42, Windows 11), on a local tree with this PR and our other two ports of fable-void's shared fixes, with `APS5_PROFILE_DRAW=1`; no fatal error.** The last `[recorder]` line reads `submits 44845, ... command buffers freed at batch release 44844, fences kept for reuse 44844`, so the release path runs for every batch in this title. - Not measured: the memory this saves on Windows. The Resident Evil Village pair run didn't use a matching control, so it gives no memory figure, and this PR makes no claim about the size of the saving. The counter above shows the path runs for every batch. - **3629538bc0, a merge of `main` f3eb573e6f** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40701552517)). The one conflict was the Windows `set_tests_properties` list in `core/libs/prx/libSceAgcDriver/CMakeLists.txt`, where Astronaut10's #11696 adds `agc_repeat_storage_guard` and this PR adds `agc_recorder_command_buffer_release`; the merge keeps both. This PR's other changed lines are the same. On Linux, `agc_recorder_command_buffer_release` fails with `main`'s code and passes 10 runs in a row with the change, run with the recorder and AGC tests that share its executable and #11696's `agc_repeat_storage_guard`. Linux: 75 run, 68 pass, 7 skip, 0 fail; the skips (`agc_driver_unit_shadow`, `agc_driver_unit_shadow_budget`, `agc_import_settle_initial_dcc`, `agc_pipeline_cache_file`, `agc_shadowed_key_stores`, `agc_storage_clear_hand_over` and `agc_unit_shadow`) skip with `main`'s code too. Windows: 91 run, 4 pass, 87 skip (the Vulkan device tests), 0 fail. Suites: libc and libkernel pass on Linux (171 and 289). On Windows libc passes (199), and libkernel passes 309 of 312: `exec_arguments`, `guest_timed_join_import_libkernel_sys` and `guest_timed_join_import_libkernel_web` fail at their setup in the verify's Windows build (`FileNotFoundError` starting the title, or copying the libraries they load), with `main`'s code too, and pass in `main`'s own Windows job at 1829def9bf ([job](https://github.com/boykopovar/AnyPS5/actions/runs/40627345977/job/122615375186)). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none (merges before #9289, agreed in its thread; no order with #7048; see Overlap) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: Mesa llvmpipe (LLVM 20.1.2), Ubuntu 24.04, GitHub's Linux runner, with the validation comparison (Mesa 25.2.8); NVIDIA GeForce RTX 3070 (proprietary driver) and llvmpipe (LLVM 21.1.8), Ubuntu 26.04, in jotitadev's run. NVIDIA GeForce RTX 5070 Ti (617.42), Windows 11, in Scramblrrrr's run. GitHub's Windows runner has no Vulkan device. - [x] AI-assisted: yes
MarcZX10 commented 2026-10-22 04:00:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T04:00:39Z.


Early review feedback while this remains a draft: the Linux red/green allocation probe gives useful evidence that completed batches free their command buffers, and the change is scoped to the recorder. Before marking this ready, please resolve the listed overlap with #9289 in Recorder::release and #7048 in tests/Recorder.cpp with the affected authors; add Depends on where an agreed order is required and retain both PRs’ behavior/tests. The repo’s AGC rule also requires a same-machine, same-GPU focused main/change run with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and the Khronos validation layer, confirming it loaded and comparing VUIDs. The current report has a Linux llvmpipe regression test but no such paired validation run, and it says the Windows memory measurement is still pending. I did not run tests locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6332354014 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9565#issuecomment-6332354014). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T04:00:39Z. --- Early review feedback while this remains a draft: the Linux red/green allocation probe gives useful evidence that completed batches free their command buffers, and the change is scoped to the recorder. Before marking this ready, please resolve the listed overlap with #9289 in `Recorder::release` and #7048 in `tests/Recorder.cpp` with the affected authors; add `Depends on` where an agreed order is required and retain both PRs’ behavior/tests. The repo’s AGC rule also requires a same-machine, same-GPU focused main/change run with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and the Khronos validation layer, confirming it loaded and comparing VUIDs. The current report has a Linux llvmpipe regression test but no such paired validation run, and it says the Windows memory measurement is still pending. I did not run tests locally.
jotitadev commented 2026-10-22 04:21:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-22T04:21:26Z.

Review: COMMENTED


Ran this on real hardware (Linux, NVIDIA and lavapipe). Head 22bf8fcc9, merged onto origin/main at 6ef5a1c4c.

Machine: Ubuntu 26.04, GCC 15.2.0, ninja -j3, ANYPS5_NO_SHADER_CACHE=1, device picked with VK_ICD_FILENAMES.

agc_recorder_command_buffer_release (the new --command-buffer-release-only case), ctest --repeat until-fail:3:

device result
NVIDIA GeForce RTX 3070 Passed (3/3)
llvmpipe (lavapipe, LLVM 21.1.8) Passed (3/3)

Negative control: reverting Recorder.cpp/Recorder.hpp to origin/main and keeping only the test + its add_test makes it fail on both devices with the expected message, so the test is a genuine red→green guard:

AGC graphics: command buffer release: after 1 completed batches 1 command buffers were allocated and 0 freed (a completed batch kept its command buffer)

No regression in the recorder/graphics ^agc suite versus origin/main on the RTX 3070 (same pass set; lds_atomics64/driver_flip/display_buffer_dcc excluded).

GPUs tested: NVIDIA GeForce RTX 3070 (proprietary), llvmpipe/lavapipe (Mesa, software).

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5609224664 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9565#pullrequestreview-5609224664). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-22T04:21:26Z. **Review:** COMMENTED --- Ran this on real hardware (Linux, NVIDIA and lavapipe). Head `22bf8fcc9`, merged onto `origin/main` at `6ef5a1c4c`. Machine: Ubuntu 26.04, GCC 15.2.0, `ninja -j3`, `ANYPS5_NO_SHADER_CACHE=1`, device picked with `VK_ICD_FILENAMES`. `agc_recorder_command_buffer_release` (the new `--command-buffer-release-only` case), `ctest --repeat until-fail:3`: | device | result | | --- | --- | | NVIDIA GeForce RTX 3070 | Passed (3/3) | | llvmpipe (lavapipe, LLVM 21.1.8) | Passed (3/3) | Negative control: reverting `Recorder.cpp`/`Recorder.hpp` to `origin/main` and keeping only the test + its `add_test` makes it fail on both devices with the expected message, so the test is a genuine red→green guard: ``` AGC graphics: command buffer release: after 1 completed batches 1 command buffers were allocated and 0 freed (a completed batch kept its command buffer) ``` No regression in the recorder/graphics `^agc` suite versus `origin/main` on the RTX 3070 (same pass set; `lds_atomics64`/`driver_flip`/`display_buffer_dcc` excluded). GPUs tested: NVIDIA GeForce RTX 3070 (proprietary), llvmpipe/lavapipe (Mesa, software). Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
EagleBearerYS commented 2026-10-22 06:40:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T06:40:25Z.


@jotitadev thanks for running it on the RTX 3070 and lavapipe, with the negative control and the ^agc comparison. It's in Tested now, and the 3070 is on the GPUs tested line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6334500720 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9565#issuecomment-6334500720). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-22T06:40:25Z. --- @jotitadev thanks for running it on the RTX 3070 and lavapipe, with the negative control and the `^agc` comparison. It's in Tested now, and the 3070 is on the GPUs tested line.
Scramblrrrr commented 2026-10-22 08:50:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-22T08:50:47Z.


Windows native cross-test of22bf8fcc92 completed on c91598099b3d. Baseline62cf2d1a04 is current main7e2ba73e4 plus our #9591/#6918 prerequisites and #9652; the memory change is the only difference between these recorder arms. All authors' commits retained:
https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-oct22-join-memory

Windows11 10.0.26200, RTX5070Ti/NVIDIA617.42, Ryzen7800X3D, WinLibs GCC15.2r7 Release, SPIRV Tools OFF:

  • All74 existing recorder modes pass on the baseline,29.28s.
  • Built your new fixture against unchanged baseline production Recorder.cpp/hpp (verified hashes): it fails after batch1, allocated1/freed0. Same fixture source with the candidate passes (0.251746s). Temporary fixture changes restored before switching to the clean candidate.
  • Candidate gate233 unique cases:231PASS +2expected skips,91.87s; includes all75 recorder modes, zero recorder skips/failures, plus the broader existing graphics/shader/HLE selection.
  • Actual Khronos1.4.363 layer loaded (candidate191instance insertions), ANYPS5_REQUIRE_VULKAN=1 / ANYPS5_NO_SHADER_CACHE=1 / ctest -V. No missing-layer errors. Both baseline and candidate have exactly the same two validation errors: VUID-VkImageViewCreateInfo-usage-02275 from agc_sampled_storage_base_level_usage. No new VUIDs;00118 is absent with #7961 now upstream.

Clean final packaging and all369 runtime-module SHA256 values verified before staging. A combined007 loading probe has just started with the same28GiB private/2GiB free guard. No isolated Windows memory saving claimed yet: this title run also carries #9652, and its prior large pipeline was not completely warmed. I will report observed private memory and your freed-buffer counter without attributing an unpaired saving. Raw title data stays local. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336724220 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9565#issuecomment-6336724220). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-22T08:50:47Z. --- Windows native cross-test of22bf8fcc92 completed on c91598099b3d. Baseline62cf2d1a04 is current main7e2ba73e4 plus our #9591/#6918 prerequisites and #9652; the memory change is the only difference between these recorder arms. All authors' commits retained: https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-oct22-join-memory Windows11 10.0.26200, RTX5070Ti/NVIDIA617.42, Ryzen7800X3D, WinLibs GCC15.2r7 Release, SPIRV Tools OFF: - All74 existing recorder modes pass on the baseline,29.28s. - Built your new fixture against unchanged baseline production Recorder.cpp/hpp (verified hashes): it fails after batch1, allocated1/freed0. Same fixture source with the candidate passes (0.251746s). Temporary fixture changes restored before switching to the clean candidate. - Candidate gate233 unique cases:231PASS +2expected skips,91.87s; includes all75 recorder modes, zero recorder skips/failures, plus the broader existing graphics/shader/HLE selection. - Actual Khronos1.4.363 layer loaded (candidate191instance insertions), ANYPS5_REQUIRE_VULKAN=1 / ANYPS5_NO_SHADER_CACHE=1 / ctest -V. No missing-layer errors. Both baseline and candidate have exactly the same two validation errors: VUID-VkImageViewCreateInfo-usage-02275 from agc_sampled_storage_base_level_usage. No new VUIDs;00118 is absent with #7961 now upstream. Clean final packaging and all369 runtime-module SHA256 values verified before staging. A combined007 loading probe has just started with the same28GiB private/2GiB free guard. No isolated Windows memory saving claimed yet: this title run also carries #9652, and its prior large pipeline was not completely warmed. I will report observed private memory and your freed-buffer counter without attributing an unpaired saving. Raw title data stays local. AI-assisted: Codex.
Scramblrrrr commented 2026-10-22 08:55:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-22T08:55:22Z.


Correction to the title-run status above: c915's first007 launch aborted after about29s with VOP2 opcode is not implemented (std::invalid_argument), well below the RAM cap. It is not a Windows memory-saving result. Native results stand unchanged.

I am separating the changes: isolated memory headc4162b2156b8 differs from c915 only by retaining the old joinedRun predicate, plus removing #9652's added fixture assertion. Rebuilt successfully, same recorder/import native gate is running before its title control. No attribution to #9565 yet. The other author's coordination thread has the exact heads:
https://github.com/boykopovar/AnyPS5/pull/9652#issuecomment-6336788980
AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336809843 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9565#issuecomment-6336809843). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-22T08:55:22Z. --- Correction to the title-run status above: c915's first007 launch aborted after about29s with `VOP2 opcode is not implemented` (std::invalid_argument), well below the RAM cap. It is not a Windows memory-saving result. Native results stand unchanged. I am separating the changes: isolated memory headc4162b2156b8 differs from c915 only by retaining the old joinedRun predicate, plus removing #9652's added fixture assertion. Rebuilt successfully, same recorder/import native gate is running before its title control. No attribution to #9565 yet. The other author's coordination thread has the exact heads: https://github.com/boykopovar/AnyPS5/pull/9652#issuecomment-6336788980 AI-assisted: Codex.
EagleBearerYS commented 2026-10-22 08:56:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T08:56:37Z.


@Scramblrrrr thanks for the Windows run on the RTX 5070 Ti, with the red control against main's recorder and the validation comparison. It's this case's first run on a Windows GPU, and it's in Tested and on the GPUs tested line now. Thanks too for keeping the title runs apart until the memory arms are isolated.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336832365 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9565#issuecomment-6336832365). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-22T08:56:37Z. --- @Scramblrrrr thanks for the Windows run on the RTX 5070 Ti, with the red control against `main`'s recorder and the validation comparison. It's this case's first run on a Windows GPU, and it's in Tested and on the GPUs tested line now. Thanks too for keeping the title runs apart until the memory arms are isolated.
Scramblrrrr commented 2026-10-22 09:19:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-22T09:19:54Z.


Isolated #9565 control c4162b2156b8 reached the correctly rendered offline007 menu and did not reproduce c915's VOP2 startup abort during its17-minute run. Menu78/62.137794s=1.25527FPS, GPU196.17083ms/present, effectively unchanged versus b36's1.22951FPS. Freed-command-buffer counter was active. This is one run, not sufficient to attribute the combined build's early failure.

Resume09:13:12.714UTC; the game then logged a RenderThread access violation reading0xffffffffffffffff at the previously discussed terrain/quadtree site. The guard terminated it at09:14:29.572UTC,76.858s after input, while the fatal report was being written. It was NOT the28GiBprivate cap: last private23,834,996,736bytes. Free memory fell from~5.3GB just after a trim to166MB at the final sample; the causal ownership of that late drop is unverified. The guest fault is present before guard termination, so this must not be reported as a pure memory-guard exit or a completed gameplay pass.

No isolated Windows RAM-saving claim from this pair. The five-frame menu trace has no dropped events: p50803.7ms/GPU196.0ms, queue0~748.6ms busy per frame, other queues mostly waiting. Next controlled work is #8887; runtime remains c416, no opcode/guest-title bypass. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337280392 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9565#issuecomment-6337280392). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-22T09:19:54Z. --- Isolated #9565 control c4162b2156b8 reached the correctly rendered offline007 menu and did not reproduce c915's VOP2 startup abort during its17-minute run. Menu78/62.137794s=1.25527FPS, GPU196.17083ms/present, effectively unchanged versus b36's1.22951FPS. Freed-command-buffer counter was active. This is one run, not sufficient to attribute the combined build's early failure. Resume09:13:12.714UTC; the game then logged a RenderThread access violation reading0xffffffffffffffff at the previously discussed terrain/quadtree site. The guard terminated it at09:14:29.572UTC,76.858s after input, while the fatal report was being written. It was NOT the28GiBprivate cap: last private23,834,996,736bytes. Free memory fell from~5.3GB just after a trim to166MB at the final sample; the causal ownership of that late drop is unverified. The guest fault is present before guard termination, so this must not be reported as a pure memory-guard exit or a completed gameplay pass. No isolated Windows RAM-saving claim from this pair. The five-frame menu trace has no dropped events: p50803.7ms/GPU196.0ms, queue0~748.6ms busy per frame, other queues mostly waiting. Next controlled work is #8887; runtime remains c416, no opcode/guest-title bypass. AI-assisted: Codex.
EagleBearerYS commented 2026-10-22 12:06:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T12:06:12Z.


Thanks, @MarcZX10. The branch now has main at 4777caca34 merged in (1da6feaf16), with the PR's own diff unchanged. On GitHub's runners (run), agc_recorder_command_buffer_release and the other recorder tests pass 10 of 10 on both, and the set fails with main's implementation on Linux. It's in Tested.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6340316308 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9565#issuecomment-6340316308). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-22T12:06:12Z. --- Thanks, @MarcZX10. The branch now has `main` at 4777caca34 merged in (1da6feaf16), with the PR's own diff unchanged. On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39772412815)), `agc_recorder_command_buffer_release` and the other recorder tests pass 10 of 10 on both, and the set fails with `main`'s implementation on Linux. It's in Tested.
MarcZX10 commented 2026-10-22 14:25:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T14:25:31Z.

Review: CHANGES_REQUESTED


The updated head 1da6feaf1699ecdaaee9eaa1a124cf22466edafc has strong red/green evidence: the new resolver-probe test fails against main and passes with the implementation, repeated on llvmpipe, RTX 3070 and RTX 5070 Ti; the paired validation-layer comparisons report no new VUIDs. Hosted eligibility, conventions, labels and report pass; product and relinker jobs are skipped. I did not run a local GPU build.

I refreshed upstream/main to 329efe1bfdaff116c57cdf62718026ee4f5521ae. This head is 3 ahead / 45 behind (merge base 4777caca343bf09a3fe245830acd9e9f433e8e18); current-base merge-tree, diff-check and conventions pass. The intervening main changes do not touch this PR’s recorder implementation, test or CMake registration. Please bring the branch up to current main and rerun the focused command-buffer-release recorder case before merge, per the branch rule.

The current #9289 head 2f412bb25fd3c389381ad6cac1cabda75137438c includes the #9176 → #9287 stack, but it does not contain this PR’s latest head; the current pairwise merge-tree still conflicts in Graphics/src/Recorder.cpp. The stated order is #9565 first, then #9289 rebases. Please ensure #9289 is rebased over the merged #9565 head and the combined recorder tests are run before that stacked change merges. This is an integration follow-up, not a new defect in this PR’s isolated fix.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5615800051 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9565#pullrequestreview-5615800051). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T14:25:31Z. **Review:** CHANGES_REQUESTED --- The updated head `1da6feaf1699ecdaaee9eaa1a124cf22466edafc` has strong red/green evidence: the new resolver-probe test fails against main and passes with the implementation, repeated on llvmpipe, RTX 3070 and RTX 5070 Ti; the paired validation-layer comparisons report no new VUIDs. Hosted eligibility, conventions, labels and report pass; product and relinker jobs are skipped. I did not run a local GPU build. I refreshed upstream/main to `329efe1bfdaff116c57cdf62718026ee4f5521ae`. This head is 3 ahead / 45 behind (merge base `4777caca343bf09a3fe245830acd9e9f433e8e18`); current-base merge-tree, diff-check and conventions pass. The intervening main changes do not touch this PR’s recorder implementation, test or CMake registration. Please bring the branch up to current main and rerun the focused command-buffer-release recorder case before merge, per the branch rule. The current #9289 head `2f412bb25fd3c389381ad6cac1cabda75137438c` includes the #9176 → #9287 stack, but it does not contain this PR’s latest head; the current pairwise merge-tree still conflicts in `Graphics/src/Recorder.cpp`. The stated order is #9565 first, then #9289 rebases. Please ensure #9289 is rebased over the merged #9565 head and the combined recorder tests are run before that stacked change merges. This is an integration follow-up, not a new defect in this PR’s isolated fix.
EagleBearerYS commented 2026-10-22 15:08:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T15:08:04Z.


Thanks, @MarcZX10. main at b7d1d47a5f is now merged in (3c447086be), and the PR's own diff is unchanged. On GitHub's runners (run), agc_recorder_command_buffer_release passes 10 of 10 on Linux, along with the other AGC tests in that run, and fails there with main's implementation. On Windows they build and pass, with the tests that need a Vulkan device skipping. It's in Tested. The combined recorder tests with #9289 come after this PR merges, when #9289 rebases over it, in the order agreed in its thread.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6344090028 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9565#issuecomment-6344090028). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-22T15:08:04Z. --- Thanks, @MarcZX10. `main` at b7d1d47a5f is now merged in (3c447086be), and the PR's own diff is unchanged. On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39796252522)), `agc_recorder_command_buffer_release` passes 10 of 10 on Linux, along with the other AGC tests in that run, and fails there with `main`'s implementation. On Windows they build and pass, with the tests that need a Vulkan device skipping. It's in Tested. The combined recorder tests with #9289 come after this PR merges, when #9289 rebases over it, in the order agreed in [its thread](https://github.com/boykopovar/AnyPS5/pull/9289#issuecomment-6338381661).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!9565
No description provided.