shader: per-lane mask joins through joins of masks, or of data a region loads, are refused (22 compute programs) #434

Open
opened 2026-11-27 18:04:12 +00:00 by Tarraga · 2 comments
Tarraga commented 2026-11-27 18:04:12 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Tarraga on 2026-11-27T18:04:12Z.


What went wrong

Some compute programs are refused at a per-lane join of a lane mask, with "a lane-mask join of an untracked mask: a value the translation could not make" or "...: data, at a join of several edges". Three shapes are behind it:

  1. An edge brings a join of masks, not a tracked mask: a loop's back edge carries what an inner region left in the register (that region's compare for the lanes that ran it, the header's mask for the others).
  2. An edge whose lanes are in none of the masks the other edges bring, where those masks are joins of masks a region made. no_mask_lane_on_edge already gives 0 there when the other edges bring tracked masks, but not through joins.
  3. In wave32 compute, a region that some lanes skip reuses the mask's register for a constant-buffer or descriptor-table dword (s_buffer_load_dword, s_load_dword), and the code after the join reads the register as a mask again. The lanes coming along that edge read no mask from it.

On my own dump of the title's containers (19,127, Series S), main b998bb65 refuses 22 compute programs for these. Among them are 3 of the 7 ray-traced shadow traces (CS_RTShadowTrace32*: 534b3645dd344ab2, d50c03da6d935d87, ffd9788ba9fec033), which need all three shapes. The other 19 need only the first (0a5ecfee6b79e13b, 17af15c4015cb4b6, a53a7977fe762268 and others). In runs of our own branch, 10 of the 22 are bound in the world: the prop and tree batch culling, the irradiance cache's shading and the hair shadow masks. I haven't mapped them to the hashes of main's own runs, which differ.

VIctory-macOS handles the same shapes (6f8fe556). I plan to port its three arms onto main's join lowering (fill_phis), with a unit test for each that fails without it, and to sweep the corpus before and after. Shape 2 rests on the same reasoning as no_mask_lane_on_edge.

Steps to reproduce

  1. VICTORY_DUMP_ALL_SHADERS=1 VICTORY_DUMP_REFUSED=<folder> on a run, to get a corpus.
  2. cargo run --release -p victory-shader --example sweep -- <folder> -j 4 > main.tsv on main.
  3. Look for "a lane-mask join of an untracked mask" in the refused lines.

Mac, macOS version and commit

M4 Pro, 48 GB, macOS 27.0, commit b998bb65

Output or log

sweep: 19127 shaders: ok 19011 refused 116
20  a lane-mask join of an untracked mask: a value the translation could not make  [compute]
 2  a lane-mask join of an untracked mask: data, at a join of several edges        [compute]
(of the 22 that the three shapes fix; 4 other traces stay refused at later joins)
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6652065424 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/434). Originally posted by [Tarraga](https://github.com/Tarraga) on 2026-11-27T18:04:12Z. --- ### What went wrong Some compute programs are refused at a per-lane join of a lane mask, with "a lane-mask join of an untracked mask: a value the translation could not make" or "...: data, at a join of several edges". Three shapes are behind it: 1. An edge brings a join of masks, not a tracked mask: a loop's back edge carries what an inner region left in the register (that region's compare for the lanes that ran it, the header's mask for the others). 2. An edge whose lanes are in none of the masks the other edges bring, where those masks are joins of masks a region made. `no_mask_lane_on_edge` already gives 0 there when the other edges bring tracked masks, but not through joins. 3. In wave32 compute, a region that some lanes skip reuses the mask's register for a constant-buffer or descriptor-table dword (`s_buffer_load_dword`, `s_load_dword`), and the code after the join reads the register as a mask again. The lanes coming along that edge read no mask from it. On my own dump of the title's containers (19,127, Series S), main b998bb65 refuses 22 compute programs for these. Among them are 3 of the 7 ray-traced shadow traces (`CS_RTShadowTrace32*`: `534b3645dd344ab2`, `d50c03da6d935d87`, `ffd9788ba9fec033`), which need all three shapes. The other 19 need only the first (`0a5ecfee6b79e13b`, `17af15c4015cb4b6`, `a53a7977fe762268` and others). In runs of our own branch, 10 of the 22 are bound in the world: the prop and tree batch culling, the irradiance cache's shading and the hair shadow masks. I haven't mapped them to the hashes of main's own runs, which differ. VIctory-macOS handles the same shapes (6f8fe556). I plan to port its three arms onto main's join lowering (`fill_phis`), with a unit test for each that fails without it, and to sweep the corpus before and after. Shape 2 rests on the same reasoning as `no_mask_lane_on_edge`. ### Steps to reproduce 1. `VICTORY_DUMP_ALL_SHADERS=1 VICTORY_DUMP_REFUSED=<folder>` on a run, to get a corpus. 2. `cargo run --release -p victory-shader --example sweep -- <folder> -j 4 > main.tsv` on main. 3. Look for "a lane-mask join of an untracked mask" in the refused lines. ### Mac, macOS version and commit M4 Pro, 48 GB, macOS 27.0, commit b998bb65 ### Output or log ```text sweep: 19127 shaders: ok 19011 refused 116 20 a lane-mask join of an untracked mask: a value the translation could not make [compute] 2 a lane-mask join of an untracked mask: data, at a join of several edges [compute] (of the 22 that the three shapes fix; 4 other traces stay refused at later joins) ```
Tarraga commented 2026-11-27 18:04:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Tarraga on 2026-11-27T18:04:20Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7225091287 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/434#issuecomment-7225091287). Originally posted by [Tarraga](https://github.com/Tarraga) on 2026-11-27T18:04:20Z. --- /claim
github-actions[bot] commented 2026-11-27 18:04:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T18:04:30Z.


Claimed by @Tarraga. Open a draft pull request with Refs #434 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7225094557 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/434#issuecomment-7225094557). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T18:04:30Z. --- Claimed by @Tarraga. Open a draft pull request with `Refs #434` in its description within 24 hours, or the claim expires.
Sign in to join this conversation.
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#434
No description provided.