shader: lower v_permlanex16_b32 #404
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!404
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/404/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@NolanCotter on GitHub · 2026-11-24 02:57 UTC · original
NolanCotter:permlanex16-b32→main· +93 −0 · 1 files · 1 commits · closed without mergingSummary
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 #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
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>@jeremygold02 on GitHub · 2026-11-24 04:32 UTC · original
Thanks @NolanCotter for adding
v_permlanex16_b32lowering. I tested headd505b0e4c5e3d29a7d027e639d70651386f71b2awith: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.
@Lyrnc on GitHub · 2026-11-24 06:02 UTC · original
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
v_permlanex16_b32 vD, v4, s20, s21with laneiholdingi + 1. There are 16 selectors (identity, reverse, all-0, all-F, a pair swap, 11 random), in wave32 and wave64 kernels, withoutop_sel, all lanes active. RDNA2 desktop silicon, not the console's. No game data.Lane
ireads lane(i & ~31) | ((i & 16) ^ 16) | nibble_(i & 15)({src2, src1}), that is, the other row of its own 32-lane half: 16/16 selectors in wave32 and 16/16 in wave64. The same run checkedv_permlane16_b32(own row) for #576, also 32/32.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.
@slint6614-dev on GitHub · 2026-11-24 10:42 UTC · original
Measured on the full retail shader pack (26,503 containers) with
victory translate --validate --pipelines(pipelines on an AMD RX 9070, Windows 11, dxil.dll from SDK 10.0.26100). Counts are emitted / validated / pipelines. Merged locally with current mainc7a5f49(main: CS 1440 / 1417).CS 1441 / 1418 (+1 validated); VS/PS and MS unchanged.
@MichaelSmithAI on GitHub · 2026-11-24 10:52 UTC · original
We ran the DXIL emitted by
d505b0eon an RTX 4090 under Wine/vkd3d-proton 3.2. For an all-active Wave32 guest, laneiheld29 + iand the two selector words were0x5312e4b0and0x98fc6ad7. All 32 output words matched the cross-row rule measured on RDNA2 above. For example, lanes 0 and 16 returned 45 and 29, and lanes 1 and 17 returned 56 and 40. Microsoft DXV accepted the emitted shader.A separate 64-thread Wave64 guest fixture also validated, but the emitted shader requested
WaveSize=64. This adapter advertises only 32, so pipeline creation was refused and no Wave64 result was recorded. These controls used synthetic inputs; the single newly validated title program in the RX 9070 report has no pixel or buffer readback here.@Marvisak on GitHub · 2026-11-25 00:02 UTC · original
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.
Pull request closed