Repository navigation
Shaders: 64-bit built BVH pointers and unsplit node loads - #2040
mgunes1311-lab wants to merge 2 commits into
Conversation
|
Triage verdict — Keep, ready on the reviewed BVH cases ( Evidence
Checks and limits
Next step
This verification was AI-assisted. |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, with dxil.dll validator):
cargo test -p victory-shader --lib emit::bvh_tests::— 17 passed, 0 failed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1(includingroot_srv_bvh_handles_high_pointer_bits_and_unaligned_bases,masked_lanes_and_page_end_nodes_leave_no_stray_marks, andsixty_four_bit_bvh_pointer_in_non_address_built_view_is_refused)cargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— ok (183 files ok)
Clean 64-bit built BVH pointer handling and unsplit node loads with comprehensive GPU+WARP verification. Looks great.
AI-assisted (Gemini 4 Neon).
|
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at AI-assisted (Claude Code). |
|
Automated triage for the maintainers. This fixes two things in Recommending a look, not approving. CI: passing ( Generated by Claude Code |
Offline measurement on a retail dumpResult: no count change against I merged head 7216eb7 onto No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right. No shader names or data are included, per the asset policy. AI-assisted (Claude Code). |
|
AMD check at
Synthetic tests only, no game files. Tested with AI assistance (Claude Code). |
|
Automated triage for the maintainers, second look (a review against current Closing in favour of #2501 for the one fix both make (the If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution. |
Fix two bugs in
Lower::bvh(crates/victory-shader/src/emit/lower/bvh.rs):Root-built BVH descriptors truncated pointer and base arithmetic to 32 bits and dropped
node_hi:When
resource::trackresolved a BVH descriptor built by shifting a root SRV/UAV address (Source::Built),Lower::bvhshifted(node & !7) << 3and addedbuilt_offsetin 32-biti32before widening to 64 bits, ignorednode_hionimage_bvh64_intersect_ray, did not mask the shifted base to bits8..47(0x0000_FFFF_FFFF_FF00), and did not reject 64-bit node pointers on non-address built buffer views.(root + zext(k) + zext(dynamic)) & 0x0000_FFFF_FFFF_FF00in 64-bit integers and share the 64-bit(lo | hi << 32) << 3node address calculation with the unbuilt descriptor path.image_bvh64_intersect_raywhenSource::Builtresolves to a buffer view without a root GPU address.Divergent
begin_guardedblocks aroundLower::memoryzeroed BVH node loads on WARP:Unlike
global_loadandraw_view,Lower::bvhwrappedbvh_lanesinbegin_guarded(guard)and thebox32tail load inbegin_guarded(Some(is32)). BecauseLower::memoryemitscreateHandleFromHeap(..., nonUniform = true)followed bybegin_guarded(marks)beforerawBufferLoad, enteringLower::memoryinside a lane-divergent branch caused WARP to read zeros for active lanes whenever lane 0 of the wave was inactive (breakingbox32children 2-3 inbvh_testson WARP and all node types under maskedEXEC).guardandguard & is32asactivetoLower::memoryso inactive or non-box32lanes never mark stray page misses.box32tail load's byte offset withselect(is32, 64, 0)so 64-byte nodes re-read byte 0 of their own page or buffer rather than probing past byte 64.Verification
cargo test -p victory-shader --lib bvh_tests(all 17 tests pass on both hardware D3D12 and WARP)cargo clippy --workspace --all-targets --all-features -- -D warningscargo doc --workspace --no-deps(with-D warnings)cargo run -p xtask -- policy --stagedandcargo test -p xtask