Shaders: guard title-memory fault writes and skip second BVH directory lookup on non-straddling box32 nodes #607
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!607
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-607"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@orazal12 on GitHub · 2026-11-25 03:09 UTC · original
orazal12:perf/rt-bvh-memory→main· +701 −64 · 6 files · 1 commits · openCuts per-access overhead in ray-tracing / raw title-memory shaders:
SLOT_FAULTSwrites &URem(page, 4095)inLower::memory(): splitsLower::memory_slot()and wraps the fault-slot modulo +rawBufferStore.i32toSLOT_FAULTSinbegin_guarded(Some(missing))/end_guarded(...)so steady-state valid title-memory accesses execute zero modulo ops and zero PCIe UAV writes tofaults[0].bvh_node_words()with(low & 0xFFFF) >= 0xFFC0so 1023/1024 positions reuse(slot, byte)directly, joining viai32PHIs +bvh_heap_handle(no%dx.types.HandlePHI).Verification:
cargo test -p victory-shader --offline: 216 passed, 0 failed (all 8intersect_testsincluding the 311-case BVH GPU + WARP suites and 2 new end-to-end directory/faults/straddle GPU + WARP tests)cargo test -p xtask --offline: 4 passed (asset policy check ok)cargo clippy -p victory-shader --all-targets --offline -- -D warnings: 0 warnings@0xmp3 on GitHub · 2026-11-25 03:35 UTC · original
Verified on a second machine, and a note on what this change can and cannot be shown to do end-to-end.
Tests: your claim reproduces exactly —
cargo test -p victory-shadergives 216 passed, 0 failed, 3 ignored (23.8 s) on Windows 11 / Ryzen 5 5600 / RX 9070 XT, Rust 1.98.1 MSVC. The build is clean.Runtime: the branch boots and reaches the world here with no crash and no device removal, using
VICTORY_SHADER_OPT=59 VICTORY_RELAY=2 VICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=1 VICTORY_INPLACE=1on this card (supported by my AMD notes in #543). So no correctness regression observed in the frame either — the picture is the usual coherent-but-unlit-shadowed prologue.End-to-end timing, which unfortunately does not settle it:
c96b4f2GPU time is marginally lower on the PR (982 vs 1,018 ms) but it was drawing 27% fewer objects at that point, and two runs of the same build differ by 2.5× in draw count. Because the title's simulation is time-dilated by frame rate at 0.3–2 fps, no two runs sample the same workload, so scene variance is much larger than the per-access effect this change removes. I cannot attribute anything to the change from these numbers, and I don't think anyone can from frame time alone.
If you want end-to-end evidence for it, the shape that would work is a fixed workload rather than a live run: capture one frame's dispatch sequence (or replay the same command lists) and compare GPU time for that identical sequence across the two builds. Repeating a fixed scene state would also do it. Otherwise
intersect_tests(already 311 GPU + WARP cases here) is the right instrument, and it already passes.No game data; timings and counts from VIctory's own log. AI-assisted (Hermes Agent).
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.