shader: lane_uniform no longer calls lane-dependent results alike #2389

Merged
FIocker merged 1 commit from upstream-pr/2389 into main 2026-11-30 14:12:03 +00:00
FIocker commented 2026-11-29 12:37:05 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by FIocker on 2026-11-29T12:37:05Z.


lane_uniform (emit/lower/analysis.rs) took three kinds of input as one value per wave, which they are not:

  • v_div_fmas reads VCC per lane, and no operand names it.
  • Inline constants 251-254 (EXECZ, VCCZ, SCC, LDS direct) and attribute operands depend on execution or the lane.
  • A MAC's accumulator and v_swap_b32's other side are implicit vector reads outside the source operands; the operand check never looked at them.

A result marked uniform from any of these is wrong in the lanes that differ, for example once it is read with v_readfirstlane or used as a uniform index. After coasting (GPL-3.0).

Checked: workspace check clean; victory-shader lib tests 462 passed (release).

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5550770548 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2389). Originally posted by [FIocker](https://github.com/FIocker) on 2026-11-29T12:37:05Z. --- `lane_uniform` (`emit/lower/analysis.rs`) took three kinds of input as one value per wave, which they are not: - `v_div_fmas` reads VCC per lane, and no operand names it. - Inline constants 251-254 (EXECZ, VCCZ, SCC, LDS direct) and attribute operands depend on execution or the lane. - A MAC's accumulator and `v_swap_b32`'s other side are implicit vector reads outside the source operands; the operand check never looked at them. A result marked uniform from any of these is wrong in the lanes that differ, for example once it is read with `v_readfirstlane` or used as a uniform index. After coasting (GPL-3.0). Checked: workspace check clean; `victory-shader` lib tests 462 passed (release). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Dukestar69 commented 2026-11-29 12:49:27 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-29T12:49:27Z.

Review: APPROVED


Tested locally merged onto main (829188e9).

  • Merge: Clean 11-line merge in crates/victory-shader/src/emit/lower/analysis.rs.
  • Tests (RTX 5090):
    • cargo test -p victory-shader --lib emit::lower::tests:: passed (25 passed; 0 failed; 1 ignored).
    • cargo test -p victory-shader --lib emit::wave64_tests:: passed (44 passed; 0 failed).
  • 0 new warnings.

Important soundness fix in lane_uniform preventing lane-dependent instructions from being treated as uniform. LGTM.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6102942347 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2389#pullrequestreview-6102942347). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-29T12:49:27Z. **Review:** APPROVED --- Tested locally merged onto `main` (`829188e9`). - **Merge**: Clean 11-line merge in `crates/victory-shader/src/emit/lower/analysis.rs`. - **Tests (RTX 5090)**: - `cargo test -p victory-shader --lib emit::lower::tests::` passed (`25 passed; 0 failed; 1 ignored`). - `cargo test -p victory-shader --lib emit::wave64_tests::` passed (`44 passed; 0 failed`). - 0 new warnings. Important soundness fix in `lane_uniform` preventing lane-dependent instructions from being treated as uniform. LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!2389
No description provided.