Shaders: choose the wave64 deep-skips form per program #779

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

@⁠Xeltax on GitHub · 2026-11-25 07:25 UTC · original
Xeltax:vicky/per-program-deep-skips → main · +325 −25 · 4 files · 1 commits · open

On a 32-lane host, the exact wave64 form "without skips, scalars followed" could only be switched on or off for every program at once (VICTORY_WAVE_DEEP_SKIPS). This switch sets it per program, using the hash the log names a shader by (prefixes are allowed, separated by commas or spaces, with or without #):

  • VICTORY_WAVE_DEEP_SKIPS_NOT=<hash>,... turns the form off for the listed programs;
  • VICTORY_WAVE_DEEP_SKIPS_ONLY=<hash>,... turns it off for every other program;
  • VICTORY_WAVE_DEEP_SKIPS=0 still turns it off for all of them.

VICTORY_WAVE_WHY lines now name the program: WAVE64-RETRY #<hash> ..., so you can find which programs end in which form with VICTORY_HOST_WAVE=32 VICTORY_WAVE_WHY=1 victory translate --list. On 4e17478, 22 programs ended in this form.

Defaults and cache key. With the switches unset, translations are the same as on main, and each key is build() alone, as on main. The lists are not part of translation_fingerprint. When a list changes a program's decision, that program's key is the build key mixed with the decision (program_key), so editing a list re-translates only those programs. The warm-up uses the same key.

Why. On an RTX 4080, keeping only the 14 CS_ShadowRenderTiled* programs out of this form gave the best cell picture; keeping all 22 out made the room darker (#62). #219 works on the cause; until it lands, the _NOT list is a per-program workaround and a bisecting tool. #695 adds the same kind of per-program list for the wave-wide form.

Tests

  • cargo test -p victory-shader --lib: 221 passed (new tests for the list parsing and the per-program decision).
  • cargo test -p victory-gpu --features diagnostics --lib: 145 passed (new tests for the key, and for the lists staying out of the fingerprint).
  • cargo xtask policy: ok.
  • cargo clippy -p victory-shader -p victory-gpu --all-targets -- -D warnings: the only failures are three items in files this PR doesn't touch (resource.rs placed_filler_twins, draw.rs:2387, indirect.rs depth_written).

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠Xeltax** on GitHub · 2026-11-25 07:25 UTC · [original](https://github.com/fxceless/victory-fork/pull/779) `Xeltax:vicky/per-program-deep-skips` → `main` · +325 −25 · 4 files · 1 commits · open On a 32-lane host, the exact wave64 form "without skips, scalars followed" could only be switched on or off for every program at once (`VICTORY_WAVE_DEEP_SKIPS`). This switch sets it per program, using the hash the log names a shader by (prefixes are allowed, separated by commas or spaces, with or without `#`): - `VICTORY_WAVE_DEEP_SKIPS_NOT=<hash>,...` turns the form off for the listed programs; - `VICTORY_WAVE_DEEP_SKIPS_ONLY=<hash>,...` turns it off for every other program; - `VICTORY_WAVE_DEEP_SKIPS=0` still turns it off for all of them. `VICTORY_WAVE_WHY` lines now name the program: `WAVE64-RETRY #<hash> ...`, so you can find which programs end in which form with `VICTORY_HOST_WAVE=32 VICTORY_WAVE_WHY=1 victory translate --list`. On `4e17478`, 22 programs ended in this form. **Defaults and cache key.** With the switches unset, translations are the same as on `main`, and each key is `build()` alone, as on `main`. The lists are not part of `translation_fingerprint`. When a list changes a program's decision, that program's key is the build key mixed with the decision (`program_key`), so editing a list re-translates only those programs. The warm-up uses the same key. **Why.** On an RTX 4080, keeping only the 14 `CS_ShadowRenderTiled*` programs out of this form gave the best cell picture; keeping all 22 out made the room darker (#62). #219 works on the cause; until it lands, the `_NOT` list is a per-program workaround and a bisecting tool. #695 adds the same kind of per-program list for the wave-wide form. **Tests** - `cargo test -p victory-shader --lib`: 221 passed (new tests for the list parsing and the per-program decision). - `cargo test -p victory-gpu --features diagnostics --lib`: 145 passed (new tests for the key, and for the lists staying out of the fingerprint). - `cargo xtask policy`: ok. - `cargo clippy -p victory-shader -p victory-gpu --all-targets -- -D warnings`: the only failures are three items in files this PR doesn't touch (`resource.rs` `placed_filler_twins`, `draw.rs:2387`, `indirect.rs` `depth_written`). AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The exact wave64 form "without skips, scalars followed" was on or off for
every program (VICTORY_WAVE_DEEP_SKIPS=0). It can now be turned off per
program, by the hash the log names a shader by (hash prefixes, commas or
spaces, with or without the `#` of `translate --list`):
- VICTORY_WAVE_DEEP_SKIPS_NOT=<hash>,...: off for the listed programs;
- VICTORY_WAVE_DEEP_SKIPS_ONLY=<hash>,...: off for every other program.
Unset, nothing changes.

The two lists are left out of the translator's fingerprint. A program a
list keeps out of the form (a wave64 compute program on a 32-lane host)
gets the build's key mixed with that decision instead, so a new list
translates again only the programs it changes, and every other program
keeps the build's key.

VICTORY_WAVE_WHY's WAVE64-RETRY lines name the program (#hash); the
offline translator passes the hash as well.

On an RTX 4080 the form is wrong for the 14 CS_ShadowRenderTiled*
programs and better for the other programs that take it; keeping just
those 14 out gave the best picture (#62).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A4bpLmErkufJL3LGgfR561
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:50:56 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/shader_cache.rs
  • crates/victory-shader/src/emit/mod.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-779'
git switch 'github-bot/gh-779'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-779'
git switch 'github-bot/gh-779'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-779'
git switch 'main'
git merge --squash 'github-bot/gh-779'
git switch 'main'
git merge --ff-only 'github-bot/gh-779'
git switch 'main'
git merge 'github-bot/gh-779'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.