Shaders: "some lane is left" as a number, run on a host of 32-lane waves #1929

Open
github-bot wants to merge 1 commit from github-bot/gh-1929 into main AGit
Owner

@⁠DiosET3RN0 on GitHub · 2026-11-29 03:08 UTC · original
DiosET3RN0:wave32-some-lane-test → main · +47 −0 · 1 files · 1 commits · open

No issue.

What it changes

some_lane_of_a_mask_is_a_number_the_whole_wave_agrees_on lowers its program for waves of 64 only. On a card of 32-lane waves (every NVIDIA card) it prints "the hardware device does not take this program (waves of 64?) ... not run" and passes, so the 32-lane form of the same program, where the two halves exchange their answers in scc_some, is never run on a card.

This adds its twin, some_lane_of_a_mask_is_a_number_both_host_waves_agree_on, to emit/wave64_tests.rs (+47 lines, no change outside the test). It lowers the same program for waves of 32, asserts that the lowering did take waves of 32, validates the DXIL and runs it with the lane that waits in the low half (0, 5, 31), in the high half (32, 37, 63) and nowhere.

One thing differs from the original on purpose: every lane stores what it got at its own place and all 64 dwords are checked. With one shared dword a half that answered alone would only show when it happened to store last.

On a host of 64-lane waves the twin prints "not run" as the original does on 32-lane hosts, so between them both hosts are covered.

How it was tested

  • GPU and profile: RTX 4060 8 GB, driver 621.24, Windows 11, Rust 1.98.1, on main 568c5e5. Unit test on the hardware adapter; no game run (no game files on this machine).
  • Before: on this card the original prints "not run".
  • After: cargo test -p victory-shader --locked some_lane_of_a_mask -- --nocapture --test-threads=1: the twin prints "ran on the hardware device" and passes; the original still prints "not run".
  • Controls, each reverted: with scc_some returning the host wave's own answer (no exchange) the twin fails at "lane 32: lane 0 after 0 rounds" (1 for 0); with the two halves ORed as low with low it fails at "lane 0: lane 32 after 4 rounds".
  • For shader changes, the wave sizes tested: 32 lanes (the card's).
  • cargo test passed for the crates it touches: yes, for these tests; the whole victory-shader suite passed on this card at the same base for #1920 (396 passed).
  • Clippy: main stops at its own lower.rs:2356 (#1855); with that one lint allowed, cargo clippy -p victory-shader --all-targets --locked -- -D warnings reports nothing.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: none adds this twin; other open PRs touch wave64_tests.rs elsewhere (this one sits just before on_64_lanes).

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

**@⁠DiosET3RN0** on GitHub · 2026-11-29 03:08 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1929) `DiosET3RN0:wave32-some-lane-test` → `main` · +47 −0 · 1 files · 1 commits · open No issue. ## What it changes `some_lane_of_a_mask_is_a_number_the_whole_wave_agrees_on` lowers its program for waves of 64 only. On a card of 32-lane waves (every NVIDIA card) it prints "the hardware device does not take this program (waves of 64?) ... not run" and passes, so the 32-lane form of the same program, where the two halves exchange their answers in `scc_some`, is never run on a card. This adds its twin, `some_lane_of_a_mask_is_a_number_both_host_waves_agree_on`, to `emit/wave64_tests.rs` (+47 lines, no change outside the test). It lowers the same program for waves of 32, asserts that the lowering did take waves of 32, validates the DXIL and runs it with the lane that waits in the low half (0, 5, 31), in the high half (32, 37, 63) and nowhere. One thing differs from the original on purpose: every lane stores what it got at its own place and all 64 dwords are checked. With one shared dword a half that answered alone would only show when it happened to store last. On a host of 64-lane waves the twin prints "not run" as the original does on 32-lane hosts, so between them both hosts are covered. ## How it was tested - GPU and profile: RTX 4060 8 GB, driver 621.24, Windows 11, Rust 1.98.1, on `main` 568c5e5. Unit test on the hardware adapter; no game run (no game files on this machine). - Before: on this card the original prints "not run". - After: `cargo test -p victory-shader --locked some_lane_of_a_mask -- --nocapture --test-threads=1`: the twin prints "ran on the hardware device" and passes; the original still prints "not run". - Controls, each reverted: with `scc_some` returning the host wave's own answer (no exchange) the twin fails at "lane 32: lane 0 after 0 rounds" (1 for 0); with the two halves ORed as low with low it fails at "lane 0: lane 32 after 4 rounds". - For shader changes, the wave sizes tested: 32 lanes (the card's). - `cargo test` passed for the crates it touches: yes, for these tests; the whole `victory-shader` suite passed on this card at the same base for #1920 (396 passed). - Clippy: `main` stops at its own `lower.rs:2356` (#1855); with that one lint allowed, `cargo clippy -p victory-shader --all-targets --locked -- -D warnings` reports nothing. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: none adds this twin; other open PRs touch `wave64_tests.rs` elsewhere (this one sits just before `on_64_lanes`). AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
some_lane_of_a_mask_is_a_number_the_whole_wave_agrees_on lowers for
waves of 64 only, so on a card of 32-lane waves it prints "not run" and
the exchange of the two halves in scc_some is never run on a card.

Its twin lowers the same program for waves of 32 (and says so: the wave
size is asserted) and runs it with the lane that waits in the low half
(0, 5, 31) and in the high half (32, 37, 63). Every lane stores what it
got at its own place and all 64 are looked at, so a half that did not
hear of the other shows in its 32 dwords, whatever the order of the
stores.

No change outside the test.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 03:12:22 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-29 03:29 UTC · original · approved these changes

Tested locally merged onto main (568c5e5).

  • Merge: Clean merge in crates/victory-shader/src/emit/wave64_tests.rs.
  • Tests (RTX 5090, Wave32 host): cargo test -p victory-shader --lib emit::wave64_tests:: passed (29 passed; 0 failed, including the new some_lane_of_a_mask_is_a_number_both_host_waves_agree_on GPU execution test) with 0 warnings in wave64_tests.rs.

Good hardware regression test covering Wave32 execution of whole-wave mask-as-number agreement. LGTM.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-29 03:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1929#pullrequestreview-6101243980) · **approved these changes** Tested locally merged onto `main` (`568c5e5`). - **Merge**: Clean merge in `crates/victory-shader/src/emit/wave64_tests.rs`. - **Tests (RTX 5090, Wave32 host)**: `cargo test -p victory-shader --lib emit::wave64_tests::` passed (`29 passed; 0 failed`, including the new `some_lane_of_a_mask_is_a_number_both_host_waves_agree_on` GPU execution test) with 0 warnings in `wave64_tests.rs`. Good hardware regression test covering Wave32 execution of whole-wave mask-as-number agreement. LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠tupacfan04 on GitHub · 2026-11-29 06:25 UTC · original

Ran this on an RTX 5070 12 GB (driver 621.40, 32-lane waves, Windows 11), cherry-picked onto main e1f2eb6 plus #1939.

test emit::wave64_tests::some_lane_of_a_mask_is_a_number_the_whole_wave_agrees_on ... ok
test emit::wave64_tests::some_lane_of_a_mask_is_a_number_both_host_waves_agree_on ... ok
the hardware device does not take this program (waves of 64?): The parameter is incorrect.; not run
ran on the hardware device: both host waves agree on "some lane is left"

So on this card the original prints "not run" exactly as the description says, and the new twin really runs on the hardware device and passes. The per-lane store with all 64 dwords checked is the right call for catching a half that answers alone.

One small thing from reading it: if a later case in the loop cannot dispatch, the test returns quietly mid-loop, so a partial run would still read as a pass. A count of cases run in the final line would make that visible. Not blocking.

🤖 Generated with Claude Code

**@⁠tupacfan04** on GitHub · 2026-11-29 06:25 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1929#issuecomment-7251849087) Ran this on an RTX 5070 12 GB (driver 621.40, 32-lane waves, Windows 11), cherry-picked onto main `e1f2eb6` plus #1939. ``` test emit::wave64_tests::some_lane_of_a_mask_is_a_number_the_whole_wave_agrees_on ... ok test emit::wave64_tests::some_lane_of_a_mask_is_a_number_both_host_waves_agree_on ... ok the hardware device does not take this program (waves of 64?): The parameter is incorrect.; not run ran on the hardware device: both host waves agree on "some lane is left" ``` So on this card the original prints "not run" exactly as the description says, and the new twin really runs on the hardware device and passes. The per-lane store with all 64 dwords checked is the right call for catching a half that answers alone. One small thing from reading it: if a later case in the loop cannot dispatch, the test returns quietly mid-loop, so a partial run would still read as a pass. A count of cases run in the final line would make that visible. Not blocking. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@⁠upipibi on GitHub · 2026-11-29 20:57 UTC · original · edited 2026-11-29 23:08 UTC

Test report for #1929 (head 15aa188b), merged onto main 568c5e5d, on RTX 30. Synthetic tests only: no title run, no game files.

Setup: RTX 3070, driver 621.40, Windows 11 (10.0.26100), rustc 1.98.1. Every step logged the GPU and driver from nvidia-smi.

Key test: emit::wave64_tests::some_lane_of_a_mask_is_a_number_both_host_waves_agree_on, 3 runs on the card and 3 with VICTORY_WARP=1.

  • On the card, 3/3: ran on the hardware device: both host waves agree on "some lane is left".
  • With VICTORY_WARP=1, 3/3: the hardware device does not take this program (waves of 64?): The parameter is incorrect.; not run. The test returns ok there without checking anything, so I don't count these as passes.

Negative control: with scc_some in emit/lower.rs changed to OR the low half with itself (the high half's answer dropped), the test fails on the card at wave64_tests.rs:295: lane 0: lane 32 after 4 rounds, left 1, right 0. So it does catch a half that answers alone.

cargo test -p victory-shader --lib --locked

Tree Passed Failed Ignored
PR 396 0 8
Main 568c5e5d 395 0 8

The extra test is the PR's own. This matches the RTX 5070 result above, on a 30-series card.

Not tested: the PR on today's main, and any effect in a title.

Tested with the help of Claude Code (Claude Fable 5.2).

**@⁠upipibi** on GitHub · 2026-11-29 20:57 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1929#issuecomment-7262494806) · edited 2026-11-29 23:08 UTC Test report for #1929 (head 15aa188b), merged onto main 568c5e5d, on RTX 30. Synthetic tests only: no title run, no game files. **Setup:** RTX 3070, driver 621.40, Windows 11 (10.0.26100), rustc 1.98.1. Every step logged the GPU and driver from `nvidia-smi`. **Key test:** `emit::wave64_tests::some_lane_of_a_mask_is_a_number_both_host_waves_agree_on`, 3 runs on the card and 3 with `VICTORY_WARP=1`. - On the card, 3/3: `ran on the hardware device: both host waves agree on "some lane is left"`. - With `VICTORY_WARP=1`, 3/3: `the hardware device does not take this program (waves of 64?): The parameter is incorrect.; not run`. The test returns ok there without checking anything, so I don't count these as passes. **Negative control:** with `scc_some` in `emit/lower.rs` changed to OR the low half with itself (the high half's answer dropped), the test **fails** on the card at `wave64_tests.rs:295`: `lane 0: lane 32 after 4 rounds`, left 1, right 0. So it does catch a half that answers alone. **`cargo test -p victory-shader --lib --locked`** | Tree | Passed | Failed | Ignored | |---|---|---|---| | PR | 396 | 0 | 8 | | Main 568c5e5d | 395 | 0 | 8 | The extra test is the PR's own. This matches the RTX 5070 result above, on a 30-series card. Not tested: the PR on today's main, and any effect in a title. *Tested with the help of Claude Code (Claude Fable 5.2).*
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1929/head:github-bot/gh-1929'
git switch 'github-bot/gh-1929'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1929'
git switch 'github-bot/gh-1929'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1929'
git switch 'github-bot/gh-1929'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1929'
git switch 'main'
git merge --squash 'github-bot/gh-1929'
git switch 'main'
git merge --ff-only 'github-bot/gh-1929'
git switch 'main'
git merge 'github-bot/gh-1929'
git push origin 'main'
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/trustno1-coder--VIctory-NVIDIA!1929
No description provided.