Skip to content

fix(shader): refuse predication of v_writelane_b32 regions and gate Windows-only halves tests - #509

Closed
qorile wants to merge 1 commit into
pragyaangaur:mainfrom
qorile:fix/predicate-writelane-and-halves-tests
Closed

qorile wants to merge 1 commit into
pragyaangaur:mainfrom
qorile:fix/predicate-writelane-and-halves-tests

Conversation

@qorile

@qorile qorile commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Testing

  • cargo test -p victory-shader on macOS: 270 passed, 0 failed, 2 ignored (+ 3 passed in resource_tracking).
  • cargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings (with and without --all-features): clean.
  • cargo xtask policy: passed (283 files ok).
  • Note: Wine/D3DMetal GPU execution was not run on this machine.

…indows-only halves tests (pragyaangaur#497)

On hardware, v_writelane_b32 ignores EXEC, so a write inside a divergent branch still updates the target lane even if that lane is inactive in the branch. Linearizing such a region via SkipGuard, SESE diamond, or lockstep-loop predication causes the merge select(edge_act, ...) to discard the write when the target lane was inactive (pragyaangaur#497).

- Refuse predication in match_skip_guard, match_sese_diamond, and match_lockstep_loop when any block in the region contains v_writelane_b32, allowing pragyaangaur#435's whole-wave retry to handle it.
- Gate Windows-only GPU execution helpers/tests in halves_tests.rs with #[cfg(windows)] so cargo test -p victory-shader builds and passes natively on macOS.
- Add regression test predicated_branch_refuses_writelane_so_whole_wave_retry_can_take_it.
@pragyaangaur

Copy link
Copy Markdown
Owner

Thank you, and thanks for the test. #506 landed a few minutes earlier with the same fix for #497's writelane case (a lane write in a predicated block is refused so the whole-wave retry takes it), plus the Windows gate of the halves tests, so this one now overlaps it. I am closing it as superseded. If the not-predicating-the-region approach catches a program that the refusal in #506 does not, please send it as a small PR with that program as a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants