Repository navigation
GPU: capped view heap - a table of the title's slots, each distinct view held once - #13
Merged
Merged
Conversation
…iew held once On a host that caps shader-visible view heaps (1,000,000 slots on NVIDIA) a title heap with more slots than fit was held by blocks of 1,024 title slots. In the world the title holds views in about 1,000 of its 1,216 blocks, the heap had 831, and ~100,000 live views had no host slot. Such a heap now holds each distinct view of the title's once, wherever a slot is free, and the title's slots lead there through a table: - Translated shaders map every view heap index they compute, from the resource heap itself or through a descriptor table, with one dword load from the view-slot table (root SRV t254, which held the block table). The host passes where the title has a table and makes none afresh in dynamic slots on such hosts. - The table has a dword per title slot, in a GPU upload heap where the host has one (else an upload buffer), written by the CPU only. A slot without a view leads to the heap's last slot, which stays null. - The title's records already name its distinct views (index and generation), so a title slot write is a lookup by that key: a view some other slot holds only gets the table entry; a new one takes a free host slot and is made there. A view no title slot holds any more gives its host slot back when the sync is over, so one that only moves between slots is not made twice. - A shared buffer view is looked up again when another slot takes it after host copies were made or released, and made again in place if its copy changed; a placed texture's view likewise when a draw reads it. - Strides, marks, view addresses and what title memory feeds are kept by host slot, as before. The waiting and retry of views without a block are gone with the blocks. - A title heap that fits the host's keeps the title's order; its table leads each slot to itself. - The shader cache key of capped hosts changes (the mapping is part of the translation): caches must be pre-built again. - The host's multiply-add probe runs before the translator is told the heaps are capped: it binds no view-slot table, and translated for a capped heap its table entry would be looked up there (a device removal at start-up, which failed every GPU test after it). - Diagnostics builds log, every 5 s: distinct host views of capacity, title slots holding one, table writes, views made, made again, given back and refused. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No conflicts; main changed no shader-crate source since 1104646, so the pre-built cache stays valid. Co-Authored-By: Claude Opus 5.5 <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.
On hosts that cap shader-visible view heaps (1,000,000 slots on NVIDIA), the 1,024-slot block remap is replaced by a per-title-slot table (root SRV t254) and one host slot per distinct view of the title's.
Needs a new shader cache: the mapping is part of the translation on capped hosts (cache key changes), so caches must be pre-built again (
translate --cache --pipelines).What changes
settle).Viewedare kept by host slot. The block waiting/retry code is gone.Measured (RTX 5090, diag, one 240 s world run, capped pacing, GPU upload + lazy copy-back on)
Frame time is about flat: sync is ~22 ms cheaper, GPU and copy-back are a little higher. Stable 240 s, no device removal; world frames show the scene (pre-existing magenta fragments remain).
Gate
clippy
-D warnings(victory-gpu, victory-shader, victory with diagnostics);cargo test -p victory-gpu -- --test-threads=1179 passed;cargo test -p victory-shader297 passed;cargo xtask policyok.🤖 Generated with Claude Code