victory-shader: lower v_permlane16_b32 and v_permlanex16_b32 #1014
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!1014
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1014/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?
@bartikele on GitHub · 2026-11-24 15:03 UTC · original
bartikele:shader-permlane16→main· +51 −1 · 1 files · 1 commits · closed without mergingAdds DXIL lowering for \_permlane16_b32\ and \_permlanex16_b32\ in \ictory-shader:
Verified with \cargo clippy -p victory-shader --all-targets --locked -- -D warnings, \cargo test -p victory-shader --locked, \cargo xtask policy, and \ictory translate --validate.
@Zipettte on GitHub · 2026-11-24 15:40 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
9d1c299:cargo test -p victory-shaderpasses, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@shortselow-byte on GitHub · 2026-11-24 15:51 UTC · original
This PR has no CI run yet, so I ran the CI's checks at head
9d1c299(onmainffe310e): Windows 11, Rust 1.98.1 MSVC, AMD Radeon RX 6900 XT (RDNA2).cargo test --workspace --locked -- --test-threads=1: 343 passed, 0 failed (GPU tests on the AMD device and WARP).cargo clippy --workspace --all-targets --locked -- -D warnings, and with--all-features: clean.cargo xtask policy: ok.Review of the lowering against the ISA's description: the 4-bit select per lane (lanes 0-7 from
s1, 8-15 froms2), the own row forv_permlane16_b32and the other row of the 32-lane pair forv_permlanex16_b32all look right to me.Two things I could not confirm:
op_selis not read. On these two opcodes it carriesFI(op_sel[0]) andBOUND_CTRL(op_sel[1]), which decide what a lane gets when its source lane is inactive. With every lane active it makes no difference; with inactive source lanes,waveReadLaneAtreturns whatever the host gives.permlane16_lowersonly checks that the instruction lowers, not the lanes it reads.valu_testsruns one thread, so a result check would need a multi-lane harness likewaterfall_tests.@Marvisak on GitHub · 2026-11-25 00:32 UTC · original · edited 2026-11-25 12:17 UTC
Automated triage for the maintainers.
Proposed close: superseded by #1737. Thanks for the rebase. It now merges cleanly, and CI
checkpasses atc5d3a9a.#1737 is built on this PR's own commit (
9d1c299), so your lowering is kept there with your authorship. It adds the two things this branch is still missing:op_selhandling:FIandBOUND_CTRL, which decide what a lane gets when its source lane is inactive. Here,op_selis ignored in the new arm inLower(crates/victory-shader/src/emit/lower.rs).emit/permlane_tests.rs) that checks which lanes are read. Here,permlane16_lowersonly checks that the instruction lowers.#1737 also merges cleanly and is marked as a merge candidate. The lane selection in both PRs matches what
mainalready assumes inemit/wave.rs.This PR will be closed in 48 hours unless you push a change or a maintainer removes the
triage: proposed closelabel.Generated by Claude Code
@bartikele on GitHub · 2026-11-25 11:58 UTC · original
Rebased onto current main (
940d32f, resolving the test-list merge conflict in crates/victory-shader/src/emit/lower.rs) and extended permlane16_lowers to cover both _permlane16_b32 (@bartikele on GitHub · 2026-11-25 16:28 UTC · original
Closing in favor of #1737, which builds on commit
9d1c299(preserving authorship) and adds the missing EXEC/FI/BOUND_CTRL handling and multi-lane tests. Thanks everyone for the reviews!Pull request closed