CLI: report emitted shader wave sizes in translate #1462
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1462
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1462"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@gurvancampion on GitHub · 2026-11-24 18:13 UTC · original
gurvancampion:topic/translate-wave-size-tally→main· +120 −3 · 13 files · 1 commits · openSummary
victory translatenow reports how many emitted programs are unrestricted or require a fixed wave size.HostShader::wave_sizecarries 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.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.ffe310ecargo xwin test -p victory-shader --locked --target x86_64-pc-windows-msvc emit::tests::host_shader_reports_the_emitted_wave_size -- --exactNonefor wave32cargo xwin test -p victory --locked --target x86_64-pc-windows-msvc translate::counts_and_lists_emitted_wave_sizes -- --exactcargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warningscargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warningscargo xwin test -p victory -p victory-shader --locked --target x86_64-pc-windows-msvccargo xwin test --workspace --locked --target x86_64-pc-windows-msvc --no-fail-fastcargo xwin test --workspace --all-features --locked --target x86_64-pc-windows-msvc --no-fail-fastcargo test -p victory-shader --lockedcargo test -p victory-core -p victory-formats -p victory-game -p victory-pipeline -p victory-shader -p xtask --locked, then with--all-featurescargo test -p xtask --locked repository_passes_policycargo xtask policy --stagedrustfmt --check --edition 2024 --config skip_children=true <changed Rust files>git diff --check origin/main HEADThe 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 translateoutput, callers that constructHostShader, 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.@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
mainffe310e(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 21,724 onmain, 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 --libpassed 121, failed 0. The bitcode benchmark is ignored, as onmain, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, withVICTORY_WARPunset.No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@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 intomainagain.HostShadergets awave_sizefield, taken from the size the emitter already declares (Shader::wave_size, throughLoweredinemit/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 newmemory_testsfixtures.shader_cache.rsencode/decodenow write one more word. Old entries are not misread, because the cache key and folder come from the translator's sources. The new test inemit/mod.rschecks 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
@fuzeofficlal on GitHub · 2026-11-26 19:59 UTC · original · requested changes
Tested locally merged onto
origin/main(63bcca43) at PR head6f80b103(Windows 11 x64, NVIDIA RTX 5090 + Microsoft WARP,VICTORY_D3D12_DEBUG=1).Blocking issue: workspace build failure after merging onto current
mainAlthough
git merge-treehas no textual conflict,crates/victory-gpu/src/pipeline/depth_bounds_test.rs:59(added onmainsince this branch's base) constructs avictory_shader::emit::HostShaderliteral without the newwave_sizefield. Merging ontoorigin/main(63bcca43) fails bothcargo clippy --locked --workspace --all-targets [--all-features] -- -D warningsandcargo test --locked -p victory-gpu --libwith:Verified fix & rest of patch
Rebasing onto
mainand addingwave_size: None,to thatHostShaderinitializer incrates/victory-gpu/src/pipeline/depth_bounds_test.rs:59resolves 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.rsis 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 (verifiesHostShader::wave_sizematches PSV0 wave-size min/max bounds for unrestricted, wave32, and wave64).cargo test --locked -p victory --bin victory translate::counts_emitted_wave_sizes: passed (Tallyrecording, 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 withVICTORY_D3D12_DEBUG=1(coveringshader_cacheencode/decode round-trippingNone,Some(32), andSome(64)plusdepth_bounds_test).Please rebase onto current
mainand populatewave_sizeincrates/victory-gpu/src/pipeline/depth_bounds_test.rs:59. Synthetic tests only.@Dukestar69 on GitHub · 2026-11-26 20:17 UTC · original · reviewed
Tested against
origin/main(63bcca4).victory-shadertests (emit::tests::18/18) pass, butvictory-gpufails to compile tests after merging ontoorigin/mainbecause a newly added test constructsHostShaderwithout the newwave_sizefield:Adding
wave_sizeto thatHostShaderliteral after rebasing ontomainwill fix the build.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@ColorMeBoom on GitHub · 2026-11-26 22:51 UTC · original
Does not build on current main (found in an RDNA1 batch run; not hardware-specific).
Head
6f80b10merges onto main63bcca4with no textual conflict, butcargo test -p victory-gpu --libthen stops:depth_bounds_test.rscame in with #158 (842b0cb), after the last rebase, and builds aHostShaderwithout the field this PR adds. Addingwave_sizethere is probably all it needs; I have not tried it. Thevictory-shadertests it changes pass on the RX 5700 XT (206 passed).AI use: Claude Code (Claude Opus 5.5).
@ColorMeBoom on GitHub · 2026-11-26 22:57 UTC · original
Follow-up: the one-line fix works. Head
6f80b10merged onto main63bcca4, plus:Nonematches the PR's other hand-builtHostShaders; the shader here is plainvs_5_1HLSL with no wave size.With it, on the RX 5700 XT (RDNA1, Windows 11 26200):
cargo test -p victory-gpu -p victory-shader -p victory --lib --bins --locked -- --test-threads=1: gpu 231 passed (1 ignored), shader 303 passed (3 ignored),victory15 passed, 0 failed. That includes the PR'stranslate::counts_emitted_wave_sizesandemit::tests::host_shader_reports_the_emitted_wave_size, and bothdepth_bounds_testtests on hardware (vertex depth bounds on AMD Radeon RX 5700 XT: true).cargo clippy -p victory-gpu -p victory-shader -p victory --all-targets --locked -- -D warnings: clean.cargo xtask policy: 191 files ok.AI use: Claude Code (Claude Opus 5.5).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.