Repository navigation
Conversation
|
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
The formula has a composition gap with #6194. It subtracts the actual sampled plus cached-storage bytes from reported heap usage, then reserves only StorageTextureBudget(...). If #6194 grows the storage cache above that fixed value, the excess storage bytes disappear from both terms, so this sampled budget stays too high by the growth amount. Re-reading the heap budget does not correct it: the actual cache bytes are subtracted again while the reserve remains fixed. That can let the sampled and storage caches collectively consume more than the available budget.
Could the sampled budget reserve the greater of the base storage budget and actual cached storage bytes (or otherwise account for #6194's dynamic storage budget), with a regression covering a storage cache above the base budget? The PR description already calls out this interaction, so documenting it as debt leaves the combined behavior knowingly overcommitted.
…an eighth, from the sampled budget The sampled texture cache got what the heap budget left after other usage, the storage cache's static quarter of the heap and an eighth of the heap budget. On a 24 GB card that kept about 8.8 GB back while one draw of Ghost of Yotei binds 33,677 textures (about 8.4 GB) through a 6.2 GB cache, so about 8k of them were made again on every frame. The reserve is now the storage cache's own budget, the sampled textures held outside the cache, and a thirty-second of the heap budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d its budget Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6b42d9f to
9dc2c12
Compare
|
Thanks, fixed in 9dc2c12. The regression in
The signature changed, so #6194's On 🤖 Generated with Claude Code |
|
Data point from a CPU-bound scene on Windows: RTX 3060 12 GB (NVIDIA 617.42), i5-12400F, Windows 10 19045, MinGW GCC Release. Minecraft Dungeons II (PPSA16064 01.100.100), title screen, no input, 200 s rows,
Flat within the run-to-run spread (about ±1.5 % here), 0 fatal. A 12 GB card at a title screen doesn't press on the sampled or storage budgets, so this is only a no-regression check; I'll repeat it on my RTX 4060 8 GB in a world load, where the budgets are what decides placements. AI-assisted: yes (Claude Code) |
|
Closing this one. #7071 on main now sizes the storage budget against the sampled side, and the reservation this PR changed no longer fits with it: with both in, the two budgets push each other down until storage sits at its 512 MiB floor. I reworked it to reserve the storage cache's fixed cap, AI-assisted: yes (Claude Code) |
…texture budget The service evicted idle entries above a budget fixed at device creation (half the sampled budget then: 4,158 MiB on the 16 GB card). In long5 at the intro (frame 840) pinned reached it while 97 tables (1.0M records) were primed: 286,325 entries were evicted down to 3/4, the next serves re-primed them (primer 44.6 s, serve 60.8 s). By then the texture budgets had moved too (share 7.3 GB, sampled budget 5.0 GB). Unless APS5_BINDLESS_BUDGET_MIB forces a size, the budget is now read at each present from the texture caches' budgets: the share of the VRAM that sampled textures may take (target less the storage reserve). The service's textures are sampled textures, counted there already: in the cache (in use, never evicted) or outside it (SampledTextureMemory), so boykopovar#6492/boykopovar#6783's accounting (sets holding released textures dropped, textures held outside the cache reserved, storage reserved at max(budget, held)) covers them; e0e3c93 has that part. The frame line names the budget; new case in agc_driver_texture_service.
What
SampledTextureBudgetgave the sampled texture cache whatVK_EXT_memory_budgetleft on the device-local heap. It subtracted the memory used outside sampled textures and cached storage images, the storage cache's static quarter of the heap (TextureCacheBudget) and an eighth of the heap budget. On a 24 GB card that held back about 8.8 GB. Ghost of Yōtei's tree scene has one draw that binds 33,677 textures (about 8.4 GB) through a cache of about 6.2 GB. So about 8k of them were refused and made again on every frame, and that draw took 9–10 s.The reserve is now:
StorageTextureBudget, instead of the static quarter) and the storage images it holds, so a storage budget grown pastStorageTextureBudget(fix(agc): grow the storage cache budget while it evicts under pressure #6194) is reserved once the cache fills it;SampledTextureBudgetnow takes the sampled and the cached storage bytes separately.Graphics.cppandSampledCacheBudget.cppexpectations follow the new formula, with cases for:Measured
Ghost of Yōtei (PPSA26344), RTX 4090 (driver 617.42), Windows 11, warm shader cache, same local integration tree (main 0dab493 + #5815 #5781 #5405 #6402 #6174 #6492 + local patches). run172's tree is run165's plus this commit and three local ones: a pad-input polling change, and a debug knob that forces the sampled budget plus its logging, which was unset in run172. run165 held Cross from frame 866 to get past the menus, and run172 tapped it. Values come from the
[gpu] sampled texture cache budgetlines (device-local heap 0,VK_EXT_memory_budgetbudget about 22.9–23.1 GB) and from[resources] images tookfor draws with at least 33,000 textures.run172 was measured before the storage-bytes fix (9dc2c12). On
mainthe storage cache stays withinStorageTextureBudget, except for a single image larger than the budget or a budget that shrinks between inserts, so that fix does not change these numbers and the game was not rerun.Context
APS5_HOST_IMPORT_MIB=16384,APS5_STAGING_POOL_MIB=2048,APS5_PREPARED_SPIRV_MIB=6144andAPS5_NO_SNAPSHOT_CHECK=1.Technical debt
The existing entry "Sampled texture cache budget" in
docs/dev/debt/libSceAgcDriver.mdnow records:Tested
Windows 11 Pro 26200, RTX 4090, driver 617.42. This branch at 9dc2c12 on
main896e1b2:agc_driver_graphics,agc_driver_sampled_cache_budget,agc_driver_sampled_cache_budget_memoryandagc_driver_storage_cache_budget.agc_driver_pixel_ldsfails onmaintoo (vkWaitForFencesreturns 2 after the wave32 bounded case).guest_shader_linktimed out under--parallel 8and in a rerun right afteragc_driver_pixel_lds. Alone it passes three times in 0.01–0.04 s, as it does onmain.misaligned_writer_aheadis not built: main'sGpuIndirectArgumentsMisalignedWriterAhead.cppneeds 65536-byte alignment, which MinGW's object format does not allow.Related
#6194 (@Thunderhawkk) lets the storage cache's budget grow past
StorageTextureBudgetwhile it evicts. This formula reserves the storage images the cache actually holds when they exceedStorageTextureBudget, so with both changes a grown storage cache comes out of the sampled budget instead of its headroom. The signature changed: #6194'sSampledTextureBudget(memory, reported, caches)instorageBudgetCapno longer compiles with this branch and would becomeSampledTextureBudget(memory, reported, sampled, storageCacheBytes()).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)🤖 Generated with Claude Code