shader: take the loops lanes outside EXEC run wave-wide (distant-shadow LDS stack pops) #22
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/vktory6--VKtory!22
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-22"
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?
@just-another-dude84 on GitHub · 2026-11-30 21:43 UTC · original
just-another-dude84:ds-stack-fix→main· +280 −8 · 5 files · 4 commits · merged 2026-12-01 08:24 UTCWhat
In programs where
scalar_splitsalready takes per-lane branches wave-wide,s_cbranch_vccz/s_cbranch_vccnzloops are now taken wave-wide too. This applies when the loop holds EXEC-guarded vector code and exits to unguarded vector code.Why
CS_RTDistantShadowTrace32 (a1b20bc4) keeps its BVH traversal stack in lanes of v23 plus an overflow stack in LDS.
structurethen assumed EXEC holds behind the loop, so thev_readfirstlaneof the popped stack pointer and node pointer had no EXEC guard. It read lane 0's stale value.distshadow.mdlisted as open: "a +60 base of -FLT_MAX read as an instance".Scope
Of the 2,734 store compute programs, 12 change; there are no new failures and no fallbacks.
If the wider form is refused, the plain form is used. This is counted through
kept_per_lane.TRANSLATOR_VERSIONgoes from 10 to 11.Measurements
Setup: RX 6800 (RDNA2), RADV 26.3.1, prison save. Interleaved ABAB, 3 runs per arm, world 90-190 s, run medians. Only
translate-dirdiffers between the arms (main3a0b738vs086d949); the later commits produce identical DXIL.Tests
cargo test -p victory-shaderpasses, including the newlane_loop_tests:How this came up: device losses with the hardware node test
This started from the roadmap's "Hardware BVH node test", step 1: a local experiment that runs
image_bvh64_intersect_rayon the card's own instruction instead of the emulation. It uses a small local Mesa patch, which is not part of this PR.v_readfirstlanefixed here.So the change fixes the root cause behind those crashes. With it, the emulated path's all-zero node count in a1b20bc4 is 0.
The hardware arm has not been re-run with this fix yet. An unrelated truncated row in our local shader store held it up; the stack fix itself is not the cause. Results will follow on the roadmap item.
🤖 Generated with Claude Code
VUID-VkSparseMemoryBind-memory-02730on main (not on the TASKS.md list) #42@vktory6 on GitHub · 2026-12-01 08:24 UTC · original
Merged, thanks! One commit of mine on top (
e430113): the per-lane form without the lane loops (prefer_wider/LOOPS_KEPT) is gone. When the wider form is refused, the existing per-lane arm takes it and counts it (kept_per_lane). Keeping a second fallback form would only be code for a case we now count instead (rule 33).Check on the reference system (RX 9070 XT): tests pass, and the house-scene validation run shows no new error. The run is slow (4.4 fps) because the translator change retranslates the store.