gpu: bound two diagnostic maps and keep GPU-written copies while mapped (from upstream 627da77) #71
No reviewers
Labels
No labels
accessibility
amd
bug
crash
device-removed
documentation
duplicate
enhancement
feature-request
good first issue
help wanted
input
invalid
launcher
memory
needs-logs
nvidia
off-topic
performance
question
shaders
stutter
visuals
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/VGLALALA--ReVictory-RDNA3!71
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-71"
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?
@Kal0s-design on GitHub · 2026-12-05 20:05 UTC · original
Kal0s-design:port/leak-fixes→main· +165 −19 · 3 files · 2 commits · merged 2026-12-05 22:28 UTCTwo pieces of upstream ReVIctory's 627da77 ("GPU timestamp profiler, VRAM/RAM leak fixes, and watch/descriptor optimizations"), split out from it with the author kept. I took only the memory parts that stand on their own, not the profiler or the optimizations.
The first bounds two diagnostic maps that grew with play time. The texlate map of textures viewed from a level other than 0 only stopped at 2^20 entries and never dropped any; now it holds 16,384, prunes the ones older than 60 s when full and refuses new ones if none are stale, with the drops counted on the texlate line. The HERO LEAD map (HOST_WRITTEN_AT) kept being fed after its 200-warning cap had silenced it; now it's cleared and stops growing at the cap, and lookups skip the lock while it's empty.
The second is a correctness fix that sits in the same eviction code. Idle eviction (let_go_idle for loose windows, evict_exact_shard for exact copies) could drop a copy that is GPU-only or was written by shaders while its title address is still mapped. Those writes are never copied back to title memory, so remaking the copy from the CPU side later would lose them. Such copies are kept now until the title unmaps the memory, after which eviction goes on as before. This one holds memory a little longer rather than freeing it.
For #11's RAM and VRAM growth this is at best a part of it. I can show the maps stay bounded in the tests, not that the growth reported there comes from them.
Clippy -D warnings is clean in both of the Lint workflow's runs and victory-gpu passes (704, 44 ignored as on main), including the three new tests partly_is_bounded_and_prunes_only_stale, hero_lead_map_clears_and_stops_growing_after_cap and mapped_idle_eviction_never_drops_gpu_written_shadows.
AI-assisted: yes
🤖 Generated with Claude Code
85151b5a01to944b06f8cb