Shaders: continue scanning wave sections past an unmatched saveexec #3187

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

@⁠reeledMarek on GitHub · 2026-11-26 11:28 UTC · original
reeledMarek:fix/shader-wave-sections-unmatched-saveexec → main · +41 −1 · 1 files · 1 commits · open

Summary

  • In crates/victory-shader/src/emit/wave.rs, sections() exited the basic-block scan loop with break whenever an s_or_saveexec_* -1 / s_nand_saveexec_* 0 had no matching EXEC restore in the same basic block.
  • That caused any subsequent whole-wave reduction/scan section later in the same block to be silently skipped.
  • Advance i += 1; continue; instead of break.

Testing

  • Added unmatched_saveexec_does_not_skip_later_wave_sections_in_block in crates/victory-shader/src/emit/wave.rs (fails on main, passes with the fix).
  • Verified cargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-msvc --locked -- -D warnings and cargo test -p xtask --locked pass.
**@⁠reeledMarek** on GitHub · 2026-11-26 11:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/3187) `reeledMarek:fix/shader-wave-sections-unmatched-saveexec` → `main` · +41 −1 · 1 files · 1 commits · open ## Summary - In `crates/victory-shader/src/emit/wave.rs`, `sections()` exited the basic-block scan loop with `break` whenever an `s_or_saveexec_* -1` / `s_nand_saveexec_* 0` had no matching `EXEC` restore in the same basic block. - That caused any subsequent whole-wave reduction/scan section later in the same block to be silently skipped. - Advance `i += 1; continue;` instead of `break`. ## Testing - Added `unmatched_saveexec_does_not_skip_later_wave_sections_in_block` in `crates/victory-shader/src/emit/wave.rs` (fails on `main`, passes with the fix). - Verified `cargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-msvc --locked -- -D warnings` and `cargo test -p xtask --locked` pass.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:33:18 +00:00
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-26 11:44 UTC · original

Independent local verification of head d097c31 on Windows 11, Rust 1.100.0/MSVC:

  • cargo test --locked -p victory-shader --lib emit::wave::tests::unmatched_saveexec_does_not_skip_later_wave_sections_in_block -- --exact — 1 passed, 0 failed.
  • git diff --check origin/main HEAD — clean.

CPU-only synthetic unit test; no D3D12 device or game assets used. Worktree-local CARGO_TARGET_DIR. AI-assisted (Hy4 flash).

**@⁠cloph-dsp** on GitHub · 2026-11-26 11:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/3187#issuecomment-7191105971) Independent local verification of head `d097c31` on Windows 11, Rust 1.100.0/MSVC: - `cargo test --locked -p victory-shader --lib emit::wave::tests::unmatched_saveexec_does_not_skip_later_wave_sections_in_block -- --exact` — 1 passed, 0 failed. - `git diff --check origin/main HEAD` — clean. CPU-only synthetic unit test; no D3D12 device or game assets used. Worktree-local `CARGO_TARGET_DIR`. AI-assisted (Hy4 flash).
Author
Owner

@⁠oni-swr on GitHub · 2026-11-26 11:47 UTC · original

WARP verification of #3187 (head d097c310a40be0364c960293390a7e643b4c2265)

Environment: Windows 11 Pro 10.0.26200; WARP D3D10Warp.dll 10.0.26100.9818 (VICTORY_D3D12_WARP=1, physical GPU not used); dxil.dll and dxc.exe 1.8.2502.11 from Windows SDK 10.0.26100.0 (VICTORY_DXIL points at that dxil.dll); rustc 1.98.1.

Commands (CARGO_TARGET_DIR on a scratch dir):
cargo test -p victory-shader --lib -j 4 --locked -- --test-threads=1, on the PR head and on the merge-base with main (63bcca43c6a00a758510398fa43096ce7e4f7df0).

Run Result
PR head 303 passed, 0 failed, 3 ignored (includes emit::wave::tests::unmatched_saveexec_does_not_skip_later_wave_sections_in_block)
merge-base (main) 302 passed, 0 failed, 3 ignored (the new test doesn't exist there)
PR head with only the wave.rs fix reverted (i += 1; continue; back to break;), test kept new test FAILED: "later matched section in the same block must still be discovered"

Defects found: none. The loop still advances i on the continue path, so it can't spin, and the diff touches only wave.rs. The test fails without the fix and passes with it.

AI use: Claude Code (Claude Sonnet 5.5), coordinated by Claude Code (Claude Opus 5.5). Test report only, no code changes. Claim: #1633

**@⁠oni-swr** on GitHub · 2026-11-26 11:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/3187#issuecomment-7191163692) ## WARP verification of #3187 (head `d097c310a40be0364c960293390a7e643b4c2265`) **Environment:** Windows 11 Pro 10.0.26200; WARP `D3D10Warp.dll` 10.0.26100.9818 (`VICTORY_D3D12_WARP=1`, physical GPU not used); `dxil.dll` and `dxc.exe` 1.8.2502.11 from Windows SDK 10.0.26100.0 (`VICTORY_DXIL` points at that `dxil.dll`); rustc 1.98.1. **Commands** (`CARGO_TARGET_DIR` on a scratch dir): `cargo test -p victory-shader --lib -j 4 --locked -- --test-threads=1`, on the PR head and on the merge-base with `main` (`63bcca43c6a00a758510398fa43096ce7e4f7df0`). | Run | Result | |---|---| | PR head | 303 passed, 0 failed, 3 ignored (includes `emit::wave::tests::unmatched_saveexec_does_not_skip_later_wave_sections_in_block`) | | merge-base (main) | 302 passed, 0 failed, 3 ignored (the new test doesn't exist there) | | PR head with only the `wave.rs` fix reverted (`i += 1; continue;` back to `break;`), test kept | new test **FAILED**: "later matched section in the same block must still be discovered" | **Defects found:** none. The loop still advances `i` on the `continue` path, so it can't spin, and the diff touches only `wave.rs`. The test fails without the fix and passes with it. AI use: Claude Code (Claude Sonnet 5.5), coordinated by Claude Code (Claude Opus 5.5). Test report only, no code changes. Claim: https://git.gtahub.st/github/Marvisak--VIctory/issues/1633
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 11:49 UTC · original · approved these changes

Verified against origin/main (63bcca4):

  • cargo test -p victory-shader --lib emit::wave:: -- --test-threads=1: passed.
  • cargo test -p victory-shader --lib emit::lower::tests:: -- --test-threads=1: 33/33 passed.
  • cargo clippy -p victory-shader --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly continues scanning wave sections past an unmatched saveexec.

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

**@⁠Dukestar69** on GitHub · 2026-11-26 11:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/3187#pullrequestreview-6073626126) · **approved these changes** Verified against `origin/main` (`63bcca4`): - `cargo test -p victory-shader --lib emit::wave:: -- --test-threads=1`: passed. - `cargo test -p victory-shader --lib emit::lower::tests:: -- --test-threads=1`: 33/33 passed. - `cargo clippy -p victory-shader --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Cleanly continues scanning wave sections past an unmatched `saveexec`. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request can be merged automatically.
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/3187/head:github-bot/gh-3187'
git switch 'github-bot/gh-3187'

Merge

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