Shaders: with pair meetings, a 16-bit wave sum goes on in the block after each exchange of the halves (on #3683) #3824

Open
redNSF wants to merge 86 commits from upstream-pr/3824 into main
redNSF commented 2026-11-29 07:46:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by redNSF on 2026-11-29T07:46:02Z.


Stacked on #3683 (pair meetings, itself on #439); the last commit is this change. It does not depend on #3759 or #3823 (also on #3683); the three merge without conflicts.

Problem. The f16 sum of a whole console wave (Shape::Half in Lower::shape) exchanges the two halves' sums, then takes the console wave's ballot (console_ballot) and reads a lane across the halves (console_read_lane). With pair meetings each of these exchanges is a meeting of the two halves, and the code after a meeting goes on in a new block (Lower::cur). The sum kept the block it began in, so the ballot's exchange was asked for outside the block being lowered and the program was refused: "an exchange of the halves outside the block being lowered".

Change. The sum takes self.cur again after each exchange, as the other wave reductions in shape already do. Without pair meetings an exchange does not change the block, so the code for groups of one console wave is as before.

Effect. Grand Theft Auto VI, translate --list --host-lanes 32-32: compute programs that translate go from 2,619 (#3683) to 2,621 of 2,682; none are lost. The two gained are the two refused for this reason: compute_graph_ops:CS_TransposeVecMatMulOperation and CS_TransposeVecMatMulAlignedOperation.

Tests (RTX 3060, 32-lane waves only):

  • New half_sums_in_groups_of_several_console_waves (split_tests): the program of half_sum_and_packed_lane_cross_host_halves in groups of two and four console waves. Every console wave sums its own lanes, over the whole wave and over its lanes below 40, and tags the sum with its own lane 31 or 63. It translates for a 32-lane target anywhere (refused before, with the reason above) and is exact on the card, 128 and 256 threads, two groups each.
  • cargo test -p victory-shader --lib on WARP: the same 4 synthetic_tests fail here as on #3683 alone.

Not run in the title: this PR claims that the two programs translate and that the sum behaves as the test checks on this card.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5548743392 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3824). Originally posted by [redNSF](https://github.com/redNSF) on 2026-11-29T07:46:02Z. --- Stacked on #3683 (pair meetings, itself on #439); the last commit is this change. It does not depend on #3759 or #3823 (also on #3683); the three merge without conflicts. **Problem.** The f16 sum of a whole console wave (`Shape::Half` in `Lower::shape`) exchanges the two halves' sums, then takes the console wave's ballot (`console_ballot`) and reads a lane across the halves (`console_read_lane`). With pair meetings each of these exchanges is a meeting of the two halves, and the code after a meeting goes on in a new block (`Lower::cur`). The sum kept the block it began in, so the ballot's exchange was asked for outside the block being lowered and the program was refused: "an exchange of the halves outside the block being lowered". **Change.** The sum takes `self.cur` again after each exchange, as the other wave reductions in `shape` already do. Without pair meetings an exchange does not change the block, so the code for groups of one console wave is as before. **Effect.** Grand Theft Auto VI, `translate --list --host-lanes 32-32`: compute programs that translate go from 2,619 (#3683) to 2,621 of 2,682; none are lost. The two gained are the two refused for this reason: `compute_graph_ops:CS_TransposeVecMatMulOperation` and `CS_TransposeVecMatMulAlignedOperation`. **Tests** (RTX 3060, 32-lane waves only): - New `half_sums_in_groups_of_several_console_waves` (`split_tests`): the program of `half_sum_and_packed_lane_cross_host_halves` in groups of two and four console waves. Every console wave sums its own lanes, over the whole wave and over its lanes below 40, and tags the sum with its own lane 31 or 63. It translates for a 32-lane target anywhere (refused before, with the reason above) and is exact on the card, 128 and 256 threads, two groups each. - `cargo test -p victory-shader --lib` on WARP: the same 4 `synthetic_tests` fail here as on #3683 alone. Not run in the title: this PR claims that the two programs translate and that the sum behaves as the test checks on this card. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3824:upstream-pr/3824'
git switch 'upstream-pr/3824'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3824'
git switch 'upstream-pr/3824'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3824'
git switch 'upstream-pr/3824'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3824'
git switch 'main'
git merge --squash 'upstream-pr/3824'
git switch 'main'
git merge --ff-only 'upstream-pr/3824'
git switch 'main'
git merge 'upstream-pr/3824'
git push origin 'main'
Sign in to join this conversation.
No reviewers
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
Marvisak/VIctory!3824
No description provided.