Host footprint over the console budget: prove asked vs allocated and cut the biggest host-only over-allocation #643

Open
opened 2026-11-28 20:54:32 +00:00 by github-bot · 2 comments
Owner

@⁠jamal-fv on GitHub · 2026-11-28 20:50 UTC · original

Symptom

On an M3 Max 36 GB, footprint at the world baseline is 14 GB (peak 14 GB; 16 GB with change-signal / L3 dirty tracking). Series S console budget is ~10 GB total (~8 GB usable). With VICTORY_CHANGE_PROPORTIONAL=1 or VICTORY_PERSISTENT_DESC=1 the run can die before the world with kIOGPUCommandBufferCallbackErrorOutOfMemory.

Measured split (baseline, no flags):

Tag Resident
IOAccelerator (graphics) 6501 MB
untagged VM_ALLOCATE 4631 MB
MALLOC_SMALL 1594 MB
MALLOC_LARGE 1489 MB
TOTAL ~14 GB

Already proven (offline + existing run logs)

From VICTORY_TRACE_TEXTURE_SYNC=1 on a world run (wt-main main-next-000350):

  • host texture copies 6476 MiB over 2376 MiB distinct title memory (~2.7×)
  • 0 MiB could be given up under the budget (all shown by heap entries)
  • ~15.6k covered ping-pong pairs exempt from clearing
  • resource_heaps=3 so HEAP_VIEWS padding is only ~3×48 MiB (+ stride tables) — secondary
  • With residency sets: heap_set_mb≈16453, metal_mb≈15377, footprint_mb≈18918

So the title asks for one set of texels in title memory; the host allocates a second detiled MTLTexture set, and overlapping placements keep more than one host copy of the same pages. Covered / VA-alias work is tracked under #8 / #432 — this issue is for proving asked-vs-allocated with counters and fixing host-only over-allocation that does not change what is drawn (heap sizing vs title NumDescriptors, staging retention, etc.).

Out of scope here

  • #432 covered eviction / physical-pool identical share (claimed)
  • VICTORY_TEXTURE_DROP_TOP_MIP defaults (#349) — changes sampling sharpness

Done when

  • Counters (off by default, VICTORY_*) show title-asked vs host-allocated for heaps and texture copies
  • At least one rendering-neutral over-allocation class is fixed with a regression test
  • A before/after footprint / vmmap -summary on the same headless world run
**@⁠jamal-fv** on GitHub · 2026-11-28 20:50 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/639) ## Symptom On an M3 Max 36 GB, `footprint` at the world baseline is **14 GB** (peak 14 GB; **16 GB** with change-signal / L3 dirty tracking). Series S console budget is ~10 GB total (~8 GB usable). With `VICTORY_CHANGE_PROPORTIONAL=1` or `VICTORY_PERSISTENT_DESC=1` the run can die before the world with `kIOGPUCommandBufferCallbackErrorOutOfMemory`. Measured split (baseline, no flags): | Tag | Resident | |---|---:| | IOAccelerator (graphics) | 6501 MB | | untagged VM_ALLOCATE | 4631 MB | | MALLOC_SMALL | 1594 MB | | MALLOC_LARGE | 1489 MB | | **TOTAL** | **~14 GB** | ## Already proven (offline + existing run logs) From `VICTORY_TRACE_TEXTURE_SYNC=1` on a world run (`wt-main` `main-next-000350`): - **host texture copies 6476 MiB** over **2376 MiB distinct title memory** (~2.7×) - **0 MiB could be given up** under the budget (all shown by heap entries) - **~15.6k covered ping-pong pairs exempt** from clearing - `resource_heaps=3` so `HEAP_VIEWS` padding is only ~3×48 MiB (+ stride tables) — secondary - With residency sets: `heap_set_mb≈16453`, `metal_mb≈15377`, `footprint_mb≈18918` So the title *asks for* one set of texels in title memory; the host *allocates* a second detiled MTLTexture set, and overlapping placements keep more than one host copy of the same pages. Covered / VA-alias work is tracked under #8 / #432 — **this issue is for proving asked-vs-allocated with counters and fixing host-only over-allocation that does not change what is drawn** (heap sizing vs title `NumDescriptors`, staging retention, etc.). ## Out of scope here - #432 covered eviction / physical-pool identical share (claimed) - `VICTORY_TEXTURE_DROP_TOP_MIP` defaults (#349) — changes sampling sharpness ## Done when - Counters (off by default, `VICTORY_*`) show title-asked vs host-allocated for heaps and texture copies - At least one rendering-neutral over-allocation class is fixed with a regression test - A before/after `footprint` / `vmmap -summary` on the same headless world run
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 20:54:32 +00:00
Author
Owner

@⁠jamal-fv on GitHub · 2026-11-28 20:50 UTC · original

/claim — asked-vs-allocated counters for heaps/texture copies; rendering-neutral over-allocation cut (heap sizing vs title NumDescriptors / staging retention); before/after footprint on the same headless world run. Refs #8 for the covered-copy work already claimed there.

**@⁠jamal-fv** on GitHub · 2026-11-28 20:50 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/639#issuecomment-7245581515) /claim — asked-vs-allocated counters for heaps/texture copies; rendering-neutral over-allocation cut (heap sizing vs title NumDescriptors / staging retention); before/after footprint on the same headless world run. Refs #8 for the covered-copy work already claimed there.
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-28 20:50 UTC · original

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

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