Repository navigation
shader: lower v_permlanex16_b32 - #404
NolanCotter wants to merge 1 commit into
Conversation
Each lane reads src0 of a lane in the other row of 16 of its 32-lane
half, the pick taken from nibble i of the {src2, src1} selector. The
lowering mirrors the whole-wave model wave.rs already uses for the op,
through the same cross_lane/read_lane machinery as v_writelane_b32, and
the console_lanes detector now covers the v_permlane family so host
lanes are relabeled where the op appears.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Thanks @NolanCotter for adding Result: 1 passed, 0 failed (69 filtered out). The synthetic wave test verifies the instruction reads the selected lane from the other 16-lane row. It checks the lowering model, not behavior in an executing title. |
mercuryVM
left a comment
There was a problem hiding this comment.
Tested d505b0e on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (265 passed, 0 failed). victory translate <title exe> --validate --pipelines gives the same counts before and after: 12 of 12 programs emitted, 12 validated, 12 pipelines. The 12 embedded programs are vertex and pixel only, so they don't use this op.
- I checked the index math against the RDNA2 definition:
- The selector nibble for lane
iis(i & 15) * 4bits into{src2, src1}, and& 31after picking the word gives the right shift for nibbles 8–15. (lane & ~31) | ((lane & 16) ^ 16) | pickaddresses the other row of the same 32-lane half.
- The selector nibble for lane
- Refusing
op_sel != 0is the right call. For permlane, op_sel[0] and op_sel[1] are FI and BOUND_CTRL, which this lowering does not model. - One semantic gap, not blocking: with FI=0, a lane whose source lane is inactive keeps its old
vdston hardware, butread_lanereturns the inactive lane's value. That only matters for partially active waves. - The new test checks that the program lowers, but not the values it produces. A
run_casestest invalu_tests.rswith a non-identity selector would also check the lanes on hardware and WARP.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
RDNA2 hardware check of the lane rule: matches. AMD Radeon iGPU of a Ryzen 7 9800X3D, gfx1036 (RDNA2), AMD driver 32.0.21042.62, Windows 11 Pro 26200. A HIP kernel (assembled by the AMD driver's amd_comgr) runs Lane AI use: Claude Code (Claude Opus 5.5) wrote the probes, ran them on the GPU above and drafted this comment; the numbers come from the hardware run. |
|
Measured on the full retail shader pack (26,503 containers) with CS 1441 / 1418 (+1 validated); VS/PS and MS unchanged. |
|
We ran the DXIL emitted by A separate 64-thread Wave64 guest fixture also validated, but the emitted shader requested |
catminou4
left a comment
There was a problem hiding this comment.
Test-merge with current main (ffe310e) conflicts — needs a rebase. Main moved recently (PR #566 waterfall loops touched lower.rs/resource.rs/valu_tests.rs), so shader PRs opened before it need rebasing. I'll re-review once it merges cleanly.
|
Automated triage for the maintainers. Closing because another open pull request covers the same change. See #1014. v_permlanex16_b32 through waveReadLaneAt; #1014 lowers it and v_permlane16_b32 with the same lane math in one change, without the three-PR stack. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
Summary
v_permlanex16_b32invalu_op: each lane readssrc0of a lane in the other row of 16 of its 32-lane half, the pick taken from nibbleiof the{src2, src1}selector — the same mathwave.rsalready uses to model the op, built through thecross_lane/read_lanemachineryv_writelane_b32uses.v_permlane16_b32(same row, PR Shaders: model v_permlane16_b32 in whole-wave sections #98's wave.rs model) stays refused; a follow-up can share this arm's index math.console_lanesdetector now covers thev_permlanefamily so a compute program using the op gets console lane relabeling.opsel != 0is rejected rather than silently ignored.v_permlanex16_b32feeding an LDS store); it failed on main with the write missing and passes now.Test plan
cargo test -p victory-shader— 57 passed (was 56 + 1 failing before the fix)cargo clippy -p victory-shader— cleancargo fmt --check— cleanAI-assisted change (Devin). Verified against the lane math already in
emit/wave.rs; no game shaders were used.Generated with Devin