perf(shader): reuse 64 KiB page directory lookups in ray walkers (VICTORY_MEMORY_NEAR) #328

Manually merged
github merged 1 commit from github-bot/gh-328 into gh-pr/328/base 2026-11-29 00:28:27 +00:00 AGit
Owner

@⁠wike1701 on GitHub · 2026-11-27 21:05 UTC · original
wike1701:perf/ray-walker-memory-near → main · +373 −27 · 4 files · 1 commits · merged 2026-11-29 00:24 UTC

Summary

Ports the ray-walker page-directory lookup caching optimization (VICTORY_MEMORY_NEAR) from xceless/victory-fork (GPL-3.0, commit 299fba):

  • Same-page lookup reuse (Lower::memory_near / Lower::memory_near_words): in BVH/ray-walking compute shaders (non-spilled), consecutive global loads and node tests that hit the same 64 KiB title-memory page as a dominating earlier lookup reuse that lookup's view handle and byte offset instead of reloading from the 16 MB page directory and picking a descriptor handle per lane.
  • 128-byte box node second-half fast path (Lower::bvh_second_words): reads the second 64 bytes of a 128-byte BVH box node through the first half's view whenever it does not cross a 64 KiB page boundary (within <= 0xFF80).
  • Shader cache key: adds VICTORY_MEMORY_NEAR to shader_cache.rs so toggling VICTORY_MEMORY_NEAR=0 (A/B benchmarking) never serves stale cached shaders.

Verification

  • cargo test -p victory-shader --lib -- intersect — 6 passed, 0 failed (including live D3D12 GPU tests he_64_bit_node_test_over_title_memory_matches_the_reference_on_the_card and he_32_bit_node_test_over_title_memory_matches_the_reference_on_the_card)
  • cargo check -p victory-gpu — ok (0 new warnings)
  • cargo xtask policy — 287 files ok
**@⁠wike1701** on GitHub · 2026-11-27 21:05 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/328) `wike1701:perf/ray-walker-memory-near` → `main` · +373 −27 · 4 files · 1 commits · merged 2026-11-29 00:24 UTC ## Summary Ports the ray-walker page-directory lookup caching optimization (VICTORY_MEMORY_NEAR) from xceless/victory-fork (GPL-3.0, commit 299fba): - **Same-page lookup reuse (Lower::memory_near / Lower::memory_near_words)**: in BVH/ray-walking compute shaders (non-spilled), consecutive global loads and node tests that hit the same 64 KiB title-memory page as a dominating earlier lookup reuse that lookup's view handle and byte offset instead of reloading from the 16 MB page directory and picking a descriptor handle per lane. - **128-byte box node second-half fast path (Lower::bvh_second_words)**: reads the second 64 bytes of a 128-byte BVH box node through the first half's view whenever it does not cross a 64 KiB page boundary (within <= 0xFF80). - **Shader cache key**: adds VICTORY_MEMORY_NEAR to shader_cache.rs so toggling VICTORY_MEMORY_NEAR=0 (A/B benchmarking) never serves stale cached shaders. ## Verification - cargo test -p victory-shader --lib -- intersect — **6 passed, 0 failed** (including live D3D12 GPU tests he_64_bit_node_test_over_title_memory_matches_the_reference_on_the_card and he_32_bit_node_test_over_title_memory_matches_the_reference_on_the_card) - cargo check -p victory-gpu — **ok** (0 new warnings) - cargo xtask policy — **287 files ok**
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 21:06:56 +00:00
github-bot referenced this pull request from a commit 2026-11-29 00:27:22 +00:00
github-bot changed target branch from main to gh-pr/328/base 2026-11-29 00:28:19 +00:00
github manually merged commit f7de45ee83 into gh-pr/328/base 2026-11-29 00:28:27 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!328
No description provided.