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

Open
opened 2026-11-27 13:54:35 +00:00 by github-bot · 2 comments
Owner

@⁠m0rff on GitHub · 2026-11-27 13:45 UTC · original

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** on GitHub · 2026-11-27 13:45 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/352) 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 13:54:35 +00:00
Author
Owner

@⁠m0rff on GitHub · 2026-11-27 13:45 UTC · original

/claim

**@⁠m0rff** on GitHub · 2026-11-27 13:45 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/352#issuecomment-7219902048) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-27 13:45 UTC · original

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

**@⁠github-actions[bot]** on GitHub · 2026-11-27 13:45 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/352#issuecomment-7219906051) Claimed by @⁠m0rff. Open a draft pull request with `Refs #352` in its description within 24 hours, or the claim expires.
This discussion has been locked. Commenting is limited to contributors.
No description provided.