docs/README-fxceless.md names two pacing switches no code reads (VICTORY_LATE_WAIT, VICTORY_WIDE_REFRESH), and the live near-miss VICTORY_LATE_WAITS does the opposite #49

Closed
opened 2026-11-26 03:31:34 +00:00 by github-bot · 3 comments
Owner

@⁠itsonewi on GitHub · 2026-11-26 00:16 UTC · original

Two of the four switches in the README's frame-rate table are not read by any code in the tree, and the nearest live name means the opposite of what the table says.

The table

docs/README-fxceless.md:48:

| Frame rate in the world | 2-4 fps: 420-450 ms per frame by default, 240-350 ms with the newer switches (VICTORY_RELAY=2, or VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024) |

and again at :135, :136, :144-145:

  • Submissions can be sent ahead of the wait for the card (VICTORY_LATE_WAIT), with a relay thread that lands results as the card finishes (VICTORY_RELAY) ...
  • Independent host-copy refreshes run in parallel by default on systems with at least four logical CPUs (VICTORY_WIDE_REFRESH=0 disables this; =1 forces it).

What the code reads

documented name read anywhere? what the code has instead
VICTORY_LATE_WAIT no — the string exists only in docs/README-fxceless.md and in two comments (crates/victory-gpu/src/inplace.rs:78, crates/victory-gpu/src/shadow.rs:2599) VICTORY_LATE_WAITS (crates/victory-gpu/src/frame.rs:142-144), which is not the same thing: it reverts the late-wait shortcut ("sleeps to the next tick, as before"), i.e. it turns the optimisation off
VICTORY_WIDE_REFRESH no — the string exists only in docs/README-fxceless.md nothing: the wide refresh is unconditional, wide_threads() = available_parallelism().map_or(4, |n| n.get() / 4).clamp(2, 6) (crates/victory-gpu/src/shadow.rs:1486-1487). There is no switch to disable it and none to force it
VICTORY_WIDE_BACK yes shadow.rs:1451-1454 (!= "0")
VICTORY_CARD_BUFFERS_MIN_MB yes shadow.rs:224 — but see below
VICTORY_CARD_BUFFERS_MB yes shadow.rs:225

Two ways this bites

  1. The documented value is not accepted either. Even with the right spelling, frame.rs:144 reads VICTORY_LATE_WAITS as is_some_and(|v| v == "1"), so the table's VICTORY_LATE_WAIT=3 would be off with the correct name too. Neighbouring switches disagree on this: VICTORY_WIDE_BACK and VICTORY_CARD_BUFFERS use != "0" (any value on), VICTORY_REFRESH_CHECK uses == "1", VICTORY_WEB-style ones use is_none_or. A user cannot tell from the docs which convention a given switch follows.
  2. A near-miss name does the opposite of what was asked. Someone who reads the table, sees no effect from VICTORY_LATE_WAIT, and guesses VICTORY_LATE_WAITS=1 gets the revert of the behaviour they were trying to enable, and the log line they compare against changes for that reason alone. That is worse than a dead switch, because it looks like the tuning worked.

It has already happened

In #34, run 3 of a report on an RX 6800 used exactly LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024 — the README line verbatim — and reported no difference from default. Two of those five assignments could not have done anything.

Third name, same shape

VICTORY_CARD_BUFFERS_MIN_MB and VICTORY_CARD_BUFFERS_MIN_KB are both read (shadow.rs:224-232), and the KB one silently overrides the MB one when it parses above zero:

if let Some(kib) = std::env::var("VICTORY_CARD_BUFFERS_MIN_KB").ok().and_then(|v| v.trim().parse::<u64>().ok())
    && kib > 0
{
    min_bytes = kib << 10;
}

The README names only the MB form; docs/findings.md names only the KB form. Both are live, one wins silently, and no document says so. This is the same class as #27 (VICTORY_HOST_WAVE / VICTORY_HOST_MAX_WAVE), which is why it is worth one pass over the switch list rather than a fix per name.

Fix

  1. README-fxceless.md:48 and :135 should name the switch the code reads. If VICTORY_LATE_WAIT is meant to be the switch that enables ahead-of-wait submission and that is now the default, say so and drop the switch from the table.
  2. :136 should either become VICTORY_WIDE_REFRESH implemented in wide_threads() (0 = one thread, 1 = the computed count) or stop offering a switch that does not exist — the sentence already states the real rule (parallel by default on ≥4 logical CPUs), so the parenthetical is the only wrong part.
  3. Make the value convention uniform (any value but 0 means on) or state it per switch, so =3 in a table is not silently off.
  4. Document that VICTORY_CARD_BUFFERS_MIN_KB wins over VICTORY_CARD_BUFFERS_MIN_MB, or make the KB form apply only when the MB one is absent.

A test would help and is cheap: a table of (name, expected) for the switches the docs promise, asserting each name appears in at least one std::env::var* call in the tree — the kind of thing xtask can do without a GPU, and the only thing that would have caught this.

Not checked

Read from docs/README-fxceless.md, frame.rs, shadow.rs and inplace.rs at 0a43566, plus a repository-wide content search for each name (the two dead names appear in no source file). I did not run the title with any of these switches, so "no difference" in #34 is the reporter's observation, not mine.

AI use

AI-assisted review (source and documentation reading, repository content search). No build, no run, no game files.

**@⁠itsonewi** on GitHub · 2026-11-26 00:16 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/49) Two of the four switches in the README's frame-rate table are not read by any code in the tree, and the nearest live name means the opposite of what the table says. ## The table `docs/README-fxceless.md:48`: > | Frame rate in the world | 2-4 fps: 420-450 ms per frame by default, 240-350 ms with the newer switches (`VICTORY_RELAY=2`, or `VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024`) | and again at `:135`, `:136`, `:144-145`: > - Submissions can be sent ahead of the wait for the card (`VICTORY_LATE_WAIT`), with a relay thread that lands results as the card finishes (`VICTORY_RELAY`) ... > - Independent host-copy refreshes run in parallel by default on systems with at least four logical CPUs (`VICTORY_WIDE_REFRESH=0` disables this; `=1` forces it). ## What the code reads | documented name | read anywhere? | what the code has instead | |---|---|---| | `VICTORY_LATE_WAIT` | **no** — the string exists only in `docs/README-fxceless.md` and in two comments (`crates/victory-gpu/src/inplace.rs:78`, `crates/victory-gpu/src/shadow.rs:2599`) | `VICTORY_LATE_WAITS` (`crates/victory-gpu/src/frame.rs:142-144`), which is not the same thing: it *reverts* the late-wait shortcut ("sleeps to the next tick, as before"), i.e. it turns the optimisation **off** | | `VICTORY_WIDE_REFRESH` | **no** — the string exists only in `docs/README-fxceless.md` | nothing: the wide refresh is unconditional, `wide_threads()` = `available_parallelism().map_or(4, \|n\| n.get() / 4).clamp(2, 6)` (`crates/victory-gpu/src/shadow.rs:1486-1487`). There is no switch to disable it and none to force it | | `VICTORY_WIDE_BACK` | yes | `shadow.rs:1451-1454` (`!= "0"`) | | `VICTORY_CARD_BUFFERS_MIN_MB` | yes | `shadow.rs:224` — but see below | | `VICTORY_CARD_BUFFERS_MB` | yes | `shadow.rs:225` | ## Two ways this bites 1. **The documented value is not accepted either.** Even with the right spelling, `frame.rs:144` reads `VICTORY_LATE_WAITS` as `is_some_and(|v| v == "1")`, so the table's `VICTORY_LATE_WAIT=3` would be off with the correct name too. Neighbouring switches disagree on this: `VICTORY_WIDE_BACK` and `VICTORY_CARD_BUFFERS` use `!= "0"` (any value on), `VICTORY_REFRESH_CHECK` uses `== "1"`, `VICTORY_WEB`-style ones use `is_none_or`. A user cannot tell from the docs which convention a given switch follows. 2. **A near-miss name does the opposite of what was asked.** Someone who reads the table, sees no effect from `VICTORY_LATE_WAIT`, and guesses `VICTORY_LATE_WAITS=1` gets the *revert* of the behaviour they were trying to enable, and the log line they compare against changes for that reason alone. That is worse than a dead switch, because it looks like the tuning worked. ## It has already happened In #34, run 3 of a report on an RX 6800 used exactly `LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024` — the README line verbatim — and reported no difference from default. Two of those five assignments could not have done anything. ## Third name, same shape `VICTORY_CARD_BUFFERS_MIN_MB` and `VICTORY_CARD_BUFFERS_MIN_KB` are both read (`shadow.rs:224-232`), and the KB one **silently overrides** the MB one when it parses above zero: ```rust if let Some(kib) = std::env::var("VICTORY_CARD_BUFFERS_MIN_KB").ok().and_then(|v| v.trim().parse::<u64>().ok()) && kib > 0 { min_bytes = kib << 10; } ``` The README names only the MB form; `docs/findings.md` names only the KB form. Both are live, one wins silently, and no document says so. This is the same class as #27 (`VICTORY_HOST_WAVE` / `VICTORY_HOST_MAX_WAVE`), which is why it is worth one pass over the switch list rather than a fix per name. ## Fix 1. `README-fxceless.md:48` and `:135` should name the switch the code reads. If `VICTORY_LATE_WAIT` is meant to be the switch that *enables* ahead-of-wait submission and that is now the default, say so and drop the switch from the table. 2. `:136` should either become `VICTORY_WIDE_REFRESH` **implemented** in `wide_threads()` (0 = one thread, 1 = the computed count) or stop offering a switch that does not exist — the sentence already states the real rule (parallel by default on ≥4 logical CPUs), so the parenthetical is the only wrong part. 3. Make the value convention uniform (any value but `0` means on) or state it per switch, so `=3` in a table is not silently off. 4. Document that `VICTORY_CARD_BUFFERS_MIN_KB` wins over `VICTORY_CARD_BUFFERS_MIN_MB`, or make the KB form apply only when the MB one is absent. A test would help and is cheap: a table of `(name, expected)` for the switches the docs promise, asserting each name appears in at least one `std::env::var*` call in the tree — the kind of thing `xtask` can do without a GPU, and the only thing that would have caught this. ## Not checked Read from `docs/README-fxceless.md`, `frame.rs`, `shadow.rs` and `inplace.rs` at `0a43566`, plus a repository-wide content search for each name (the two dead names appear in no source file). I did not run the title with any of these switches, so "no difference" in #34 is the reporter's observation, not mine. ## AI use AI-assisted review (source and documentation reading, repository content search). No build, no run, no game files.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:31:34 +00:00
Author
Owner

@⁠itsonewi on GitHub · 2026-11-26 00:17 UTC · original

A third dead name, and the method that found it, so the fix can be checked off name by name rather than guessed at.

VICTORY_MERGE_RACE

docs/README-fxceless.md:115:

  • Counters, all off or diagnostics-only: VICTORY_MERGE_RACE=1 (title bytes ...)

A repository-wide content search finds VICTORY_MERGE_RACE in docs/README-fxceless.md and in no source file — no std::env::var, no string literal, no comment. So the counter the line offers cannot be turned on.

What I checked, and how

For each documented name: a content search over the default branch (search/code, repo:avatarmanz/VIctory-7900XTX <name>), then keep the paths that are not under docs/. A name whose only hits are documentation is dead.

Documented and live (so nobody needs to re-check these):

name where it is read
VICTORY_INPLACE crates/victory-gpu/src/inplace.rs
VICTORY_XMA_DUMP crates/victory-hle/src/modules/audio.rs
VICTORY_SHADER_OPT crates/victory-shader/src/emit/mod.rs, emit/bitcode/opt.rs
VICTORY_GPU_TIMING crates/victory-gpu/src/copystat.rs
VICTORY_POKE apps/victory/src/run.rs
VICTORY_KEYS crates/victory-hle/src/modules/gameinput.rs
VICTORY_WATCH apps/victory/src/run.rs
VICTORY_LATE_WAIT (as a documented name) nowhere — the report above

Documented and dead, all three of the same shape:

  1. VICTORY_LATE_WAIT (:48, :135, :144) — the live name is VICTORY_LATE_WAITS and means the opposite.
  2. VICTORY_WIDE_REFRESH (:136) — nothing reads it; wide_threads() (shadow.rs:1486-1487) is unconditional.
  3. VICTORY_MERGE_RACE (:115) — nothing reads it.

Not verified

Two names I could not settle: VICTORY_WALLS_TRACE (:117) and VICTORY_CAPTURE_FRAMES (:317) — the search API's rate limit stopped the check (10 requests a minute). They may be live under another file; whoever picks this up should run the same query for them before touching the docs, and treat "no hits outside docs/" as the test.

The check that would keep this from coming back

xtask already holds the asset policy test and runs in cargo test. A second test holding (documented_name, expected_read) pairs and grepping the sources for each name would have caught all three, needs no GPU and no game files, and is the only artefact that stays correct as switches get renamed. It also gives the dead-switch count a place to live in CI — which matters more than usual right now, since #45 shows the test step can be skipped entirely by a Clippy failure.

(AI-assisted, repository content searches plus source reading at 0a43566.)

**@⁠itsonewi** on GitHub · 2026-11-26 00:17 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/49#issuecomment-7178609993) A third dead name, and the method that found it, so the fix can be checked off name by name rather than guessed at. ## `VICTORY_MERGE_RACE` `docs/README-fxceless.md:115`: > - Counters, all off or diagnostics-only: `VICTORY_MERGE_RACE=1` (title bytes ...) A repository-wide content search finds `VICTORY_MERGE_RACE` in `docs/README-fxceless.md` and in no source file — no `std::env::var`, no string literal, no comment. So the counter the line offers cannot be turned on. ## What I checked, and how For each documented name: a content search over the default branch (`search/code`, `repo:avatarmanz/VIctory-7900XTX <name>`), then keep the paths that are not under `docs/`. A name whose only hits are documentation is dead. Documented and **live** (so nobody needs to re-check these): | name | where it is read | |---|---| | `VICTORY_INPLACE` | `crates/victory-gpu/src/inplace.rs` | | `VICTORY_XMA_DUMP` | `crates/victory-hle/src/modules/audio.rs` | | `VICTORY_SHADER_OPT` | `crates/victory-shader/src/emit/mod.rs`, `emit/bitcode/opt.rs` | | `VICTORY_GPU_TIMING` | `crates/victory-gpu/src/copystat.rs` | | `VICTORY_POKE` | `apps/victory/src/run.rs` | | `VICTORY_KEYS` | `crates/victory-hle/src/modules/gameinput.rs` | | `VICTORY_WATCH` | `apps/victory/src/run.rs` | | `VICTORY_LATE_WAIT` (as a documented name) | nowhere — the report above | Documented and **dead**, all three of the same shape: 1. `VICTORY_LATE_WAIT` (`:48`, `:135`, `:144`) — the live name is `VICTORY_LATE_WAITS` and means the opposite. 2. `VICTORY_WIDE_REFRESH` (`:136`) — nothing reads it; `wide_threads()` (`shadow.rs:1486-1487`) is unconditional. 3. `VICTORY_MERGE_RACE` (`:115`) — nothing reads it. ## Not verified Two names I could not settle: `VICTORY_WALLS_TRACE` (`:117`) and `VICTORY_CAPTURE_FRAMES` (`:317`) — the search API's rate limit stopped the check (10 requests a minute). They may be live under another file; whoever picks this up should run the same query for them before touching the docs, and treat "no hits outside `docs/`" as the test. ## The check that would keep this from coming back `xtask` already holds the asset policy test and runs in `cargo test`. A second test holding `(documented_name, expected_read)` pairs and grepping the sources for each name would have caught all three, needs no GPU and no game files, and is the only artefact that stays correct as switches get renamed. It also gives the dead-switch count a place to live in CI — which matters more than usual right now, since #45 shows the test step can be skipped entirely by a Clippy failure. (AI-assisted, repository content searches plus source reading at `0a43566`.)
Author
Owner

@⁠timorjay on GitHub · 2026-11-26 00:26 UTC · original

I checked the Windows renderer at 0a43566, the revision in this report. Both settings have readers in crates/victory-gpu/src/host.rs.

  • late_stage() reads VICTORY_LATE_WAIT and accepts 1, 2, or 3. An explicit 0 selects stage zero. The presence of VICTORY_GPU_TIMING also forces stage zero before that setting is read, which matters for an A/B run. Submission stage selection
  • wide_refresh() reads VICTORY_WIDE_REFRESH. 0 disables parallel refresh, 1 forces it, and the default enables it with at least four logical CPUs. Refresh selection and its test

The similarly named VICTORY_LATE_WAITS controls the frame tick in frame.rs. Both spellings are active and affect different waits. Frame pacing

Codex-assisted source review of the pinned revision.

**@⁠timorjay** on GitHub · 2026-11-26 00:26 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/49#issuecomment-7178753650) I checked the Windows renderer at `0a43566`, the revision in this report. Both settings have readers in `crates/victory-gpu/src/host.rs`. - `late_stage()` reads `VICTORY_LATE_WAIT` and accepts `1`, `2`, or `3`. An explicit `0` selects stage zero. The presence of `VICTORY_GPU_TIMING` also forces stage zero before that setting is read, which matters for an A/B run. [Submission stage selection](https://github.com/avatarmanz/VIctory-7900XTX/blob/0a43566532c57b34a5397d6fdc91e419de32e8e9/crates/victory-gpu/src/host.rs#L2331-L2346) - `wide_refresh()` reads `VICTORY_WIDE_REFRESH`. `0` disables parallel refresh, `1` forces it, and the default enables it with at least four logical CPUs. [Refresh selection and its test](https://github.com/avatarmanz/VIctory-7900XTX/blob/0a43566532c57b34a5397d6fdc91e419de32e8e9/crates/victory-gpu/src/host.rs#L7432-L7459) The similarly named `VICTORY_LATE_WAITS` controls the frame tick in `frame.rs`. Both spellings are active and affect different waits. [Frame pacing](https://github.com/avatarmanz/VIctory-7900XTX/blob/0a43566532c57b34a5397d6fdc91e419de32e8e9/crates/victory-gpu/src/frame.rs#L137-L149) Codex-assisted source review of the pinned revision.
Author
Owner

@⁠JaoNike on GitHub · 2026-11-26 03:04 UTC · original

Hey! I want to help contribute to the port, but I can't find the .exe file anywhere. Is there a download link available? Thanks!

**@⁠JaoNike** on GitHub · 2026-11-26 03:04 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/49#issuecomment-7181364451) Hey! I want to help contribute to the port, but I can't find the .exe file anywhere. Is there a download link available? Thanks!
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/avatarmanz--VIctory-7900XTX#49
No description provided.