Proposal: make host textures only for the mip levels the title has mapped (levels on demand), after measuring it #462
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS#462
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Hayyan612 on GitHub · 2026-11-27 21:00 UTC · original
Mip-streamed textures are placed in a reservation and their levels mapped as they stream in, tail first and level 0 last (
texture_tests::streamed_mips_across_scattered_pool_pages_upload_each_step_without_whole_rereads). Uploads already follow that step by step. But the host texture seems to be made with the whole chain from the start, so a level the title has not mapped yet still takes host memory. Level 0 alone is about 73% of a texture's.ScarlettPort (ZigZagBoi1/ScarlettPort#64) makes host textures level by level as the title fills them. On an RX 9060 XT: median frame 18.9 → 22.0 fps, 90th percentile 92–160 ms → 75 ms, texture passes that found no room 2,839 → 48, with 19,900 host copies alive in 4.8 GB where 12,000 had taken 5.2 GB. They note that system RAM did not drop there, because staging grew. On Apple's unified memory the host copies are system memory, so the saving should count in full.
Measure first. A diagnostic, off by default (
VICTORY_TRACE_UNMAPPED_LEVELS=1): every N submissions, log the host bytes of texture levels whose title pages are all unmapped, total and per format. If testers' world runs show that it is large, then:Then. Make a mip-streamed texture's host copy with only its mapped levels, through the same
host_mip_rangemapping the top-mip drop (#349/#348) uses for views, and remake it with the next level when the title maps one. Metal sparse textures (heap-backed tiles following the title's page mappings) would be the other way, without the remake; Apple GPUs support them.Not claiming the change. I can write the diagnostic, with a test on the streamed-mips fixture, if it is wanted.
@AnastasisKon on GitHub · 2026-11-27 22:07 UTC · original
/claim
Taking the measure-first step only: VICTORY_TRACE_UNMAPPED_LEVELS=1 logging, every N submissions, the host bytes of texture levels whose title pages are all unmapped (total and per format). No behaviour change; the levels-on-demand remake stays for after the measurement.
@github-actions[bot] on GitHub · 2026-11-27 22:08 UTC · original
Claimed by @AnastasisKon. Open a draft pull request with
Refs #458in its description within 24 hours, or the claim expires.@AnastasisKon on GitHub · 2026-11-28 21:07 UTC · original
/release
@AnastasisKon on GitHub · 2026-11-28 21:07 UTC · original
Releasing the claim: the remaining step on #462 is the measurement itself — world runs with VICTORY_TRACE_UNMAPPED_LEVELS=1 to see whether the unmapped-level host bytes are large enough to justify the levels-on-demand remake. The full game data (~137 GB at /Volumes/Anastasis' SSD/GTA6.Xbox.v1.0.2.1-CYBERLEEK) is still downloading on this machine, so no in-game numbers can be produced here yet; the diagnostic itself has landed (PR #500) and is ready for anyone with a complete install to run. The unit-test issues stay claimed — none of them need a game run.
@github-actions[bot] on GitHub · 2026-11-28 21:07 UTC · original
Released. This issue is free to claim.