victory-shader: lower v_permlane16_b32 and v_permlanex16_b32 #1014

Closed
github-bot wants to merge 1 commit from gh-pr/1014/head into gh-pr/1014/base
Owner

@⁠bartikele on GitHub · 2026-11-24 15:03 UTC · original
bartikele:shader-permlane16 → main · +51 −1 · 1 files · 1 commits · closed without merging

Adds DXIL lowering for \ _permlane16_b32\ and \ _permlanex16_b32\ in \ ictory-shader:

  • Marks both instructions for \console_lanes\ so host lane order matches the console.
  • Checks \cross_lane(false)\ and lowers via \dx.op.waveGetLaneIndex\ + \dx.op.waveReadLaneAt.i32.
  • Includes unit test \permlane16_lowers.

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.

**@⁠bartikele** on GitHub · 2026-11-24 15:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/1014) `bartikele:shader-permlane16` → `main` · +51 −1 · 1 files · 1 commits · closed without merging Adds DXIL lowering for \ _permlane16_b32\ and \ _permlanex16_b32\ in \ ictory-shader\: - Marks both instructions for \console_lanes\ so host lane order matches the console. - Checks \cross_lane(false)\ and lowers via \dx.op.waveGetLaneIndex\ + \dx.op.waveReadLaneAt.i32\. - Includes unit test \permlane16_lowers\. 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\.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:17:06 +00:00
github-bot closed this pull request 2026-11-26 04:17:06 +00:00
Author
Owner

@⁠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-shader passes, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 15:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/1014#issuecomment-7136420825) 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-shader` passes, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠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 (on main ffe310e): 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 from s2), the own row for v_permlane16_b32 and the other row of the 32-lane pair for v_permlanex16_b32 all look right to me.

Two things I could not confirm:

  • op_sel is not read. On these two opcodes it carries FI (op_sel[0]) and BOUND_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, waveReadLaneAt returns whatever the host gives.
  • permlane16_lowers only checks that the instruction lowers, not the lanes it reads. valu_tests runs one thread, so a result check would need a multi-lane harness like waterfall_tests.
**@⁠shortselow-byte** on GitHub · 2026-11-24 15:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/1014#issuecomment-7136733278) This PR has no CI run yet, so I ran the CI's checks at head `9d1c299` (on `main` `ffe310e`): 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 from `s2`), the own row for `v_permlane16_b32` and the other row of the 32-lane pair for `v_permlanex16_b32` all look right to me. Two things I could not confirm: - `op_sel` is not read. On these two opcodes it carries `FI` (`op_sel[0]`) and `BOUND_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, `waveReadLaneAt` returns whatever the host gives. - `permlane16_lowers` only checks that the instruction lowers, not the lanes it reads. `valu_tests` runs one thread, so a result check would need a multi-lane harness like `waterfall_tests`.
Author
Owner

@⁠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 check passes at c5d3a9a.

#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_sel handling: FI and BOUND_CTRL, which decide what a lane gets when its source lane is inactive. Here, op_sel is ignored in the new arm in Lower (crates/victory-shader/src/emit/lower.rs).
  • A multi-lane test (emit/permlane_tests.rs) that checks which lanes are read. Here, permlane16_lowers only checks that the instruction lowers.

#1737 also merges cleanly and is marked as a merge candidate. The lane selection in both PRs matches what main already assumes in emit/wave.rs.

This PR will be closed in 48 hours unless you push a change or a maintainer removes the triage: proposed close label.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/1014#issuecomment-7148623103) · edited 2026-11-25 12:17 UTC <!-- victory-triage v1 head=c5d3a9a54ce3943fa3d40fc82daf45ce3cee4f47 verdict=proposed-close at=2026-11-25T12:21:00Z --> Automated triage for the maintainers. **Proposed close: superseded by #1737.** Thanks for the rebase. It now merges cleanly, and CI `check` passes at `c5d3a9a`. #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_sel` handling: `FI` and `BOUND_CTRL`, which decide what a lane gets when its source lane is inactive. Here, `op_sel` is ignored in the new arm in `Lower` (`crates/victory-shader/src/emit/lower.rs`). - A multi-lane test (`emit/permlane_tests.rs`) that checks which lanes are read. Here, `permlane16_lowers` only checks that the instruction lowers. #1737 also merges cleanly and is marked as a merge candidate. The lane selection in both PRs matches what `main` already assumes in `emit/wave.rs`. This PR will be closed in 48 hours unless you push a change or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠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 11:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/1014#issuecomment-7161747756) 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 (
Author
Owner

@⁠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!

**@⁠bartikele** on GitHub · 2026-11-25 16:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/1014#issuecomment-7168028909) 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

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1014
No description provided.