victory-shader: lower v_permlane16_b32 and v_permlanex16_b32 #1014
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1014"
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?
Imported from Marvisak/VIctory. Originally posted by bartikele on 2026-11-24T15:03:18Z.
Adds 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.
Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T15:40:25Z.
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).
Imported from Marvisak/VIctory. Originally posted by shortselow-byte on 2026-11-24T15:51:35Z.
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.Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T16:28:56Z.
Review: APPROVED
v_permlane16_b32 + v_permlanex16_b32 lowering: 16-lane row semantics check out (base = row aligned to 16, or 32 with bit-4 flipped for the x16 form; nibble selector from S1/S2 by lane bit 3; shift = (lane&7)*4; pick & 15). Also adds both ops to the cross-lane mask guard, which #1134 lacks. Includes a lowering smoke test. Local verification: macOS arm64, rustc 1.98.1, PR head merged into main
ffe310e,cargo test -p <crate> --locked. Shader execution tests (valu_tests/host) are#[cfg(all(test, windows))], so macOS covers lowering/decode/unit tests only. victory-shader: 97 passed, 0 failed. Note: supersedes #1134, which implements only the x16 form without the guard entry or test.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:32:57Z.
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
upstream-sync referenced this pull request2026-11-25 04:06:59 +00:00
Imported from Marvisak/VIctory. Originally posted by bartikele on 2026-11-25T11:58:17Z.
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 (Imported from Marvisak/VIctory. Originally posted by bartikele on 2026-11-25T16:28:06Z.
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