Repository navigation
fix(shader): translate two wave64 compute shapes on 32-lane hosts again - #593
Merged
pragyaangaur merged 6 commits intoNov 28, 2026
Merged
Conversation
A wave reduction after a loop the lanes leave one by one was refused in halves since pragyaangaur#408: its half-wave analysis took a lane as possibly leaving at a capped back edge's iteration limit, both in the step analysis and through a virtual exit in `branch_regions`, so everything after such a loop looked divergent. pragyaangaur#506 made the matching `s_barrier` refusal opt-in (`VICTORY_CAP_BARRIERS=1`); the halves pass values through group barriers too, so the cap-escape analysis now follows the same switch. Off, the cap is taken as never reached where the loop has a way out of its own, as the console runs every loop to its end; a closed loop keeps its virtual exit. Tests run with the refusal on unless they turn it off. In whole-wave halves (pragyaangaur#435), a branch both of whose targets are loop back edges (two nested loops sharing a latch) was refused. Each side now gets a block of its own that counts its loop's iteration and leaves the program at the limit, as an unconditional back edge does (`lower/back_edges.rs`). Tests: synthetic programs for both shapes, checked against the console on the host GPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
A note for merging: Claude Code (Claude Opus 5.5). |
This was referenced Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two wave64 compute shapes have been refused on hosts of 32-lane waves (D3DMetal) since recent changes. Each refusal dropped a program's dispatches every frame. This makes both translate again, with a synthetic test for each.
A wave reduction after a loop the lanes leave one by one (
a1bf269d5b19f025, refused at 0x1d4 as "a wave reduction over both 32-lane halves")bf99e72. fix(shader): account for generated loop-cap returns in barrier and half-wave analyses #408 then refused it at ans_barrierafter a capped loop. Once Fix the black world from the loop-cap barrier refusal and two merge slips #506 made that barrier refusal opt-in (VICTORY_CAP_BARRIERS=1), it was refused at the reduction instead.step_and_cap) and a virtual exit per capped latch inbranch_regions. So every block after such a loop looks divergent, and the halves may not pass each other the reduction's totals there.s_barrierthat Fix the black world from the loop-cap barrier refusal and two merge slips #506 keeps by default. Both parts of the analysis now follow the same switch. With it off, the cap is taken as never reached in a loop that has a way out of its own, since the console runs every loop to its end. A closed loop keeps its virtual exit. Tests run with the refusal on unless they turn it off.A branch both of whose targets are loop back edges (
fdd56d97a806bcca, refused at 0x93c as "a wave64 branch with two loop back edges")lower/back_edges.rs.cbf9b65f2249ba96also translates now. Its per-lane translation was refused through the same cap analysis, and the whole-wave retry then refused a gather in it.Tests
halves_tests.rs:WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=b" tools/macos/test-wine.sh -p victory-shader --no-fail-fast: 481 passed, 0 failed, 5 ignored.cargo test -p xtaskpassed, andcargo xtask policyreports 299 files ok.x86_64-pc-windows-gnullvm --workspace --all-targets -- -D warnings, with and without--all-features: clean.6b82bc7d22016cb5is still refused, now for "no group-shared memory left" at 0x36fc.In game (M5 Pro, 48 GB, macOS 27.0.1, CrossOver 26.3 Wine with the repo's patches, D3DMetal 4.0 beta 3, Series X, a scripted opening run cold and then warm; figures from the warm run)
a1bf269d5b19f025,fdd56d97a806bccaandcbf9b65f2249ba96translate in both runs. 35 compute programs are refused, against 38 on maina31fcca1.a31fcca1→ this branch:a1bf269d: 58 → 0fdd56d97: 58 → 0cbf9b65f: 2 → 0d1609d9dbuild, had a 385 ms median and 388 ms late. That is a different base, so the two runs are not directly comparable.🤖 Generated with Claude Code