victory replay --retranslate always translates for a 64-lane RDNA host, whatever VICTORY_HOST_WAVE/VICTORY_HOST_RDNA say #302

Open
opened 2026-11-26 19:49:10 +00:00 by github-bot · 0 comments
Owner

@⁠itsonewi on GitHub · 2026-11-26 19:33 UTC · original

What happens

docs/replay.md says --retranslate translates with the switches of the run:

| --retranslate <folder> | only writes that folder: the capture's shaders translated by this build with the VICTORY_* switches of this run (--view-limit, --raw-views: the view heap's null slot and where raw views start, as the capture's shaders have them) |

docs/replay.md:73

The two other translator switches that describe the host — the widest wave and whether the card is RDNA — are hardcoded there instead:

    victory_shader::emit::set_host_max_wave(64);
    victory_shader::emit::set_host_rdna(true);
    victory_shader::emit::set_view_heap_limit(view_limit);
    victory_shader::emit::set_raw_views(raw_views);

apps/victory/src/replay.rs:468-471

apps/victory/src/replay.rs reads no environment variable at all (no std::env::var/var_os in the file), and the two setters only store into process-wide atomics the translator reads later (crates/victory-shader/src/emit/lower.rs:1432-1438, :1521-1527, read back in host_max_wave :1582-1586 and host_rdna :1536-1542), so nothing afterwards can take them back:

  • VICTORY_HOST_WAVE=32 / VICTORY_HOST_MAX_WAVE=32 have no effect on the folder: it always holds 64-lane DXIL.
  • VICTORY_HOST_RDNA=0 has no effect either: host_rdna() is asked and answers yes, so the RDNA float lowering is on. (VICTORY_RDNA_FLOAT=0 can still empty the bit set, but the host is RDNA whatever it says.)

Every other caller takes those two from somewhere real:

  • victory translate — VICTORY_HOST_WAVE/VICTORY_HOST_MAX_WAVE, and VICTORY_HOST_RDNA falling back to the adapter (apps/victory/src/translate.rs:263-270);
  • anything that makes a device — the driver's own WaveLaneCountMax and wave range (crates/victory-gpu/src/host.rs:1052-1056), which is what victory run translates the title with.

The translation fingerprint keys the cache and the shader cache on exactly these values (crates/victory-shader/src/emit/mod.rs:296-297 next to the VICTORY_* names at :288-295).

Why it matters

--retranslate is the front half of --shaders <folder>: translate the capture's shaders with this build, then run the frame with them to compare a lowering change (the --shaders and --retranslate rows, docs/replay.md:72-73). On a host whose widest wave is 32 — an NVIDIA or Intel driver, the case VICTORY_HOST_WAVE and VICTORY_HOST_RDNA exist for, and the subject of #299 — the folder does not hold what this build makes for that machine:

  • host_max_wave is what decides whether a console wave64 program with cross-lane code is lowered to run in 32-lane halves or refused (crates/victory-shader/src/emit/lower.rs:1434-1435), so some shaders come out different and some are built that the host would have refused;
  • the RDNA float paths change the arithmetic, and they are forced on.

--shaders then takes those files without a word — they are named by the hashes the capture uses — and the replay reports times and a picture for a translation no run of the title produces, which is the one thing this mode must not do. The gap is visible in the doc itself: the author listed the host facts here and gave flags for two of them (--view-limit, --raw-views) and none for these two, so the 32-lane case cannot be asked for at all — the environment is the only other way in, and it is ignored.

If 64/true is deliberate because this fork targets RDNA series X (as host.rs:1052-1056 reports for such a card), then the sentence in docs/replay.md:73 should not promise "the VICTORY_* switches of this run", and the 32-lane hosts still have no way to ask.

Suggested fix

Take the two the way victory translate does — VICTORY_HOST_WAVE/VICTORY_HOST_MAX_WAVE, then VICTORY_HOST_RDNA — and add the pair of flags the view heap already has, for a capture made on another machine:

        --host-wave 32          (with --retranslate: VICTORY_HOST_WAVE's meaning)
        --host-rdna / --no-host-rdna

with 64 and RDNA as the fallback only when neither a flag nor the environment says anything, and print what was used next to the count it already prints ({} of {} shaders translated), so a folder translated for another host is recognisable from the output and from the log.

AI use

Found by an AI agent (Freebuff) reading a-publier at cd8dfc0 through the GitHub API, after deduplicating against the open and closed issues. Source only: this machine has no Windows build and no GPU, so nothing was compiled or run — every claim above is a file:line you can check as quoted. Filed by the same agent that filed #280–#293.

**@⁠itsonewi** on GitHub · 2026-11-26 19:33 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/302) ## What happens `docs/replay.md` says `--retranslate` translates with the switches of the run: > | `--retranslate <folder>` | only writes that folder: the capture's shaders translated by this build with the `VICTORY_*` switches of this run (`--view-limit`, `--raw-views`: the view heap's null slot and where raw views start, as the capture's shaders have them) | `docs/replay.md:73` The two *other* translator switches that describe the host — the widest wave and whether the card is RDNA — are hardcoded there instead: ```rust victory_shader::emit::set_host_max_wave(64); victory_shader::emit::set_host_rdna(true); victory_shader::emit::set_view_heap_limit(view_limit); victory_shader::emit::set_raw_views(raw_views); ``` `apps/victory/src/replay.rs:468-471` `apps/victory/src/replay.rs` reads no environment variable at all (no `std::env::var`/`var_os` in the file), and the two setters only store into process-wide atomics the translator reads later (`crates/victory-shader/src/emit/lower.rs:1432-1438`, `:1521-1527`, read back in `host_max_wave` `:1582-1586` and `host_rdna` `:1536-1542`), so nothing afterwards can take them back: * `VICTORY_HOST_WAVE=32` / `VICTORY_HOST_MAX_WAVE=32` have no effect on the folder: it always holds 64-lane DXIL. * `VICTORY_HOST_RDNA=0` has no effect either: `host_rdna()` is asked and answers yes, so the RDNA float lowering is on. (`VICTORY_RDNA_FLOAT=0` can still empty the bit set, but the host is RDNA whatever it says.) Every other caller takes those two from somewhere real: * `victory translate` — `VICTORY_HOST_WAVE`/`VICTORY_HOST_MAX_WAVE`, and `VICTORY_HOST_RDNA` falling back to the adapter (`apps/victory/src/translate.rs:263-270`); * anything that makes a device — the driver's own `WaveLaneCountMax` and wave range (`crates/victory-gpu/src/host.rs:1052-1056`), which is what `victory run` translates the title with. The translation fingerprint keys the cache and the shader cache on exactly these values (`crates/victory-shader/src/emit/mod.rs:296-297` next to the `VICTORY_*` names at `:288-295`). ## Why it matters `--retranslate` is the front half of `--shaders <folder>`: translate the capture's shaders with *this* build, then run the frame with them to compare a lowering change (the `--shaders` and `--retranslate` rows, `docs/replay.md:72-73`). On a host whose widest wave is 32 — an NVIDIA or Intel driver, the case `VICTORY_HOST_WAVE` and `VICTORY_HOST_RDNA` exist for, and the subject of #299 — the folder does not hold what this build makes for that machine: * `host_max_wave` is what decides whether a console wave64 program with cross-lane code is lowered to run in 32-lane halves or refused (`crates/victory-shader/src/emit/lower.rs:1434-1435`), so some shaders come out different and some are built that the host would have refused; * the RDNA float paths change the arithmetic, and they are forced on. `--shaders` then takes those files without a word — they are named by the hashes the capture uses — and the replay reports times and a picture for a translation no run of the title produces, which is the one thing this mode must not do. The gap is visible in the doc itself: the author listed the host facts here and gave flags for two of them (`--view-limit`, `--raw-views`) and none for these two, so the 32-lane case cannot be asked for at all — the environment is the only other way in, and it is ignored. If 64/`true` is deliberate because this fork targets RDNA series X (as `host.rs:1052-1056` reports for such a card), then the sentence in `docs/replay.md:73` should not promise "the `VICTORY_*` switches of this run", and the 32-lane hosts still have no way to ask. ## Suggested fix Take the two the way `victory translate` does — `VICTORY_HOST_WAVE`/`VICTORY_HOST_MAX_WAVE`, then `VICTORY_HOST_RDNA` — and add the pair of flags the view heap already has, for a capture made on another machine: ``` --host-wave 32 (with --retranslate: VICTORY_HOST_WAVE's meaning) --host-rdna / --no-host-rdna ``` with 64 and RDNA as the fallback only when neither a flag nor the environment says anything, and print what was used next to the count it already prints (`{} of {} shaders translated`), so a folder translated for another host is recognisable from the output and from the log. ## AI use Found by an AI agent (Freebuff) reading `a-publier` at `cd8dfc0` through the GitHub API, after deduplicating against the open and closed issues. Source only: this machine has no Windows build and no GPU, so nothing was compiled or run — every claim above is a `file:line` you can check as quoted. Filed by the same agent that filed #280–#293.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:49:10 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.