gpu: bound two diagnostic maps and keep GPU-written copies while mapped (from upstream 627da77) #71

Manually merged
github merged 2 commits from github-bot/gh-71 into gh-pr/71/base 2026-12-06 00:43:35 +00:00 AGit
Owner

@⁠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 UTC

Two 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

**@⁠Kal0s-design** on GitHub · 2026-12-05 20:05 UTC · [original](https://github.com/VGLALALA/ReVictory-RDNA3/pull/71) `Kal0s-design:port/leak-fixes` → `main` · +165 −19 · 3 files · 2 commits · merged 2026-12-05 22:28 UTC Two 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](https://claude.com/claude-code)
Idle eviction (let_go_idle for LOOSE windows, evict_exact_shard for
EXACT copies) no longer drops a copy that is GPU-only or was written by
shaders while its title address is still committed: those writes are
never copied back to title memory, so remaking the copy from the CPU
side would lose them. Once the title unmaps the memory, eviction goes
on as before. Adds mapped_idle_eviction_never_drops_gpu_written_shadows.

(part of upstream 627da77)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
texlate: the map of textures viewed from a level other than 0 is capped
at 16384 entries; when full, entries older than 60 s are pruned and
new ones are refused if none are stale. Drops are counted on the
texlate line.

texture: HOST_WRITTEN_AT (HERO LEAD diagnostics) stops being fed once
the 200-warning cap is reached and is cleared then; lookups and
forget() skip the lock while the map is empty.

Adds partly_is_bounded_and_prunes_only_stale and
hero_lead_map_clears_and_stops_growing_after_cap.

(part of upstream 627da77)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 20:09:13 +00:00
github-bot force-pushed github-bot/gh-71 from 85151b5a01 to 944b06f8cb 2026-12-05 21:27:45 +00:00 Compare
github-bot changed target branch from main to gh-pr/71/base 2026-12-05 22:32:12 +00:00
github manually merged commit 944b06f8cb into gh-pr/71/base 2026-12-06 00:43:35 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.