Skip to content

fix(cli): translate --wave32 narrows the waves as run does under Wine - #503

Merged
pragyaangaur merged 1 commit into
pragyaangaur:mainfrom
4TheDoctor:translate-narrow-waves
Nov 27, 2026
Merged

pragyaangaur merged 1 commit into
pragyaangaur:mainfrom
4TheDoctor:translate-narrow-waves

Conversation

@4TheDoctor

Copy link
Copy Markdown
Contributor

What

victory translate --wave32 now sets narrow_waves by the same rule run uses (shader_cache::narrow_waves: under Wine, or VICTORY_NARROW_WAVES=0/1). Without --wave32 the waves are never narrowed. That leaves a Windows host with 32-lane waves (NVIDIA, Intel) as run has it there: halves, no narrowing.

  • shader_cache::narrow_waves is now pub.
  • translate.rs: a small emit_options(wave32, narrow) builds the emit options, with a test.
  • The --wave32 help says what it does under Wine.

Why

Under Wine, run translates with narrow_waves on. 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 --wave32 left 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)

So on current main this is mostly a correctness fix for the tool, so that translate --wave32 on a Mac answers what the game would do.

How tested

  • New test translate::tests::narrow_waves_follow_wave32_and_the_host: built for x86_64-pc-windows-gnu and 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 the gnullvm standard library here, so this is the gnu target. Same Windows code, different linker.
  • cargo test --workspace (macOS): victory-shader's lib tests don't compile on a509c3a (48 errors, untouched by this change). With --exclude victory-shader: 459 passed, 0 failed.
  • tools/macos/test-wine.sh not run (it needs Homebrew's llvm and lld, not installed here).
  • Formatted only the changed code.

🤖 Generated with Claude Code

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.
@pragyaangaur
pragyaangaur merged commit 925baed into pragyaangaur:main Nov 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants