Shaders: follow EXEC set from a scalar the section made constant #90
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/90"
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 Belobug/VIctory-Belobug-AMD. Originally posted by dutch2005 on 2026-11-25T13:45:24Z.
Why
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.Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-25T14:49:34Z.
Review: COMMENTED
AI-assisted review: I checked the IR write expansion and the affected EXEC path.
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-25T14:49:34Z.
Code review location:
crates/victory-shader/src/emit/wave.rs; line 380Could 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.
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by ySKELLETONX on 2026-11-25T16:35:42Z.
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.Pull request closed