shader: say where a lane mask read as data comes from when it is refused #118

Merged
Olima34 merged 1 commit from upstream-pr/118 into main 2026-11-26 18:09:23 +00:00
Olima34 commented 2026-11-26 17:18:45 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-26T17:18:45Z.


For the "lane mask read as data" shape of #4. This is a diagnostic, not a lowering: it splits the refusal so the next run says which form the title uses.

Why. "a lane mask holding lanes elsewhere read as data" was the message for every way out of Lower::mask_number. The #110 log shows three compute programs refused with it, but not which form they take, so there is nothing safe to lower yet. Reading the shaders to find out would mean sending game bytes to a model.

What. Each exit now names its cause after the same prefix, so the existing tallies still group them:

  • in a mesh program;
  • a program input;
  • not written by a scalar ALU instruction;
  • written by a scalar instruction of the other width (for example s_and_saveexec_b32 in a wave64 program);
  • the EXEC a saveexec keeps, or a mask written with EXEC;
  • shifted on the host's lanes;
  • an operand no SGPR or constant gives;
  • a scalar operation not modelled.

An unknown operation is now named before its second source is read; nothing else changes. Of the forms tried by hand in a wave64 compute program (s_and_saveexec_b64, s_orn1_saveexec_b64, s_brev_b64, s_wqm_b64, s_cselect_b32, s_mov_b32 and s_not_b32 of vcc_lo), only s_and_saveexec_b32 reaches this refusal; the others already lower.

Test. mask_tests checks the "other width" message for s_and_saveexec_b32 in wave64.

victory-shader tests, Windows clippy and cargo xtask policy pass. Once a refusal report on current main is posted, I'll lower whichever form shows up.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6631807390 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/118). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-26T17:18:45Z. --- For the "lane mask read as data" shape of #4. This is a diagnostic, not a lowering: it splits the refusal so the next run says which form the title uses. **Why.** "a lane mask holding lanes elsewhere read as data" was the message for every way out of `Lower::mask_number`. The #110 log shows three compute programs refused with it, but not which form they take, so there is nothing safe to lower yet. Reading the shaders to find out would mean sending game bytes to a model. **What.** Each exit now names its cause after the same prefix, so the existing tallies still group them: - `in a mesh program`; - `a program input`; - `not written by a scalar ALU instruction`; - `written by a scalar instruction of the other width` (for example `s_and_saveexec_b32` in a wave64 program); - `the EXEC a saveexec keeps, or a mask written with EXEC`; - `shifted on the host's lanes`; - `an operand no SGPR or constant gives`; - `a scalar operation not modelled`. An unknown operation is now named before its second source is read; nothing else changes. Of the forms tried by hand in a wave64 compute program (`s_and_saveexec_b64`, `s_orn1_saveexec_b64`, `s_brev_b64`, `s_wqm_b64`, `s_cselect_b32`, `s_mov_b32` and `s_not_b32` of `vcc_lo`), only `s_and_saveexec_b32` reaches this refusal; the others already lower. **Test.** `mask_tests` checks the "other width" message for `s_and_saveexec_b32` in wave64. victory-shader tests, Windows clippy and `cargo xtask policy` pass. Once a refusal report on current main is posted, I'll lower whichever form shows up.
LakshanSivakumar commented 2026-11-26 18:09:50 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T18:09:50Z.


Merged, thanks. I renamed the first cause to "in a mesh, hull or geometry program" (f8a7a0b), since that case covers every stage but compute, pixel and vertex.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7200126157 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/118#issuecomment-7200126157). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T18:09:50Z. --- Merged, thanks. I renamed the first cause to "in a mesh, hull or geometry program" (f8a7a0b), since that case covers every stage but compute, pixel and vertex.
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
LakshanSivakumar/Native-Victory-macOS!118
No description provided.