Replay: --retranslate translates for the host it is told (#302) #388

Open
github-bot wants to merge 2 commits from github-bot/gh-388 into a-publier AGit
Owner

@⁠hussainmussa on GitHub · 2026-11-26 23:27 UTC · original
hussainmussa:fix/retranslate-host → a-publier · +139 −7 · 2 files · 2 commits · open

Fixes #302.

What was wrong

victory replay --retranslate set a 64-lane RDNA host whatever the run said (set_host_max_wave(64), set_host_rdna(true)), and replay.rs read no environment variable. On a 32-lane card (NVIDIA, Intel) the folder held shaders that no run on that card makes, and --shaders then took them without a word.

What this does

Each of the two (widest wave, RDNA or not) is now taken, on its own, from:

  1. a flag: --host-wave <lanes>, --host-rdna, --no-host-rdna (the last two refuse each other);
  2. the environment: VICTORY_HOST_WAVE (and its alias VICTORY_HOST_MAX_WAVE) through the same translate::host_wave::select that victory translate uses, and VICTORY_HOST_RDNA with the same meaning (1 is on);
  3. this PC's card (Host::translation_caps), asked only when one of the two is still open;
  4. a 64-lane RDNA card, when the card cannot be asked.

The summary line and a log line name the host used: N of M shaders translated for a 32-lane host (not RDNA), 1.2 s. docs/replay.md lists the flags.

This goes one step past the issue. It suggested 64-lane RDNA as the only fallback; step 3 puts the card in front of it, as victory translate does. On an RDNA card nothing changes. On an NVIDIA or Intel card, --retranslate with nothing set now writes that card's shaders, and VICTORY_HOST_WAVE=32 alone no longer leaves the RDNA float paths on. If you would rather keep 64-lane RDNA as the plain default, step 3 is one closure to take out.

Testing

RTX 4070, Windows 11, Rust 1.98.1.

  • cargo test -p victory --locked --features diagnostics: the new tests the_host_retranslate_translates_for and the_host_flags pass, with the rest.
  • cargo test -p xtask --locked: 9 passed, documented_switches_are_read among them.
  • cargo clippy -p victory --no-deps --all-targets --locked -- -D warnings, with and without --features diagnostics: clean.
  • On this card translation_caps answers (32, false), and with nothing set the host comes out as 32 lanes, not RDNA; with --host-wave 64 alone, 64 lanes, not RDNA.

Not tested: an actual --retranslate run. I have no game files and so no capture. The translation itself is untouched, only the two values handed to it. An RDNA card was not tried either.

Note

#312 took the issue's approach and was closed by its author without review. This is written separately, but the flags are the issue's own, so the two look alike.

Written with help from Claude; everything above was built and run on my machine.

**@⁠hussainmussa** on GitHub · 2026-11-26 23:27 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/388) `hussainmussa:fix/retranslate-host` → `a-publier` · +139 −7 · 2 files · 2 commits · open Fixes #302. ## What was wrong `victory replay --retranslate` set a 64-lane RDNA host whatever the run said (`set_host_max_wave(64)`, `set_host_rdna(true)`), and `replay.rs` read no environment variable. On a 32-lane card (NVIDIA, Intel) the folder held shaders that no run on that card makes, and `--shaders` then took them without a word. ## What this does Each of the two (widest wave, RDNA or not) is now taken, on its own, from: 1. a flag: `--host-wave <lanes>`, `--host-rdna`, `--no-host-rdna` (the last two refuse each other); 2. the environment: `VICTORY_HOST_WAVE` (and its alias `VICTORY_HOST_MAX_WAVE`) through the same `translate::host_wave::select` that `victory translate` uses, and `VICTORY_HOST_RDNA` with the same meaning (`1` is on); 3. this PC's card (`Host::translation_caps`), asked only when one of the two is still open; 4. a 64-lane RDNA card, when the card cannot be asked. The summary line and a log line name the host used: `N of M shaders translated for a 32-lane host (not RDNA), 1.2 s`. `docs/replay.md` lists the flags. **This goes one step past the issue.** It suggested 64-lane RDNA as the only fallback; step 3 puts the card in front of it, as `victory translate` does. On an RDNA card nothing changes. On an NVIDIA or Intel card, `--retranslate` with nothing set now writes that card's shaders, and `VICTORY_HOST_WAVE=32` alone no longer leaves the RDNA float paths on. If you would rather keep 64-lane RDNA as the plain default, step 3 is one closure to take out. ## Testing RTX 4070, Windows 11, Rust 1.98.1. - `cargo test -p victory --locked --features diagnostics`: the new tests `the_host_retranslate_translates_for` and `the_host_flags` pass, with the rest. - `cargo test -p xtask --locked`: 9 passed, `documented_switches_are_read` among them. - `cargo clippy -p victory --no-deps --all-targets --locked -- -D warnings`, with and without `--features diagnostics`: clean. - On this card `translation_caps` answers `(32, false)`, and with nothing set the host comes out as 32 lanes, not RDNA; with `--host-wave 64` alone, 64 lanes, not RDNA. **Not tested:** an actual `--retranslate` run. I have no game files and so no capture. The translation itself is untouched, only the two values handed to it. An RDNA card was not tried either. ## Note #312 took the issue's approach and was closed by its author without review. This is written separately, but the flags are the issue's own, so the two look alike. Written with help from Claude; everything above was built and run on my machine.
--retranslate set a 64-lane RDNA host whatever the run said, so the
folder held shaders no run on a 32-lane card makes. It now takes
VICTORY_HOST_WAVE (VICTORY_HOST_MAX_WAVE) and VICTORY_HOST_RDNA as
victory translate reads them, and --host-wave, --host-rdna and
--no-host-rdna over those. With nothing said it is a 64-lane RDNA card
as before. The summary line and the log name the host used.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
What neither a flag nor the environment says is now the card's, each of
the two on its own, as victory translate does. A 32-lane card with
nothing set gets its own shaders, and VICTORY_HOST_WAVE=32 alone no
longer leaves the RDNA float paths on. The card is asked only when one
of the two is open. A test for the three flags.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:58:58 +00:00
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-27 11:11 UTC · original

I ran --retranslate on a real capture on an RDNA card. RX 7900 XT (RDNA 3), driver 32.0.32029.2010, Windows 11 26300, diag profile. PR head 82482da against a-publier 4eb6cfd.

Capture: one world frame recorded with VICTORY_RECORD on 4eb6cfd (1,024 pipelines, 1,183 title shaders).

  • 4eb6cfd, replay <capture> --retranslate <folder> --view-limit 2097151 --raw-views 2097152: 21 containers not found, then 1162 of 1183 shaders translated, 19.5 s.
  • 82482da, the same plus --host-wave 64 --host-rdna: 21 containers not found, then 1162 of 1183 shaders translated for a 64-lane host (RDNA), 18.6 s. The log line reads replay: shaders retranslated done=1162 of=1183 host_wave=64 host_rdna=true. This run reused the containers the first run had collected.
  • The two folders are byte-identical: 1,162 .dxil files and 91,831,118 bytes each, diff -rq reports nothing, and sha256sum * | sha256sum gives 07062de70536e84d... for both.
  • The base folder replays (--compare --shaders-b <folder> --loops 11): 994 of 1024 pipelines made with shaders of the folder given, 0 refused, 17.41 ms on the card (median of 11 loops) against 17.44 ms with the recorded shaders.

So with the host named by flags, the PR writes what 4eb6cfd writes, on a real capture.

Not covered:

  • I gave both flags, so the card was not asked. Step 3 did not run here. Neither did the environment variables or a 32-lane host.
  • From reading the diff: when either value is still open, --retranslate now makes a D3D12 device (emit::host::Host::new(false)), where 4eb6cfd set the two constants and made none. If that fails it falls back to 64-lane RDNA. I did not run that path.
  • One capture, one card.

The replay above ran on 4eb6cfd plus the fix in #550. Without it, replay (not --retranslate) of a capture made with default settings loses the device on this card while it loads the contents. --retranslate does not load the capture onto the card, so it is not affected.

**@⁠adrianmjim** on GitHub · 2026-11-27 11:11 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/388#issuecomment-7216790316) I ran `--retranslate` on a real capture on an RDNA card. RX 7900 XT (RDNA 3), driver 32.0.32029.2010, Windows 11 26300, `diag` profile. PR head 82482da against a-publier 4eb6cfd. Capture: one world frame recorded with `VICTORY_RECORD` on 4eb6cfd (1,024 pipelines, 1,183 title shaders). - 4eb6cfd, `replay <capture> --retranslate <folder> --view-limit 2097151 --raw-views 2097152`: `21 containers not found`, then `1162 of 1183 shaders translated, 19.5 s`. - 82482da, the same plus `--host-wave 64 --host-rdna`: `21 containers not found`, then `1162 of 1183 shaders translated for a 64-lane host (RDNA), 18.6 s`. The log line reads `replay: shaders retranslated done=1162 of=1183 host_wave=64 host_rdna=true`. This run reused the containers the first run had collected. - The two folders are byte-identical: 1,162 `.dxil` files and 91,831,118 bytes each, `diff -rq` reports nothing, and `sha256sum * | sha256sum` gives `07062de70536e84d...` for both. - The base folder replays (`--compare --shaders-b <folder> --loops 11`): `994 of 1024 pipelines made with shaders of the folder given, 0 refused`, 17.41 ms on the card (median of 11 loops) against 17.44 ms with the recorded shaders. So with the host named by flags, the PR writes what 4eb6cfd writes, on a real capture. Not covered: - I gave both flags, so the card was not asked. Step 3 did not run here. Neither did the environment variables or a 32-lane host. - From reading the diff: when either value is still open, `--retranslate` now makes a D3D12 device (`emit::host::Host::new(false)`), where 4eb6cfd [set the two constants](https://github.com/Belobug/VIctory-Belobug-AMD/blob/4eb6cfd/apps/victory/src/replay.rs#L468-L469) and made none. If that fails it falls back to 64-lane RDNA. I did not run that path. - One capture, one card. The replay above ran on 4eb6cfd plus the fix in #550. Without it, `replay` (not `--retranslate`) of a capture made with default settings loses the device on this card while it loads the contents. `--retranslate` does not load the capture onto the card, so it is not affected.
Author
Owner

@⁠hussainmussa on GitHub · 2026-11-27 17:11 UTC · original

Thanks @⁠adrianmjim. Here are the parts you listed as not covered, on a 32-lane card: RTX 4070, Windows 11, diag build, head 82482da against 4eb6cfd. Capture: one frame of the sign-in screen (7 pipelines, 11 title shaders; 9 translate, 2 containers not found), --view-limit 2097151 --raw-views 2097152.

  • 4eb6cfd, nothing set: 9 of 11 shaders translated. Folder X.
  • 82482da, nothing set: translating for this PC's card: NVIDIA GeForce RTX 4070, then 9 of 11 shaders translated for a 32-lane host (not RDNA). Folder Y; 6 of the 9 files differ from X.
  • --host-wave 32 --no-host-rdna, and VICTORY_HOST_WAVE=32 alone: byte-identical to Y.
  • --host-wave 64 --host-rdna, and VICTORY_HOST_WAVE=64 VICTORY_HOST_RDNA=1: byte-identical to X.

Not covered: the capture is small, and I could not check the folders by replaying them. replay of this capture loses the device here (0x887A0006) on 4eb6cfd too, with no --shaders, which looks like what you describe before #550.

Written with help from Claude; everything above was run on my machine.

**@⁠hussainmussa** on GitHub · 2026-11-27 17:11 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/388#issuecomment-7224122319) Thanks @⁠adrianmjim. Here are the parts you listed as not covered, on a 32-lane card: RTX 4070, Windows 11, diag build, head 82482da against 4eb6cfd. Capture: one frame of the sign-in screen (7 pipelines, 11 title shaders; 9 translate, 2 containers not found), `--view-limit 2097151 --raw-views 2097152`. - 4eb6cfd, nothing set: `9 of 11 shaders translated`. Folder X. - 82482da, nothing set: `translating for this PC's card: NVIDIA GeForce RTX 4070`, then `9 of 11 shaders translated for a 32-lane host (not RDNA)`. Folder Y; 6 of the 9 files differ from X. - `--host-wave 32 --no-host-rdna`, and `VICTORY_HOST_WAVE=32` alone: byte-identical to Y. - `--host-wave 64 --host-rdna`, and `VICTORY_HOST_WAVE=64 VICTORY_HOST_RDNA=1`: byte-identical to X. Not covered: the capture is small, and I could not check the folders by replaying them. `replay` of this capture loses the device here (0x887A0006) on 4eb6cfd too, with no `--shaders`, which looks like what you describe before #550. Written with help from Claude; everything above was run on my machine.
This pull request can be merged automatically.
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/388/head:github-bot/gh-388'
git switch 'github-bot/gh-388'

Merge

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