gpu(native): VICTORY_TRACE_HEAP_SET reports what the heaps keep resident that no bound table named for N frames (#79) #292
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/292"
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 Olima34 on 2026-11-27T09:06:03Z.
Refs #79. This is the diagnostic asked for there, so that 16 and 24 GB Macs can send the same table as the 48 GB one. It is off by default.
What it logs. With
VICTORY_TRACE_HEAP_SET=<frames>, every 64 frames (with thenative draws so farline), it logs what the descriptor heaps' residency sets hold. Textures and buffers are counted apart, and each underlying allocation is counted once over all heaps: a texture view counts as its parent's memory. The total is split three ways:<frames>frames, which is what a time-based eviction could free;Each entry's last use is noted where tables are remirrored (
NativeHeap::used). Entries a shader reaches by indexing the heap itself aren't seen, so idle and never are upper bounds.For testers:
Compare the totals with the Mac's RAM and with the
heap_set_mb=of thenative draws so farlines, and check whether idle stays at 0.Reference (M5 Pro, 48 GB, Series S, world frames 2176–2496, 300 frames): 9.2 GB of textures and 7.6 GB of buffers (the title's pools) in the sets. 0 MB idle, and 8.3 GB of textures never named by a bound table.
Test:
heap_allocations_give_each_allocation_once_with_its_latest_use(Metal) checks that a view counts with its parent and keeps the latest use over the entries.Checks: victory-gpu and victory-metal tests pass on arm64 (373). Windows clippy is clean with
-D warnings,cargo xtask policypasses, anddocs/native-host.mdlists the switch.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T10:37:39Z.
Thank you. Merged.