One host texture per range: share identical copies, give up placed copies another placement overlaps #356
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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T13:50:22Z.
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.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T13:50:29Z.
/claim
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T13:50:41Z.
Claimed by @m0rff. Open a draft pull request with
Refs #356in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by alicans on 2026-11-27T16:27:57Z.
The world-load run m0rff asked for on #359, on 24 GB (M4 Pro), Series S, budget off,
VICTORY_TRACE_TEXTURE_SYNC=1. The code was main4cf84c83merged with #359 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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T22:51:43Z.
@alicans thank you for the run.
Your run shows that #359'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 #355 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.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-28T00:36:23Z.
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.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-28T10:06:53Z.
A note in case it was missed: #359 (
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 #355 is meant to show where the copies come from. Reopen or leave closed as you prefer.