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

Open
opened 2026-11-28 20:50:08 +00:00 by jamal-fv · 2 comments
jamal-fv commented 2026-11-28 20:50:08 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by jamal-fv on 2026-11-28T20:50:08Z.


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 / #428 — 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

  • #428 covered eviction / physical-pool identical share (claimed)
  • VICTORY_TEXTURE_DROP_TOP_MIP defaults (#347) — 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
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6670981909 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/639). Originally posted by [jamal-fv](https://github.com/jamal-fv) on 2026-11-28T20:50:08Z. --- ## 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 / #428 — **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 - #428 covered eviction / physical-pool identical share (claimed) - `VICTORY_TEXTURE_DROP_TOP_MIP` defaults (#347) — 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 commented 2026-11-28 20:50:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by jamal-fv on 2026-11-28T20:50:35Z.


/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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7245581515 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/639#issuecomment-7245581515). Originally posted by [jamal-fv](https://github.com/jamal-fv) on 2026-11-28T20:50:35Z. --- /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.
github-actions[bot] commented 2026-11-28 20:50:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T20:50:44Z.


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

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7245583542 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/639#issuecomment-7245583542). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T20:50:44Z. --- Claimed by @jamal-fv. Open a draft pull request with `Refs #639` 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#639
No description provided.