Shader: split per lane instead of dropping a program whose wave-wide SCC branch no form can take (#80) #81

Closed
github-bot wants to merge 1 commit from gh-pr/81/head into gh-pr/81/base
Owner

@⁠Hasusmogus on GitHub · 2026-11-27 09:57 UTC · original
Hasusmogus:lane-split-fallback → main · +117 −2 · 4 files · 1 commits · closed without merging

For #80 (and possibly the same +0x23cf683 write to null in #39 and #69).

Since #66 (9a4aa8d, bd8b4f5) a branch on a mask operation's SCC is taken wave-wide (wave_scc), which needs every lane of the console wave where it stands. A program none of whose forms gives it that is refused with a wave-wide branch where not every lane runs, and its dispatches are dropped. In #80 that is ff6fdf23ce0b9048, logged right before the write to 0 while loading the boat cutscene, which fits the title reading something the dropped dispatch should have written as a pointer.

This PR translates such a program once more with those branches split per lane, as before #66 (structure::with_per_lane, a thread-local the whole retry chain sees, so every form is structured that way). That is inexact where an arm runs lanes whose own bit went the other way, but the program runs, as it did before #66.

  • Only for that refusal (lower::WAVE_WIDE_ELSEWHERE) and only for programs that have such branches; everything else is untouched.
  • If the per-lane form fails too, the exact form's refusal is returned.
  • VICTORY_LANE_SPLIT=exact refuses as before; VICTORY_WAVE_WHY=1 logs when the fallback is used.

Tested

  • New test a_wave_wide_scc_branch_no_form_can_take_falls_back_to_the_per_lane_split: the issue's branch fixture behind an execz skip that without_skips must keep (the skipped code sets s20, which the code after the join stores). The exact forms refuse it with WAVE_WIDE_ELSEWHERE; emit now translates it.
  • On an RTX A3000 (waves of 32) through vkd3d-proton: the whole victory-shader suite gives 303 passed (main's 302 plus the new test), with the same single vkd3d-proton failure (stub_pipeline_is_created). both_halves_observe_the_same_mask_scc_on_a_wave32_device (the #66 and #78 readbacks) still passes: the fallback does not reach programs the exact form takes.
  • Clippy --workspace --all-targets [--all-features] -D warnings clean.
  • Not tested in the title: whether this is what stops the #80 crash needs a run to the boat cutscene. With VICTORY_WAVE_WHY=1 the log says whether ff6fdf23ce0b9048 took the fallback.

🤖 Generated with Claude Code

**@⁠Hasusmogus** on GitHub · 2026-11-27 09:57 UTC · [original](https://github.com/DoubleGhosty/cool_fox/pull/81) `Hasusmogus:lane-split-fallback` → `main` · +117 −2 · 4 files · 1 commits · closed without merging For #80 (and possibly the same `+0x23cf683` write to null in #39 and #69). Since #66 (`9a4aa8d`, `bd8b4f5`) a branch on a mask operation's SCC is taken wave-wide (`wave_scc`), which needs every lane of the console wave where it stands. A program none of whose forms gives it that is refused with `a wave-wide branch where not every lane runs`, and its dispatches are dropped. In #80 that is `ff6fdf23ce0b9048`, logged right before the write to 0 while loading the boat cutscene, which fits the title reading something the dropped dispatch should have written as a pointer. This PR translates such a program once more with those branches split per lane, as before #66 (`structure::with_per_lane`, a thread-local the whole retry chain sees, so every form is structured that way). That is inexact where an arm runs lanes whose own bit went the other way, but the program runs, as it did before #66. - Only for that refusal (`lower::WAVE_WIDE_ELSEWHERE`) and only for programs that have such branches; everything else is untouched. - If the per-lane form fails too, the exact form's refusal is returned. - `VICTORY_LANE_SPLIT=exact` refuses as before; `VICTORY_WAVE_WHY=1` logs when the fallback is used. ## Tested - New test `a_wave_wide_scc_branch_no_form_can_take_falls_back_to_the_per_lane_split`: the issue's branch fixture behind an `execz` skip that `without_skips` must keep (the skipped code sets `s20`, which the code after the join stores). The exact forms refuse it with `WAVE_WIDE_ELSEWHERE`; `emit` now translates it. - On an RTX A3000 (waves of 32) through vkd3d-proton: the whole `victory-shader` suite gives 303 passed (`main`'s 302 plus the new test), with the same single vkd3d-proton failure (`stub_pipeline_is_created`). `both_halves_observe_the_same_mask_scc_on_a_wave32_device` (the #66 and #78 readbacks) still passes: the fallback does not reach programs the exact form takes. - Clippy `--workspace --all-targets [--all-features] -D warnings` clean. - Not tested in the title: whether this is what stops the #80 crash needs a run to the boat cutscene. With `VICTORY_WAVE_WHY=1` the log says whether `ff6fdf23ce0b9048` took the fallback. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Since #66 a branch on a mask operation's SCC is the wave's (wave_scc)
and needs every lane where it stands. A program none of whose forms
gives it that was refused ("a wave-wide branch where not every lane
runs") and its dispatches dropped: #80's ff6fdf23ce0b9048, right before
the write to 0 at +0x23cf683 loading the boat cutscene, as if the title
read what the dispatch did not write back as a pointer.

Such a program is now translated once more with those branches split
per lane (structure::with_per_lane), as before #66: inexact where an arm
runs lanes whose own bit went the other way, but run. Only for that
refusal and only where there are such branches; VICTORY_LANE_SPLIT=exact
refuses it as before, VICTORY_WAVE_WHY=1 says when it is used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 10:46:09 +00:00
github-bot closed this pull request 2026-11-27 10:46:09 +00:00
Author
Owner

@⁠DoubleGhosty on GitHub · 2026-11-27 10:41 UTC · original

Applied to main as d2f23973 (authorship kept), with a4af70be on top, which adds VICTORY_LANE_SPLIT to the shader cache key so =exact runs and default runs don't share cached translations. Thanks!

**@⁠DoubleGhosty** on GitHub · 2026-11-27 10:41 UTC · [original](https://github.com/DoubleGhosty/cool_fox/pull/81#issuecomment-7216184773) Applied to main as `d2f23973` (authorship kept), with `a4af70be` on top, which adds `VICTORY_LANE_SPLIT` to the shader cache key so `=exact` runs and default runs don't share cached translations. Thanks!

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.