Skip to content

perf(shader): walk the title page table with fewer loads - #371

Merged
pragyaangaur merged 3 commits into
pragyaangaur:mainfrom
romainhedouin:perf/shader-page-table-walk
Nov 26, 2026
Merged

pragyaangaur merged 3 commits into
pragyaangaur:mainfrom
romainhedouin:perf/shader-page-table-walk

Conversation

@romainhedouin

@romainhedouin romainhedouin commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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.

raw loads, static from the emitted DXIL before after
one title-memory dword access 5 3, plus 1 per program
4 × global_load_dwordx4 32 25
box32 BVH node fetch 15 9

Multi-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

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>
@pragyaangaur
pragyaangaur merged commit e0bb3f6 into pragyaangaur:main Nov 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants