Repository navigation
\ GPU: capped view heap - more title blocks,waiting views skip the sync\ - #7
Merged
Merged
Conversation
On a host that caps shader-visible view heaps (NVIDIA, 1,000,000 slots) the title's views get host slots by 1,024-slot blocks. In the world the title holds views in ~990-1,006 of its 1,216 blocks (mostly dense: ~590 blocks hold >512 views; finer blocks would not help, 64-slot chunks still need ~930k slots), but only 703 host blocks were left beside 262,144 dynamic slots, of which the world took at most ~111,500 (55,000-77,000 after loading). ~309,000 live views had no host slot, and every sync visited them again on each dirty page (~57,000 visits per frame), each searching the whole block map for a free block. - Capped hosts get 2^17 dynamic slots (host only; shaders and the shader cache key are unchanged): 831 host blocks instead of 703. - A view that finds no host block waits with its record's key: the sync skips it while the title leaves it unchanged, the search returns at once while no block is free, and waiting views are made as soon as their block has a host block or one is given back (a few blocks per sync, the block with the most waiting first). - Diagnostics builds log block use, waiting views, block ages, dynamic slot peaks and sync time every 5 s. Measured in the world (RTX 5090, 300 s): views without a host slot ~309,000 -> ~101,000, their visits ~57,000 -> ~11,000 per frame, sync_heaps ~65 -> ~52 ms per frame, no device removal. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a host that caps shader-visible view heaps (NVIDIA: 1,000,000 slots), the capped-view-heap remap (Marvisak#1779 upstream) gives the title's views host slots by 1,024-slot blocks. In the world, the title holds views in about 990–1,006 of its 1,216 blocks, and most of those blocks are dense (~590 hold more than 512 views). The heap had only 703 host blocks left beside 262,144 dynamic slots, and the world never used more than ~111,500 dynamic slots at once (~111,500 while loading, 55,000–77,000 after).
So ~309,000 live views had no host slot. Every sync visited them again on each dirty page (~57,000 visits per frame), and each visit searched the whole block map for a free block. Finer blocks would not help: even counted in 64-slot chunks, the views need ~930k slots.
Change (host only; translated shaders and the shader cache key are unchanged)
sync_heapstime every 5 s.Measured (RTX 5090, 300 s, same keys and cache as the v4 runs)
sync_heapsms/frameThe run had no device removal. Camera timing differs between runs, so the world captures are not like-for-like; no regression is visible.
Open
Tests: the existing capped-heap tests pass (two expectations updated for the smaller dynamic range), and there is a new test,
a_view_without_a_host_block_waits_for_one. Gate: clippy (gpu + victory diagnostics),cargo test -p victory-gpu -- --test-threads=1(179 passed),cargo xtask policy.🤖 Generated with Claude Code