Trace how host texture copies overlap: identical vs different layouts, and how often a range changes owner #352

Open
opened 2026-11-27 13:45:10 +00:00 by m0rff · 2 comments
m0rff commented 2026-11-27 13:45:10 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T13:45:10Z.


On a 24 GB M4 Pro (Series S, budget off), host texture copies grew to 8.5 GB over 1.7 GB of distinct title memory during the world load and stopped it (#301, alicans' third run). The copies hold the same title memory several times over: aliasing objects and placed descriptions over one range each get a host texture of their own.

One Metal texture per range of title memory is proposed on #301 and waits on the maintainer's answer there. Before anything is built, a trace should tell how much of the overlap is which kind:

  • Overlapping bytes by layout. Of the bytes the copies hold more than once, how many are copies with an identical layout at the same start (one texture could serve them all, as 60baf130 does for R9G9B9E5 over R32_UINT), and how many have different layouts (another swizzle, size or start).
  • Owner changes. How often an upload into a range takes it from another live copy, split by identical and different layout, and how often from a copy already released (ordinary reuse of memory). Frequent changes between different layouts would mean "the newest layout owns the range" re-uploads or samples black.

Off by default, behind a VICTORY_* variable, once a second, documented in docs/native-host.md. No change to which texture a draw samples.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6647663493 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/352). Originally posted by [m0rff](https://github.com/m0rff) on 2026-11-27T13:45:10Z. --- On a 24 GB M4 Pro (Series S, budget off), host texture copies grew to 8.5 GB over 1.7 GB of distinct title memory during the world load and stopped it (#301, alicans' third run). The copies hold the same title memory several times over: aliasing objects and placed descriptions over one range each get a host texture of their own. One Metal texture per range of title memory is proposed on #301 and waits on the maintainer's answer there. Before anything is built, a trace should tell how much of the overlap is which kind: - **Overlapping bytes by layout.** Of the bytes the copies hold more than once, how many are copies with an identical layout at the same start (one texture could serve them all, as `60baf130` does for R9G9B9E5 over R32_UINT), and how many have different layouts (another swizzle, size or start). - **Owner changes.** How often an upload into a range takes it from another live copy, split by identical and different layout, and how often from a copy already released (ordinary reuse of memory). Frequent changes between different layouts would mean "the newest layout owns the range" re-uploads or samples black. Off by default, behind a `VICTORY_*` variable, once a second, documented in docs/native-host.md. No change to which texture a draw samples.
m0rff commented 2026-11-27 13:45:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T13:45:17Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7219902048 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/352#issuecomment-7219902048). Originally posted by [m0rff](https://github.com/m0rff) on 2026-11-27T13:45:17Z. --- /claim
github-actions[bot] commented 2026-11-27 13:45:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T13:45:28Z.


Claimed by @m0rff. Open a draft pull request with Refs #352 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7219906051 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/352#issuecomment-7219906051). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T13:45:28Z. --- Claimed by @m0rff. Open a draft pull request with `Refs #352` in its description within 24 hours, or the claim expires.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LakshanSivakumar/Native-Victory-macOS#352
No description provided.