Repository navigation
perf(shader): walk the title page table with fewer loads - #371
Merged
pragyaangaur merged 3 commits intoNov 26, 2026
Merged
Conversation
Every access at a computed title address read four page-table dwords: the level-1 entry, the page entry's view and start, and the null pair's view, which is the same for the whole program. The null view is now read once in the entry block and the entry's two dwords in one load: two table loads per access instead of four, results unchanged. A box32 BVH node's last 48 bytes reuse its first 64 bytes' lookup unless the node starts in the last 64 bytes of a page; only those lanes walk again. That takes a box32 node fetch from 15 loads to 9 off the crossing path. Multi-dword global loads keep one data load per dword: a copy can end or start inside a page, and partly out-of-bounds vector raw loads are not pinned down well enough to call that exact. 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.
Every access at a computed title address read four page-table dwords: the level-1 entry, the page entry's view and start, and the null pair's view, which is the same for the whole program. The null view is now read once in the entry block, and the entry's two dwords in one load. A box32 BVH node's last 48 bytes also reuse its first 64 bytes' lookup unless the node starts in the last 64 bytes of a page; only those lanes walk again.
global_load_dwordx4Multi-dword data loads are left to #373, which reads up to four dwords per load and has a hardware test for a load that runs past its view.
Tested: native victory-shader and victory-formats suites with 2 new structural tests, Windows clippy with and without
diagnostics. It still needs the GPU tests under Wine (memory_tests.rs,bvh_tests.rs, including a new box32-across-a-page test that compiles but has not run). Shaders re-translate once, as with any victory-shader change.🤖 Generated with Claude Code