mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:15:52 +01:00
[PR #95] rdna2spirv: guard image_bvh PhysicalStorageBuffer loads on active EXEC lanes #145
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#145
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/95
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/9827📝 Commits (1)
1820512rdna2spirv: guard image_bvh PhysicalStorageBuffer loads on active EXEC lanes📊 Changes
2 files changed (+51 additions, -1 deletions)
View changed files
📝
tests/semantic/test_image_bvh_box.py(+42 -0)📝
tools/rdna2spirv.py(+9 -1)📄 Description
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).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.