Repository navigation
fix(cli): translate --wave32 narrows the waves as run does under Wine - #503
Merged
pragyaangaur merged 1 commit intoNov 27, 2026
Merged
Conversation
Under Wine, run translates with narrow_waves on (shader_cache::narrow_waves): a group that is one console wave64 with LDS gets barriers between its 32-lane halves instead of being refused. translate --wave32 left it off, so offline checks on a Mac refused programs the game translates. Now --wave32 follows run's rule (under Wine, or VICTORY_NARROW_WAVES); without --wave32 the waves are never narrowed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
victory translate --wave32now setsnarrow_wavesby the same rulerunuses (shader_cache::narrow_waves: under Wine, orVICTORY_NARROW_WAVES=0/1). Without--wave32the waves are never narrowed. That leaves a Windows host with 32-lane waves (NVIDIA, Intel) asrunhas it there: halves, no narrowing.shader_cache::narrow_wavesis nowpub.translate.rs: a smallemit_options(wave32, narrow)builds the emit options, with a test.--wave32help says what it does under Wine.Why
Under Wine,
runtranslates withnarrow_waveson. A group that is one console wave64 with LDS then gets barriers between its 32-lane halves (lower::barriers::split_wave_barriers) instead of being refused.translate --wave32left it off, so on a Mac the offline check refused programs the game translates, and comparisons drawn from it were wrong (it misled one of mine in #497).Measurements (GTA VI, Series 1.0.2.1,
shaders.rpf+XboxBvhBuilder.dll, under CrossOver 26.1 on an M3 Max)bf99e72, before feat(shader): retry refused 64-thread wave64 compute with whole-wave control flow #435: with narrowing, the offline translator refuses exactly the 109 compute shaders the game refused in three runs and emits all 1,003 it translated. Without narrowing it refused 213 more, so this is where the change matters most.a509c3a), feat(shader): retry refused 64-thread wave64 compute with whole-wave control flow #435's whole-wave retry already takes almost all of those. Without this change, 2,641 of 2,734 compute programs are emitted; with it, 2,642.terrainshadows/CS_ComputeTerrainVisibilitynow emits, and one water program changes its refusal reason. The per-program results are identical to a run withnarrow_wavesforced on.So on current main this is mostly a correctness fix for the tool, so that
translate --wave32on a Mac answers what the game would do.How tested
translate::tests::narrow_waves_follow_wave32_and_the_host: built forx86_64-pc-windows-gnuand run under Wine.victory's unit tests: 15 passed, 2 failed. The two failures (config_check_fails_a_path_inside_the_repository,emit_dump_inside_repo_is_refused) fail the same way without this change in my bottle.cargo clippy --workspace --all-targets [--all-features] --target x86_64-pc-windows-gnu -- -D warnings: clean. I don't have thegnullvmstandard library here, so this is thegnutarget. Same Windows code, different linker.cargo test --workspace(macOS):victory-shader's lib tests don't compile ona509c3a(48 errors, untouched by this change). With--exclude victory-shader: 459 passed, 0 failed.tools/macos/test-wine.shnot run (it needs Homebrew's llvm and lld, not installed here).🤖 Generated with Claude Code