Shaders: keep 64-lane waves for wave64 programs on a 64-lane host #92
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!92
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/92/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@dutch2005 on GitHub · 2026-11-25 13:49 UTC · original
fix/shader-wave64-attribute→main· +33 −1 · 1 files · 1 commits · closed without mergingWhy
A wave64 compute program on a host that can run 64-lane waves was only given a
WaveSizeattribute when it also needed console lanes or one-wave LDS. Otherwise the AMD driver may choose 32-lane waves, and a scalar counted in a divergent loop then differs between the halves.Reproduced on an RX 6700 XT (RDNA2, Windows 11):
cargo test -p victory-shader --libfailsemit::valu_tests::scalar_counted_in_a_divergent_loop_read_after_it(lanes 0-31 count 32, lanes 32-63 count 64)emit::valu_tests::scalar_counted_in_nested_divergent_loops(same split)This is the same finding as the comment on issue #2 from the RX 6950 XT machine.
What
When
native.wave64 && target.runs(64), sets.wave_size = Some(64)even if the program does not need console lanes. The console's wave is then requested from the driver instead of leaving it to pick 32.Testing
cargo test -p victory-shader scalar_counted_in_ -- --test-threads=1on the RX 6700 XT — 2 passed, 0 failed (both were failing before).cargo test -p victory-shader --lib -- --test-threads=1on the RX 6700 XT — 269 passed, 0 failed, 6 ignored with the other shader PRs applied.7a592ebon the integrated Radeon of a Ryzen 9 9900X: 271 enabled shader tests passed with #68 and #92 together, and the new CPU test passed. On WARP the fix alone fails pipeline creation with "The parameter is incorrect"; with #68 both pipelines are created but the counts are still wrong (their fixtures differ onTarget::ANYvshost.target()). Hardware behaviour is the target of this PR; WARP remains a known caveat.wants_wave_sizehelper with a table test;cargo-mutants --in-diffgenerated 9 mutants, 9 caught. Before the extraction the tool generated no mutants insideLower::new.Risk
This is broader than the two tests: every wave64 program on a 64-lane-capable host now asks for 64-lane waves. That is the console's wave size, but it may change compile times and which AMD-compiler pipelines crash. It does not affect 32-lane-only hosts (the
runs(64)guard). A title run on the RX 9070 XT is still needed before relying on it.@MamaLeVrai on GitHub · 2026-11-25 14:01 UTC · original
Tested on the machine the finding came from (RX 6950 XT, Windows 11 build 26300, Rust 1.98.1): this PR merged on
main71652a2(headb3da5ef, no conflict),cargo test --release -p victory-shader --lib.main71652a2scalar_counted_in_a_divergent_loop_read_after_it,scalar_counted_in_nested_divergent_loops)One run of each of the three gave no result line (on
mainthe second, with this PR the third): the test binary ofvictory-shaderdies now and then on this machine (run directly on the tree of #68 it exited with 139 in 3 of 6 runs), and I have not looked into why. So these are 2 + 2 results, not 3 + 3. Not run in the game.harness machine: rx6950xt-w11 | AMD Radeon RX 6950 XT (RDNA2), driver 32.0.21045.29003 | 32 GB RAM | Windows 11 build 26300
AI-assisted (Claude Code); no game data.
@ySKELLETONX on GitHub · 2026-11-25 16:35 UTC · original
Tested on an RX 7600 XT 16 GB (RDNA3, Navi 33), driver 32.0.32015.2008, Windows 11 Pro build 26300, Rust 1.98.1, at
7a592eb:cargo test -p victory-shader --lib --locked: 267 passed, 0 failed, 6 ignored, hardware dispatch tests included (mainat01aadd1: 266 passed). Workspace tests only; not run in the title.Pull request closed