Shaders: follow EXEC set from a scalar the section made constant #90
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/Belobug--VIctory-Belobug-AMD!90
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/90/head"
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?
@dutch2005 on GitHub · 2026-11-25 13:45 UTC · original
fix/shader-exec-scalar→main· +65 −3 · 1 files · 1 commits · closed without mergingWhy
A whole-wave section that sets
EXECfrom a scalar it computed itself (s_mov_b32 s5, -1thens_mov_b32 exec_lo, s5) stopped the section simulation at theEXECwrite, because only inline constants and literals were followed. The lanes after it then lost their shape. Ported from the open upstream PR Marvisak/VIctory#2382 (by Calvix2k); this tree still stops at the scalar copy.What
sconst) and follows anEXECwrite from one of them.s_or_saveexec,s_mov s5, -1,s_mov exec_lo, s5,v_mov v2, 7, restore; v2 keeps shapeK(7).Review fix
gut0to found that a 64-bit scalar move writes two SGPR halves but
inst.writescarries one constant value, so tracking it per half could seed the wrong value for a laters_mov_b32 exec_hi. Only plains_mov_b32moves now seed the map; a pureseeds_scalar_constanthelper and test lock that rule.Testing
cargo test -p victory-shader --lib scalar_constant -- --test-threads=1— 2 passed, 0 failed: the original EXEC-from-scalar case and the wide-move exclusion.code != NULLguard inconstant(the null SGPR is not readable andsconstnever holds it); documented in PR #108's policy.Notes
No change for sections whose
EXECis set directly from an inline constant or literal; only the scalar-copy form is newly followed.@ySKELLETONX on GitHub · 2026-11-25 16:35 UTC · original
Tested on an RX 7600 XT 16 GB (RDNA3, Navi 33), driver 32.0.32015.2008, Windows 11 Pro build 26300, Rust 1.98.1, at
d64ca87:cargo test -p victory-shader --lib --locked: 267 passed, 0 failed, 6 ignored, hardware dispatch tests included (mainat01aadd1: 266 passed). The PR has moved to8b89fe8since. Workspace tests only; not run in the title.@ -375,0 +379,4 @@// what the scalar held. A 64-bit move is not tracked here: both// halves are in `inst.writes` with the same constant, but only// the low half holds it (review on #90).for &(_, w) in &inst.writes {@gut0to on GitHub · 2026-11-25 14:49 UTC · original
Could this track each written dword separately for s_mov_b64? inst.writes contains both SGPR halves, but this loop stores the same u64 in each. For s_mov_b64 s[4:5], 1, the upper SGPR is 0; recording it as 1 can make a later s_mov_b32 exec_hi, s5 simulate the wrong lanes. Please add a 64-bit move regression case and split the tracked value into low/high halves. AI-assisted review.
@gut0to on GitHub · 2026-11-25 14:49 UTC · original · reviewed
AI-assisted review: I checked the IR write expansion and the affected EXEC path.
Pull request closed