Translator: wave64 programs no other form takes run in the paired form (from mandy) #543

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

@⁠voiceovarian1-max on GitHub · 2026-12-03 08:54 UTC · original
voiceovarian1-max:paired-wave64 → main · +2625 −39 · 7 files · 1 commits · open

Ported from ProjectLeonida/mandy: its paired form of console wave64 compute programs, for 32-lane hosts (NVIDIA, Intel). On such a host, a wave64 program that every other form refuses ("no wave32 lowering for this wave64 program") is not translated now, and its dispatches are dropped. Issue #311 reports 17 such programs, and #258 two of them.

The paired form runs each console wave of 64 as one host wave of 32 threads, with each thread lowering two console lanes (n and n + 32) and the whole wave taking every per-lane branch. A reduction, ballot, first-lane read or wave-wide branch is then the host wave's own: no exchange between host waves through LDS and no group barrier, which the wave-wide form needs.

What is in it

  • emit/paired.rs, emit/lower.rs: the form (each instruction lowered for the lower lane, then the upper one; each lane's values kept apart).
  • emit/mod.rs:
    • VICTORY_PAIRED_LANES decides when the form is tried:
      • unset or 1: last of all, for a program every other form refused, and right before the wave-wide form where that form is asked for;
      • exact: before the approximate forms;
      • first: before every form;
      • 0: never.
    • barriers_on_every_way: groups of several console waves that meet only at barriers each wave passes once.
    • The switch is part of translation_fingerprint.
  • shader_cache.rs: the switch is in the cache key's switches.
  • emit/paired_tests.rs: 16 tests.

Provenance: mandy 8d300d783 and 1411b6ca3 (NotRexed), e10e9d007 and 55c6dcbb2 (Zack), 0bc6e21a1 (NotRexed, after voidopcode/vilocity add4873) and 9899a9801 (NotRexed); mandy's form is itself after TaynanGT/Vice-Tay 5e588e8. All are GPL-3.0(-or-later), and the comments name each source.

Not taken from mandy:

  • its counted dispatches (partial_active): spilled programs are refused;
  • its lists of programs by hash, which belong in a title profile.

It is about 2,600 lines, 1,044 of them tests. The form is one piece: the lowering needs both lanes' state, and the tests check its results.

Tested

  • RTX 4070 Ti 12 GB (driver 617.14), i7-14700K, 32 GB, Windows 11 Pro 26300; stable Rust; release build.
  • cargo test --workspace --locked -- --test-threads=4: 1,374 passed, 0 failed, 50 ignored (29 binaries), no SKIPPED. victory-shader alone: 345 passed, 0 failed, 4 ignored. The 16 paired tests ran on the card.
  • cargo xtask policy: ok.
  • Retail title, Series S profile, DLSS Balanced, 60 fps limit, -NoPrepare (cache filled by victory shaders beforehand):
    • victory shaders: 17 programs refused with "no wave32 lowering" without the form, 4 with it. The form takes 24 programs: those 13, plus 11 that took the wave-wide form before.
    • Frame rate: runs on one boot, alternating VICTORY_PAIRED_LANES=0 and the default, with keys pressed by the layer alone (VICTORY_KEYS, no input from the PC). Same frame rate in the same scene: 33-37 fps without the form, 32-36 with it. The same scenes, no device removal, no crash.
    • Correction: an earlier version of this description said the game left a scene only with the form. Those runs had the game window in front, where keys pressed by hand also reach it. With scripted input alone, both modes stay in that scene, so the claim was wrong and is removed.

Not tested

  • AMD (64-lane waves: the form is never tried there), Intel, other NVIDIA cards.
  • The Series X profile, other scenes and long play.
  • exact and first in the game (unit tests only).
  • The 11 programs that move from the wave-wide form to this one were not checked picture by picture; the frames looked normal in the runs.

AI use

Claude Code with Claude Opus 5.5 ported mandy's code onto this tree, dropped the parts above, ran the builds, tests and game runs on the hardware named, and wrote this description.

🤖 Generated with Claude Code

**@⁠voiceovarian1-max** on GitHub · 2026-12-03 08:54 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/543) `voiceovarian1-max:paired-wave64` → `main` · +2625 −39 · 7 files · 1 commits · open Ported from [ProjectLeonida/mandy](https://github.com/ProjectLeonida/mandy): its paired form of console wave64 compute programs, for 32-lane hosts (NVIDIA, Intel). On such a host, a wave64 program that every other form refuses ("no wave32 lowering for this wave64 program") is not translated now, and its dispatches are dropped. Issue #311 reports 17 such programs, and #258 two of them. The paired form runs each console wave of 64 as one host wave of 32 threads, with each thread lowering two console lanes (n and n + 32) and the whole wave taking every per-lane branch. A reduction, ballot, first-lane read or wave-wide branch is then the host wave's own: no exchange between host waves through LDS and no group barrier, which the wave-wide form needs. **What is in it** - `emit/paired.rs`, `emit/lower.rs`: the form (each instruction lowered for the lower lane, then the upper one; each lane's values kept apart). - `emit/mod.rs`: - `VICTORY_PAIRED_LANES` decides when the form is tried: - unset or `1`: last of all, for a program every other form refused, and right before the wave-wide form where that form is asked for; - `exact`: before the approximate forms; - `first`: before every form; - `0`: never. - `barriers_on_every_way`: groups of several console waves that meet only at barriers each wave passes once. - The switch is part of `translation_fingerprint`. - `shader_cache.rs`: the switch is in the cache key's switches. - `emit/paired_tests.rs`: 16 tests. Provenance: mandy 8d300d783 and 1411b6ca3 (NotRexed), e10e9d007 and 55c6dcbb2 (Zack), 0bc6e21a1 (NotRexed, after voidopcode/vilocity add4873) and 9899a9801 (NotRexed); mandy's form is itself after TaynanGT/Vice-Tay 5e588e8. All are GPL-3.0(-or-later), and the comments name each source. Not taken from mandy: - its counted dispatches (`partial_active`): spilled programs are refused; - its lists of programs by hash, which belong in a title profile. It is about 2,600 lines, 1,044 of them tests. The form is one piece: the lowering needs both lanes' state, and the tests check its results. **Tested** - RTX 4070 Ti 12 GB (driver 617.14), i7-14700K, 32 GB, Windows 11 Pro 26300; stable Rust; release build. - `cargo test --workspace --locked -- --test-threads=4`: 1,374 passed, 0 failed, 50 ignored (29 binaries), no `SKIPPED`. `victory-shader` alone: 345 passed, 0 failed, 4 ignored. The 16 paired tests ran on the card. - `cargo xtask policy`: ok. - Retail title, Series S profile, DLSS Balanced, 60 fps limit, `-NoPrepare` (cache filled by `victory shaders` beforehand): - **`victory shaders`:** 17 programs refused with "no wave32 lowering" without the form, 4 with it. The form takes 24 programs: those 13, plus 11 that took the wave-wide form before. - **Frame rate:** runs on one boot, alternating `VICTORY_PAIRED_LANES=0` and the default, with keys pressed by the layer alone (`VICTORY_KEYS`, no input from the PC). Same frame rate in the same scene: 33-37 fps without the form, 32-36 with it. The same scenes, no device removal, no crash. - **Correction:** an earlier version of this description said the game left a scene only with the form. Those runs had the game window in front, where keys pressed by hand also reach it. With scripted input alone, both modes stay in that scene, so the claim was wrong and is removed. **Not tested** - AMD (64-lane waves: the form is never tried there), Intel, other NVIDIA cards. - The Series X profile, other scenes and long play. - `exact` and `first` in the game (unit tests only). - The 11 programs that move from the wave-wide form to this one were not checked picture by picture; the frames looked normal in the runs. **AI use** Claude Code with Claude Opus 5.5 ported mandy's code onto this tree, dropped the parts above, ran the builds, tests and game runs on the hardware named, and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On a host of 32-lane waves, a console wave64 compute program that every form refuses ("no wave32
lowering for this wave64 program") is not translated, and its dispatches are dropped. The paired
form runs each console wave of 64 as one host wave of 32 threads, each thread lowering two console
lanes (lane n and lane n + 32), with every per-lane branch taken by the whole wave. Its wave-wide
values (reductions, ballots, first-lane reads, wave-wide branches) are then the host wave's own:
no exchange between host waves through LDS and no group barrier, which the wave-wide form needs.
Refused for what it does not take: spilled programs, groups that do not fill their console waves,
LDS operations other than dword reads, writes and order-free atomics, and groups of several
console waves whose host waves would have to meet at a barrier after going their own ways (unless
each barrier is one every wave passes once, `barriers_on_every_way`).

VICTORY_PAIRED_LANES:
- unset or 1: tried last, for a program every other form refused; and right before the wave-wide
  form where that form is asked for (VICTORY_WAVE_WIDE=1 or the profile's wave-wide roles);
- exact: also before the approximate forms;
- first: before every form;
- 0: never (the translation as before).
The switch is part of the translation (translation_fingerprint and the shader cache's switches).

Ported from ProjectLeonida/mandy (GPL-3.0-or-later): 8d300d783 and 1411b6ca3 (NotRexed, the form
and LEONIDA_PAIRED_LANES), e10e9d007 and 55c6dcbb2 (Zack: sub-dword, multi-dword and strided LDS,
v_readlane of restored lanes), 0bc6e21a1 (NotRexed, after voidopcode/vilocity add4873: LDS
compare-and-store and groups of several console waves), 9899a9801 (NotRexed: LDS subtracts).
mandy's form is itself after TaynanGT/Vice-Tay 5e588e8 (GPL-3.0; Geckomacabre and fxceless, after
ByFxbian's fxceless/victory-fork #1397, PiloteCode #854 and darkworldhm 840243e2). Not taken:
mandy's counted dispatches (`partial_active`; spilled programs are refused) and its lists of
programs by hash.

Measured on an RTX 4070 Ti 12 GB with a retail title (Series S profile): of its 25,781 programs,
`victory shaders` refuses 17 with "no wave32 lowering" without the form and 4 with it; the form
takes 24 programs in all (13 of those refused, 11 that took the wave-wide form). In the game,
four runs alternating VICTORY_PAIRED_LANES=0 and the default: the same frame rate in the same
scene (33-35 fps both). In both runs with the form the game went on from a scene where the
character stands at a window into a cutscene and the next tutorial step about 110 s in, with no
input; in neither run without it, nor in six earlier runs of main, did it leave that scene.

Tests (emit/paired_tests.rs, 16): the paired form's results against what the console computes,
on the card (and on WARP where it has 32-lane waves): wave sums, ORs, counts, first lanes and
ranks, ballots of masks, a backward permute, LDS written by one half and read by the other
(dword, wide, strided and sub-dword), tile minimum and maximum atomics, and a group of several
console waves at barriers each wave passes once; which form each VICTORY_PAIRED_LANES value takes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 08:58:34 +00:00
github-bot force-pushed github-bot/gh-543 from 9f500731c3 to 81c01edca8 2026-12-03 09:35:37 +00:00 Compare
Author
Owner

@⁠voiceovarian1-max on GitHub · 2026-12-03 10:04 UTC · original

Combined test of this PR with #521, #543 and #544-#556, all merged onto main 7dbcdcb (branch fox-all of voiceovarian1-max/foxhound):

  • RTX 4070 Ti 12 GB (driver 617.14), i7-14700K, 32 GB, Windows 11 Pro 26300; release.
  • cargo test --workspace --locked -- --test-threads=4: 1,415 passed, 0 failed, 50 ignored (29 binaries), no SKIPPED.
  • Retail title, Series S profile, DLSS Balanced, 60 fps limit, keys pressed by the layer only (VICTORY_KEYS, no input from the PC): window scene 38-42 fps against 34-37 for main on the same boot; no device removal, no crash; a burst of 67 pictures showed no one-picture flicker of the character's clothes.
  • Not tested: each PR alone in the game; AMD and Intel; the Series X profile; long play.

Tested by Claude Code with Claude Opus 5.5 on the hardware named.

**@⁠voiceovarian1-max** on GitHub · 2026-12-03 10:04 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/543#issuecomment-7374687120) Combined test of this PR with #521, #543 and #544-#556, all merged onto `main` 7dbcdcb (branch fox-all of voiceovarian1-max/foxhound): - RTX 4070 Ti 12 GB (driver 617.14), i7-14700K, 32 GB, Windows 11 Pro 26300; release. - `cargo test --workspace --locked -- --test-threads=4`: 1,415 passed, 0 failed, 50 ignored (29 binaries), no `SKIPPED`. - Retail title, Series S profile, DLSS Balanced, 60 fps limit, keys pressed by the layer only (`VICTORY_KEYS`, no input from the PC): window scene 38-42 fps against 34-37 for `main` on the same boot; no device removal, no crash; a burst of 67 pictures showed no one-picture flicker of the character's clothes. - Not tested: each PR alone in the game; AMD and Intel; the Series X profile; long play. Tested by Claude Code with Claude Opus 5.5 on the hardware named.
This pull request has changes conflicting with the target branch.
  • 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/543/head:github-bot/gh-543'
git switch 'github-bot/gh-543'

Merge

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