One host texture per range: share identical copies, give up placed copies another placement overlaps #359
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS#359
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@m0rff on GitHub · 2026-11-27 13:50 UTC · original
On a 24 GB M4 Pro (Series S, budget off), host texture copies reached 8.5 GB over 1.7 GB of distinct title memory during the world load and stopped it (#301, alicans' third run). Each title key (an object, or a placed address with its description) gets its own copy, even when other keys cover the same memory.
Two changes, stacked on #301:
Proven with unit tests. Needs world runs before it can be judged.
@m0rff on GitHub · 2026-11-27 13:50 UTC · original
/claim
@github-actions[bot] on GitHub · 2026-11-27 13:50 UTC · original
Claimed by @m0rff. Open a draft pull request with
Refs #356in its description within 24 hours, or the claim expires.@alicans on GitHub · 2026-11-27 16:27 UTC · original
The world-load run m0rff asked for on #362, on 24 GB (M4 Pro), Series S, budget off,
VICTORY_TRACE_TEXTURE_SYNC=1. The code was main4cf84c83merged with #362 at69d0038a, so the same as main1ba9f696apart from docs context; it does not have582670f1. My script stopped it at 81 s when free memory fell to 9 %, like the third run on #301 (that one at 127 s).The last trace line before the stop, with the third run in brackets:
Most of the growth came at the end: over the last 8 lines (about one a second) the copies went from 3128 to 7507 MiB while distinct memory went from 1186 to 1566 MiB. No GPU errors; it was still at about 26 fps when stopped.
Is there a trace you'd like on for the next run, for example one that names the formats or views of the new copies?
@m0rff on GitHub · 2026-11-27 22:51 UTC · original
@alicans thank you for the run.
Your run shows that #362's sharing did not reduce the growth. No texture shared an identical copy on any line, so none of the 7507 MiB came from copies that sharing would have removed. The covered give-up freed 236 MiB, while 5750 covered copies were still in use at the end.
Here is what the code says about why sharing found nothing. It applies only when two copies are alive at the same title address with the same description: two resource objects over one address, or a placed view over an object's memory. Two placed copies at one address can never share.
texture_placedreleases the copy of another description at that address before the new one is made, and the same description at the same address is already the same key. Your trace does not split placed copies from objects, so I can't tell from it whether that is what your copies were.For the next run, could you do a world load of the #358 head (
10892d1b, on mainb998bb65) with both of these on, set up as before (Series S, budget off, the same stop script):VICTORY_TRACE_TEXTURE_SYNC=1gives the samehost texture copies: ..line as your run (copies, distinct memory, sharing, covered given up and still in use, made again), so the two runs can be compared line by line.VICTORY_TRACE_TEXTURE_OVERLAP=1addshost texture copies overlap: ..once a second. It answers two things:I'm leaving a trace that names formats and views for later. This one says first which kind of copy the memory goes to. I'm keeping this issue open.
@LakshanSivakumar on GitHub · 2026-11-28 00:36 UTC · original
Thank you for this. It is fixed on main by
55219dfa. I have not checked every case from this report in the game myself, so please retest on maina6a58361and reopen this if you still see it. Closing as fixed.@m0rff on GitHub · 2026-11-28 10:06 UTC · original
A note in case it was missed: #362 (
55219dfa) did not fix the growth in alicans' 24 GB run. No texture shared an identical copy, and copies still reached 7507 MiB over 1566 MiB of distinct title memory before the run was stopped on free memory. I have no newer run, so main may behave differently now. The overlap trace in #358 is meant to show where the copies come from. Reopen or leave closed as you prefer.