Repository navigation
Conversation
It was untranslated (the isa_coverage census listed it as missing). Each active lane sends DATA0 to lane ((ADDR + offset) >> 2) & 31 of its own 32-lane half: in wave64 too, as measured on RDNA2 in native wave64 (xcl-dev#925, like ds_bpermute_b32 in xcl-dev#772). Of several senders the highest lane wins, a lane nobody sends to gets 0, inactive lanes neither send nor receive, and no LDS memory is used. Each lane looks at the 32 senders of its half in lane order, through the half-local lane read ds_swizzle uses, so the split wave64 form needs no exchange. In a wave64 VS / PS that may run in 32-lane waves the instruction is refused: the console wave's lanes 32..63 do not exist there. Tests: a GPU test against the measured model (reversal within halves, colliding senders, high address bits, offsets 8 and 128, inactive lanes) in wave32, wave64 and split wave64, and the refusal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Upstream PR xcl-dev#925 was closed or merged. |
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.
ds_permute_b32was untranslated (theisa_coveragecensus lists it as missing; no open PR or issue covers it). It is the forward form ofds_bpermute_b32. Each active lane sends DATA0 to lane((ADDR + offset) >> 2) & 31of its own 32-lane half, in wave64 too. That was measured on RDNA2 in native wave64 in the comments below (by @KENAJBBY and @certified-retart), and it matchesds_bpermute_b32in xcl-dev#772. Of several senders to one lane the highest-numbered one wins, a lane no active lane sends to gets 0, inactive lanes neither send nor receive, and no LDS memory is used.The first version of this PR (
874a9fd) took the target mod 64 and could send across the halves. It was wrong on the hardware, and its test agreed with it only because the reference model had the same mistake.What is in it
crates/xcl/src/gpu/recomp/emit.rs: each lane looks at the 32 senders of its half in lane order throughrla_half_fn, asds_swizzledoes, so the highest active sender wins. The split wave64 form needs no exchange. In a wave64 VS / PS that may run in 32-lane waves the instruction is refused: lanes 32..63 of the console wave don't exist there, andupper_lanesdoesn't model this instruction's writes to them.crates/xcl/src/gpu/recomp/tests.rs:gpu_ds_permute_b32compares against the measured model in wave32, wave64 and split wave64. The cases are a reversal (within each half), two senders per lane with high address bits set, offset 8 (wrapping in its half), offset 128 (the identity), and inactive senders and receivers.ds_permute_b32_refused_where_upper_lanes_do_not_existchecks the refusal, and that compute and non-split pixel modes translate. Against the first version's translation the GPU test fails:wave64 split=true lane 1: v10,left: 4158,right: 4126(lane 62's value where the hardware gives lane 30's).Tested
c3e3442, rebased ontomain6bac4b4stable-x86_64-pc-windows-msvc, debug, DXC 1.9.2602.17cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 721 passed, 0 failed, 41 ignoredgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware; noXCL_SAMPLE_*setRegression run
main:This PR:
Not tested
AI use
🤖 Generated with Claude Code
Mirror of xcl-dev#925 (auto-synced, do not edit).