CLI: report emitted shader wave sizes in translate #1462

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

@⁠gurvancampion on GitHub · 2026-11-24 18:13 UTC · original
gurvancampion:topic/translate-wave-size-tally → main · +120 −3 · 13 files · 1 commits · open

Summary

victory translate now reports how many emitted programs are unrestricted or require a fixed wave size. HostShader::wave_size carries the size already declared in DXIL through emission and cache reads. The CLI totals successful emissions across stages and includes each size with --list. The offline tally is available on systems such as the RTX 4090 in #1323, where wave64 compute pipelines are refused.

 victory translate --list
   3 emitted of 3 compute programs; 0 validated, 0 pipelines
+  wave sizes   1 unrestricted, 1 wave32, 1 wave64
+  unrestricted@0x0 Cs  emitted, unrestricted
+  wave32@0x0 Cs  emitted, wave32
+  wave64@0x0 Cs  emitted, wave64

Evidence

Both revisions exited 0 and emitted three synthetic compute programs with cargo xwin run -p victory --locked --target x86_64-pc-windows-msvc -- translate "Z:<synthetic-directory>" --list --jobs 2. The added lines above are from that run with paths shortened.

Check Base ffe310e Head
cargo xwin test -p victory-shader --locked --target x86_64-pc-windows-msvc emit::tests::host_shader_reports_the_emitted_wave_size -- --exact Control failed, field was None for wave32 1 passed, including both PSV0 bounds
cargo xwin test -p victory --locked --target x86_64-pc-windows-msvc translate::counts_and_lists_emitted_wave_sizes -- --exact Control failed, all counts were zero 1 passed, including the merged totals and listing
cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings Pass Pass
cargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warnings Pass Pass
cargo xwin test -p victory -p victory-shader --locked --target x86_64-pc-windows-msvc 106 passed, 15 failed, 1 ignored 108 passed, same 15 failed, 1 ignored
cargo xwin test --workspace --locked --target x86_64-pc-windows-msvc --no-fail-fast 322 passed, 20 failed, 6 ignored 324 passed, same 20 failed, 6 ignored
cargo xwin test --workspace --all-features --locked --target x86_64-pc-windows-msvc --no-fail-fast 326 passed, 20 failed, 6 ignored 328 passed, same 20 failed, 6 ignored
cargo test -p victory-shader --locked 96 passed, 1 ignored 97 passed, 1 ignored
cargo test -p victory-core -p victory-formats -p victory-game -p victory-pipeline -p victory-shader -p xtask --locked, then with --all-features 140 passed, 5 ignored each 141 passed, 5 ignored each
cargo test -p xtask --locked repository_passes_policy Pass Pass
cargo xtask policy --staged Pass Pass, 7 files
rustfmt --check --edition 2024 --config skip_children=true <changed Rust files> 4 pre-existing diffs Same 4 diffs
git diff --check origin/main HEAD Pass Pass

The control runs add the new assertions to base with shims that preserve its missing wave metadata and lack of recording. The unfiltered Wine runs used NO_GPU=1. Their 20 failures require a D3D12 device, a window, a Winsock export, a working nested Cargo path, or guest Git. With those tests filtered, the default and all-features suites passed 322 and 326 tests on base and 324 and 328 on head. A filtered all-features head run stalled in the save subprocess test and passed on retry. The workspace suites also exercised the shader cache round-trip for unrestricted, wave32, and wave64 metadata.

Not verified

Native Windows, hardware or WARP pipeline creation, DXIL validation with dxil.dll, and retail-scale translation were outside the CPU-only run.

Merge Danger

Door: Two-way

A revert restores the previous CLI output and public struct. Shader cache entries are rebuildable and keyed by the executable fingerprint.

Blast Radius: module

The change affects victory translate output, callers that construct HostShader, and the internal shader-cache record.

AI disclosure

OpenAI Codex (gpt-6.2-sol) wrote the patch, tests, and PR draft and ran the checks documented above. Antigravity (Gemini 4 Neon) coordinated and reviewed the diff. The author reviewed the diff and description before opening the PR.

**@⁠gurvancampion** on GitHub · 2026-11-24 18:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/1462) `gurvancampion:topic/translate-wave-size-tally` → `main` · +120 −3 · 13 files · 1 commits · open ## Summary `victory translate` now reports how many emitted programs are unrestricted or require a fixed wave size. `HostShader::wave_size` carries the size already declared in DXIL through emission and cache reads. The CLI totals successful emissions across stages and includes each size with `--list`. The offline tally is available on systems such as the RTX 4090 in #1323, where wave64 compute pipelines are refused. ```diff victory translate --list 3 emitted of 3 compute programs; 0 validated, 0 pipelines + wave sizes 1 unrestricted, 1 wave32, 1 wave64 + unrestricted@0x0 Cs emitted, unrestricted + wave32@0x0 Cs emitted, wave32 + wave64@0x0 Cs emitted, wave64 ``` ## Evidence Both revisions exited 0 and emitted three synthetic compute programs with `cargo xwin run -p victory --locked --target x86_64-pc-windows-msvc -- translate "Z:<synthetic-directory>" --list --jobs 2`. The added lines above are from that run with paths shortened. | Check | Base `ffe310e` | Head | | --- | --- | --- | | `cargo xwin test -p victory-shader --locked --target x86_64-pc-windows-msvc emit::tests::host_shader_reports_the_emitted_wave_size -- --exact` | Control failed, field was `None` for wave32 | 1 passed, including both PSV0 bounds | | `cargo xwin test -p victory --locked --target x86_64-pc-windows-msvc translate::counts_and_lists_emitted_wave_sizes -- --exact` | Control failed, all counts were zero | 1 passed, including the merged totals and listing | | `cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings` | Pass | Pass | | `cargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warnings` | Pass | Pass | | `cargo xwin test -p victory -p victory-shader --locked --target x86_64-pc-windows-msvc` | 106 passed, 15 failed, 1 ignored | 108 passed, same 15 failed, 1 ignored | | `cargo xwin test --workspace --locked --target x86_64-pc-windows-msvc --no-fail-fast` | 322 passed, 20 failed, 6 ignored | 324 passed, same 20 failed, 6 ignored | | `cargo xwin test --workspace --all-features --locked --target x86_64-pc-windows-msvc --no-fail-fast` | 326 passed, 20 failed, 6 ignored | 328 passed, same 20 failed, 6 ignored | | `cargo test -p victory-shader --locked` | 96 passed, 1 ignored | 97 passed, 1 ignored | | `cargo test -p victory-core -p victory-formats -p victory-game -p victory-pipeline -p victory-shader -p xtask --locked`, then with `--all-features` | 140 passed, 5 ignored each | 141 passed, 5 ignored each | | `cargo test -p xtask --locked repository_passes_policy` | Pass | Pass | | `cargo xtask policy --staged` | Pass | Pass, 7 files | | `rustfmt --check --edition 2024 --config skip_children=true <changed Rust files>` | 4 pre-existing diffs | Same 4 diffs | | `git diff --check origin/main HEAD` | Pass | Pass | The control runs add the new assertions to base with shims that preserve its missing wave metadata and lack of recording. The unfiltered Wine runs used `NO_GPU=1`. Their 20 failures require a D3D12 device, a window, a Winsock export, a working nested Cargo path, or guest Git. With those tests filtered, the default and all-features suites passed 322 and 326 tests on base and 324 and 328 on head. A filtered all-features head run stalled in the save subprocess test and passed on retry. The workspace suites also exercised the shader cache round-trip for unrestricted, wave32, and wave64 metadata. ## Not verified Native Windows, hardware or WARP pipeline creation, DXIL validation with `dxil.dll`, and retail-scale translation were outside the CPU-only run. ## Merge Danger **Door:** Two-way A revert restores the previous CLI output and public struct. Shader cache entries are rebuildable and keyed by the executable fingerprint. **Blast Radius:** module The change affects `victory translate` output, callers that construct `HostShader`, and the internal shader-cache record. ## AI disclosure OpenAI Codex (`gpt-6.2-sol`) wrote the patch, tests, and PR draft and ran the checks documented above. Antigravity (`Gemini 4 Neon`) coordinated and reviewed the diff. The author reviewed the diff and description before opening the PR.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:32:47 +00:00
Author
Owner

@⁠sinan-cmyk on GitHub · 2026-11-24 20:43 UTC · original

Offline measurement on a retail dump, and the shader tests on Ada

Result: no count change against main.

Offline. I merged head 9bab357 onto main ffe310e (clean merge) and ran victory translate --validate --list on shaders.rpf (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with main program by program (25,889 programs). Validated: 21,724 on main, 21,724 with this PR.

No program changes its failure reason either. That is the expected result for a fix whose instructions sit behind the earlier failures on main. The count shows that the change rejects nothing. It does not show whether the output is right.

Tests: with the same merge, cargo test --locked -p victory-shader --lib passed 121, failed 0. The bitcode benchmark is ignored, as on main, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, with VICTORY_WARP unset.

No shader names or data are included, per the asset policy. AI-assisted (Claude Code).

**@⁠sinan-cmyk** on GitHub · 2026-11-24 20:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/1462#issuecomment-7143979749) ### Offline measurement on a retail dump, and the shader tests on Ada **Result: no count change against `main`.** **Offline.** I merged head 9bab357 onto `main` ffe310e (clean merge) and ran `victory translate --validate --list` on `shaders.rpf` (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with `main` program by program (25,889 programs). Validated: 21,724 on `main`, 21,724 with this PR. No program changes its failure reason either. That is the expected result for a fix whose instructions sit behind the earlier failures on `main`. The count shows that the change rejects nothing. It does not show whether the output is right. **Tests:** with the same merge, `cargo test --locked -p victory-shader --lib` passed 121, failed 0. The bitcode benchmark is ignored, as on `main`, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, with `VICTORY_WARP` unset. No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:28 UTC · original · edited 2026-11-26 01:19 UTC

Automated triage for the maintainers.

Merge candidate (re-checked after the rebase, 6f80b10). It merges cleanly into main again. HostShader gets a wave_size field, taken from the size the emitter already declares (Shader::wave_size, through Lowered in emit/lower.rs). victory translate (apps/victory/src/translate.rs, check/Tally) then counts unrestricted, wave32 and wave64 programs and prints the size with --list. The rebase only adds the field to the new memory_tests fixtures.

shader_cache.rs encode/decode now write one more word. Old entries are not misread, because the cache key and folder come from the translator's sources. The new test in emit/mod.rs checks the field against the PSV0 wave-size range, so it tests the emitted DXIL rather than repeating the field.

CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/1462#issuecomment-7149595383) · edited 2026-11-26 01:19 UTC <!-- victory-triage v1 head=6f80b1037c0d8b15384f688c83bd455152c159bd verdict=merge-candidate at=2026-11-26T01:19:05Z --> Automated triage for the maintainers. **Merge candidate (re-checked after the rebase, `6f80b10`).** It merges cleanly into `main` again. `HostShader` gets a `wave_size` field, taken from the size the emitter already declares (`Shader::wave_size`, through `Lowered` in `emit/lower.rs`). `victory translate` (`apps/victory/src/translate.rs`, `check`/`Tally`) then counts unrestricted, wave32 and wave64 programs and prints the size with `--list`. The rebase only adds the field to the new `memory_tests` fixtures. `shader_cache.rs` `encode`/`decode` now write one more word. Old entries are not misread, because the cache key and folder come from the translator's sources. The new test in `emit/mod.rs` checks the field against the PSV0 wave-size range, so it tests the emitted DXIL rather than repeating the field. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 19:59 UTC · original · requested changes

Tested locally merged onto origin/main (63bcca43) at PR head 6f80b103 (Windows 11 x64, NVIDIA RTX 5090 + Microsoft WARP, VICTORY_D3D12_DEBUG=1).

Blocking issue: workspace build failure after merging onto current main

Although git merge-tree has no textual conflict, crates/victory-gpu/src/pipeline/depth_bounds_test.rs:59 (added on main since this branch's base) constructs a victory_shader::emit::HostShader literal without the new wave_size field. Merging onto origin/main (63bcca43) fails both cargo clippy --locked --workspace --all-targets [--all-features] -- -D warnings and cargo test --locked -p victory-gpu --lib with:

error[E0063]: missing field `wave_size` in initializer of `victory_shader::emit::HostShader`
  --> crates\victory-gpu\src\pipeline\depth_bounds_test.rs:59:15

Verified fix & rest of patch

Rebasing onto main and adding wave_size: None, to that HostShader initializer in crates/victory-gpu/src/pipeline/depth_bounds_test.rs:59 resolves the build cleanly. With that 1-line addition applied on the merged tree:

  • cargo xtask policy: 191 files ok (crates/victory-shader/src/emit/lower.rs is 520,636 B, under the 524,288 B limit).
  • cargo clippy --locked --workspace --all-targets -- -D warnings (default and --all-features): 0 warnings.
  • cargo test --locked -p victory-shader --lib emit::tests::host_shader_reports_the_emitted_wave_size: passed (verifies HostShader::wave_size matches PSV0 wave-size min/max bounds for unrestricted, wave32, and wave64).
  • cargo test --locked -p victory --bin victory translate::counts_emitted_wave_sizes: passed (Tally recording, merge, summary, and labels).
  • cargo test --locked -p victory-gpu --features diagnostics --lib -- shader_cache::tests:: pipeline::depth_bounds_test::: 6/6 passed on both RTX 5090 and WARP with VICTORY_D3D12_DEBUG=1 (covering shader_cache encode/decode round-tripping None, Some(32), and Some(64) plus depth_bounds_test).

Please rebase onto current main and populate wave_size in crates/victory-gpu/src/pipeline/depth_bounds_test.rs:59. Synthetic tests only.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 19:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/1462#pullrequestreview-6079893102) · **requested changes** Tested locally merged onto `origin/main` (`63bcca43`) at PR head `6f80b103` (Windows 11 x64, NVIDIA RTX 5090 + Microsoft WARP, `VICTORY_D3D12_DEBUG=1`). ### Blocking issue: workspace build failure after merging onto current `main` Although `git merge-tree` has no textual conflict, `crates/victory-gpu/src/pipeline/depth_bounds_test.rs:59` (added on `main` since this branch's base) constructs a `victory_shader::emit::HostShader` literal without the new `wave_size` field. Merging onto `origin/main` (`63bcca43`) fails both `cargo clippy --locked --workspace --all-targets [--all-features] -- -D warnings` and `cargo test --locked -p victory-gpu --lib` with: ```text error[E0063]: missing field `wave_size` in initializer of `victory_shader::emit::HostShader` --> crates\victory-gpu\src\pipeline\depth_bounds_test.rs:59:15 ``` ### Verified fix & rest of patch Rebasing onto `main` and adding `wave_size: None,` to that `HostShader` initializer in `crates/victory-gpu/src/pipeline/depth_bounds_test.rs:59` resolves the build cleanly. With that 1-line addition applied on the merged tree: - `cargo xtask policy`: 191 files ok (`crates/victory-shader/src/emit/lower.rs` is 520,636 B, under the 524,288 B limit). - `cargo clippy --locked --workspace --all-targets -- -D warnings` (default and `--all-features`): 0 warnings. - `cargo test --locked -p victory-shader --lib emit::tests::host_shader_reports_the_emitted_wave_size`: passed (verifies `HostShader::wave_size` matches PSV0 wave-size min/max bounds for unrestricted, wave32, and wave64). - `cargo test --locked -p victory --bin victory translate::counts_emitted_wave_sizes`: passed (`Tally` recording, merge, summary, and labels). - `cargo test --locked -p victory-gpu --features diagnostics --lib -- shader_cache::tests:: pipeline::depth_bounds_test::`: 6/6 passed on both RTX 5090 and WARP with `VICTORY_D3D12_DEBUG=1` (covering `shader_cache` encode/decode round-tripping `None`, `Some(32)`, and `Some(64)` plus `depth_bounds_test`). Please rebase onto current `main` and populate `wave_size` in `crates/victory-gpu/src/pipeline/depth_bounds_test.rs:59`. Synthetic tests only.
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 20:17 UTC · original · reviewed

Tested against origin/main (63bcca4). victory-shader tests (emit::tests:: 18/18) pass, but victory-gpu fails to compile tests after merging onto origin/main because a newly added test constructs HostShader without the new wave_size field:

error[E0063]: missing field `wave_size` in initializer of `victory_shader::emit::HostShader`
  --> crates/victory-gpu/src/pipeline/depth_bounds_test.rs:59:15

Adding wave_size to that HostShader literal after rebasing onto main will fix the build.

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

**@⁠Dukestar69** on GitHub · 2026-11-26 20:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/1462#pullrequestreview-6080046064) · **reviewed** Tested against `origin/main` (`63bcca4`). `victory-shader` tests (`emit::tests::` 18/18) pass, but `victory-gpu` fails to compile tests after merging onto `origin/main` because a newly added test constructs `HostShader` without the new `wave_size` field: ``` error[E0063]: missing field `wave_size` in initializer of `victory_shader::emit::HostShader` --> crates/victory-gpu/src/pipeline/depth_bounds_test.rs:59:15 ``` Adding `wave_size` to that `HostShader` literal after rebasing onto `main` will fix the build. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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/1462/head:github-bot/gh-1462'
git switch 'github-bot/gh-1462'

Merge

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