Repository navigation
feat(shader): pass 16-bit wave64 sums between 32-lane halves - #425
Merged
pragyaangaur merged 1 commit intoNov 27, 2026
Merged
Conversation
A console wave64's f16 sum (`v_add_f16` reduced in each 32-lane half, then lanes 31 and 63 added) was refused on 32-lane hosts. In halves each host wave now sums its own lanes in f32, the two totals pass between the halves through `reduce_across`, and the result is rounded to f16 once, as the single-wave lowering does. The high half kept from lane `hi` is read across the halves too. Prepared with Codex Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Independent M4 Pro / D3DMetal 4.0 beta 3 check of high-half provenance and the #3342 composition. I extended earpjonathan’s exact #425 fixture by storing each thread index in the high half of its input, with the original FP16 bits in the low half.
Prepared and tested with Codex. |
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.
In halves (#180), a console wave64 runs as two host waves of 32 lanes. Its 16-bit float sums were still refused there with "a 16-bit wave reduction over both 32-lane halves". This PR passes them between the halves, as #360 did for the other reductions.
Changes
Shape::Halfin halves, where every lane of the group runs the section together (across_here):reduce_across(Op::AddHis added there, with 0 for a missing upper half);hi. That lane's ballot bit and value are now read across the halves (ballot_across_halves,read_lane_across), because on the upper host wave lanehibelongs to the other half.Tests (
halves_tests.rs)half_reductionis a console wave64 f16 sum of the thread id, built the way the compiler emits it: DPP within rows,v_permlanex16_b32across rows, then lanes 31 and 63 read and added.reductions_and_prefixes_pass_between_halveschecks three things:mainthis test fails with the old refusal.reductions_and_prefixes_across_halves_match_the_console_on_every_gpuruns the sum on every hardware adapter and compares each lane with the console's result, in groups of 32, 64, 96 (no upper half in the second console wave) and 128.victory-shader: 374 passed, 0 failed, 5 ignored.cargo test -p xtasknatively, where the asset policy runs: 7 passed, "asset policy: 262 files ok".cargo clippy --workspace --all-targets -- -D warnings, with and without--all-features, for x86_64-pc-windows-gnullvm.None of this ran in the game.
🤖 Generated with Claude Code, with Codex