Repository navigation
perf(agc): keep the buffer pool's free slots by key and retain 4096 - #401
Merged
oneandonlydean merged 1 commit intoOct 4, 2026
Merged
Conversation
Take scanned every retained slot of its tier for one with the same size, usage and memory properties, so the slot bound stayed at 512. With 512 slots GTA V's in-game builds overflowed the small tier: each draw evicted and recreated buffers, and the submission thread spent most of its time in the driver's allocation and free calls. The slots are now kept in lists per key, oldest first: Take pops the newest of its key, eviction takes the oldest front. The bound is 4096 slots per tier, held to a sixth of maxMemoryAllocationCount. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 2, 2026
8 of 9 tasks
oneandonlydean
added a commit
to oneandonlydean/AnyPS5
that referenced
this pull request
Oct 4, 2026
…nd, superseded by upstream boykopovar#401 This reverts commits 421fdc1 (keep the buffer pool's free slots by size class, usage and memory properties, a port of boykopovar#401 without its slot bound) and 718c0f6 (retain up to 4096 pooled buffers per tier). Upstream PR boykopovar#401 (ccb6697) carries both and follows. bufferPoolTests from 421fdc1 stays: it checks the keyed lookup boykopovar#401 implements.
oneandonlydean
added a commit
to oneandonlydean/AnyPS5
that referenced
this pull request
Oct 4, 2026
boykopovar#401 holds the pool's slot bound to a sixth of maxMemoryAllocationCount. The mock context left it 0, so the pool kept one slot and astrobot's bufferPoolTests (two retained buffers of one key) could not pass.
9 tasks done
SP4C3B4R-8
pushed a commit
to SP4C3B4R-8/AnyPS5
that referenced
this pull request
Oct 6, 2026
… memory properties BufferPool::Take scanned every retained slot of its tier for one of the requested size class, usage and memory properties. With about 1,700 small slots in circulation that scan was about 2% of the queue-0 worker on PPSA21564's hub, mostly for the data and fault buffers of address-based draw builds. The free slots are now kept per key, oldest first: Take pops the most recently returned slot of its key, eviction takes the oldest front across the keys, so the least recently used slot is still the one evicted. This is the keyed free list of upstream PR boykopovar#401 without its change to the slot bound.
SP4C3B4R-8
pushed a commit
to SP4C3B4R-8/AnyPS5
that referenced
this pull request
Oct 6, 2026
Takes the 13 gate-batch PRs that merged upstream (boykopovar#319 boykopovar#329 boykopovar#330 boykopovar#331 boykopovar#325 boykopovar#435 boykopovar#471 boykopovar#294 boykopovar#376 boykopovar#404 boykopovar#394 boykopovar#401 boykopovar#446) in place of astrobot's local versions, as integ/gate-batch cab0eab had them: boykopovar#294 and boykopovar#376 in astrobot's depth model (DepthTarget, state.depth), boykopovar#394 with the thick mip tails, boykopovar#401 over astrobot's slab pool, boykopovar#471 keeping the settled single-lane path. Also takes the rest of main since a818bee (boykopovar#532 boykopovar#340 boykopovar#486 boykopovar#484 boykopovar#316 boykopovar#243 boykopovar#334 boykopovar#434 boykopovar#437 boykopovar#470 boykopovar#373 boykopovar#452 boykopovar#455 and our upstreamed PRs, where astrobot keeps its later revisions and env switches). Resolution notes: relinker converter/matcher/tests are upstream's (boykopovar#432 decoder covers VEX RIP-relative followers); RecompileResult gains boykopovar#316's hostSubgroupSize (set from request.target.subgroupSize); shader disk cache format 9; boykopovar#452's scissor message; upstream's later live-stack and memory-copy decode tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mgp3oZvembQziVNE2xARQK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
BufferPool::Takescanned every retained slot of its tier for one with the same size, usage and memory properties. That kept the slot bound at 512 per tier.vkAllocateMemory/vkFreeMemorypairs per second, all on the submission thread.NtGdiDdDDICreateAllocation,DestroyAllocation2andMapGpuVirtualAddress.Takepops the newest slot of its key. Eviction takes the oldest front among the lists, so the least-recently-used order is unchanged.maxMemoryAllocationCountso the three tiers keep half of it free on drivers with a low limit.APS5_BUFFER_POOL_SLOTSstill overrides it. The byte budgets are unchanged.Tested
Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.
APS5_PROFILE_DRAW=1:main,APS5_BUFFER_POOL_SLOTS=512): 2.2 fps. The small tier missed about 58,700 times per 10 s, andGraphics::Drawtook 252 µs per draw packet.Graphics::Drawtook 67 µs per draw packet.main.ctest: all tests pass.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 repositoryBufferPool::Trim, which walks the free slots; whichever of the two merges second needs that loop adapted to the per-key lists.🤖 Generated with Claude Code