perf(agc): sort guest buffer regions through indices before merging them #4248
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4248"
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 hypermoist on 2026-10-12T02:16:20Z.
What
GuestBufferMemory::UploadPreparesorted the build'sRegionobjects themselves by address, then appended them to amergedvector that was never reserved. ARegionholds several vectors and shared pointers (a few hundred bytes), so each resource build moved every region many times through the sort and the reallocations; on Killing Floor 3 (PPSA08427) the sort fell back to its heap phase andUploadPreparewas about a sixth of the queue-0 worker at the title screen.The regions are now sorted through an index array and
mergedis reserved up front, so each region is moved once. The order and the merge are the same: equal begin addresses were unordered before and still are.Tested
Linux (CachyOS, kernel 7.2.9), RTX 3060 (NVIDIA 615.78.08), GCC 16.2.1, Release.
perfon the queue-0 worker at the title screen:UploadPreparewent from 17.4% to 8.8% of its samples, and the title screen from about 26 to 28 presents per 10 s. Measured on a branch based onmainfrom 2026-10-11;UploadPrepare's sort and merge are unchanged on currentmain. The title does not run onmainalone (it stops at a draw with clip distances, #423).agc_driver_graphics,agc_driver_dcc_keys_first_writeandagc_driver_storage_cache_budgetpass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
https://claude.ai/code/session_01Uzy15wqYTt6iWyxYXEzUWo
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T03:52:05Z.
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/Graphics/src/GuestBufferMemory.cppL2760-2763Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-12T04:51:11Z.
Preparing a007 Windows cross-test of your existing commit8083dd11149, author retained, applied cleanly on our experimental runtime-table integration: https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-region-sort-cross-test head908ee2bc431dfa78070e36e01044460e3fcba7e5. Not built or staged yet. After the ongoing range-map baseline, will run graphics/DCC/storage/sparse-buffer native checks and the same warm-cache007 configuration. No competing implementation or current-main mergeability claim. AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-12T05:05:46Z.
Native Windows cross-test on 908ee2bc431dfa78070e36e01044460e3fcba7e5 passed 5/5 in 6.27 s: graphics, DCC keys first write, storage cache budget, driver sparse-buffer holes, and graphics sparse-buffer holes. RTX 5070 Ti, Vulkan required, no skips. This includes our existing sparse-copy/range-map integration; not a current-main-only claim.
No isolated 007 FPS result for this change yet. The preceding game run (without the sorting change staged) progressed beyond the licence screen and then hit the known #423 clip-distance export stop, so that integration is next before the next game run. Your change remains author-preserved and no competing PR is proposed.
AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-12T21:56:55Z.
Re-cross-test on the newer 007 recovery/fiber/key-reservation stack: your exact8083dd11149 author-preserved, integration e8cc22c7b (https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-key-and-region-sort), one production file changed relative to163f0b856. Windows/RTX5070Ti/GCC15.2 Release: full mocked agc_driver_graphics PASS5.52s; native agc_driver_dcc_keys_first_write PASS0.59s and agc_driver_storage_cache_budget PASS0.39s, neither skipped. The latter two initially were not built; after building them, both pass. Clean diff-check. This is the experimental integration, not current-main-only validation.
Game comparison has started normal warm-cache/cache16, graphicsFFD11FE14B53708C49F639F3826E31B6CC4CE6BD55AB267CFE07CAE3464C69DD/libc99D37E34. No sampler/profile or concurrent builds/native tests. Prior key-only run163f intentionally ended after~4m37 Resume, slow scene0.24->0.16FPS, unsupported image-table writes/partial output persist; no sorting FPS result yet. AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-12T22:09:10Z.
007 comparison on e8cc22c7b (#4248 on key/recovery/fiber stack) ended intentionally22:07:56.753UTC (
4m23 after Resume22:03:34.078), not a crash. GraphicsFFD11FE1/libc99D37E34/cache16, normal warm cache, no sampler/profile or concurrent builds/native tests. Startup2FPS; slow scene0.43 then0.22->0.15FPS, same bright circles over black. Last private22.766GB/free5.312GB. Image-table deferred write-backs remain unsupported. This single Windows run does not establish a title-level sorting improvement; its native tests pass as reported above.Also found #4206 absent from this current recovery stack, though it was cross-tested on our earlier8c1ed096 stack. Prepared author-preserved fixture/fix port a9454c295 (codex/first-light-key-sort-sparse-holes), not staged. CPU hole/native GPU readback/full mocked graphics pass3/3 in6.01s; verifying production-only negative control next. This fixes recycled sparse-hole bytes, not a claimed cause of the missing scene. Still leaving runtime-table stores/reference-texture fix to SleglJan. AI-assisted: Codex.