rdna2spirv: guard image_bvh PhysicalStorageBuffer loads on active EXEC lanes #95
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/95"
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?
Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T02:16:55Z.
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):
Gen.image_bvh()intools/rdna2spirv.pyonly predicated the finalvgprwrites (out(k, ...)) onEXEC, never thePhysicalStorageBufferloads (OpConvertUToPtr/OpLoad). In a divergent BVH traversal loop where finished lanes are masked off inEXECand hold stale or null node pointers, inactive lanes still entered the triangle/box branches and issued 10-40 PSB loads from invalid addresses (riskingVK_ERROR_DEVICE_LOST), unlikeglobal_mem,global_sub,buffer_load,buffer_load_sub, andglobal_atomicwhich all guard their loads withself.active_b().Wrap the PSB pointer conversion and node-type dispatch in an outer
OpSelectionMerge/OpBranchConditionalonself.active_b()so inactive lanes skip all PSB loads and leavev[vd:vd+3]untouched.Added an inactive-lane (
EXEC == 0) regression test intests/semantic/test_image_bvh_box.pycovering triangle (type=0) and box (type=4, 5) nodes with a read-tracking memory map (fails with 10 / 40 PSB reads before the fix, passes with 0 reads and preservedvdstafter).Claimed in
#9065. AI-assisted; tested on Windows 11 / Python 3.12.10 withpython -I -m unittest discover -s tests/semantic -p "*bvh*.py" -v,python -m compileall -q tools/rdna2spirv.py tests/semantic/test_image_bvh_box.py, andpython -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/semantic/test_image_bvh_box.py(no game files).Reopened after mass PR cleanup (previously
#9170).Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T18:36:08Z.
Maintainer review: not ready to merge. The active-lane guard is absent from current main, so this does not appear obsolete. This remains a draft and all current checks were cancelled; please promote it when ready, establish the claim in the current coordination issue, and rerun focused plus required CI against the integrated current-main tree. PR #137 also changes the image_bvh lowering in the same source file; please coordinate/recheck the combined result. The existing Ray tracing contract row does not state this inactive-lane load guarantee, so please document it there with its confirmation basis, or explain why no contract update is needed.
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:00:04Z.
Review: COMMENTED
Draft review against current
main: the active-lane EXEC guard aroundimage_bvhPhysicalStorageBuffer loads intools/rdna2spirv.py:13905-13911looks clean, clean-room verified, and still relevant, but CI checks are cancelled and the PR is still Draft. Please merge/rebase currentmainand mark Ready for Review so CI runs green.(AI-assisted review.)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:07:25Z.
Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.
(AI-assisted triage.)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T13:02:20Z.
Review: APPROVED
Now ready for review and
MERGEABLE. Clean-room verified: the active-laneEXECguard onimage_bvhPhysicalStorageBufferloads intools/rdna2spirv.py:13905-13911withtests/semantic/test_image_bvh_box.pyis clean and well-scoped. (Note: coordinate merge order with#137, which also touchesimage_bvhlowering.)Approving — ready to merge once fresh CI runs green on current
main(existing Nov 24 checks were cancelled).(AI-assisted review.)