victory switches lists the VICTORY_* switches the code reads; play names the ones it sets that none of it does (#4612 step 1) #4626

Open
tyr0nsur wants to merge 1 commit from upstream-pr/4626 into main
tyr0nsur commented 2026-12-01 00:09:51 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-12-01T00:09:51Z.


Step 1 of #4612 (the switch registry).

What it changes

There is no list of switches. 928 VICTORY_* names are read across the crates, almost all through std::env::var (toggled!/asked_for! cover 36), and only F1's lines and docs/dlss.md describe a few. A switch typed wrong, or kept from another fork or an old guide, is ignored with nothing said. The play logs attached to 30 issues of 2026-11-30 set 14 names that no code on main reads (VICTORY_TEXTURE_DROP_MIPS, VICTORY_DLSS_RR, VICTORY_STAGING_PACK, ...).

  • apps/victory/build/switches.rs (called from build.rs) scans the src folder of each member of crates/* and apps/* when victory is built, as crates/victory-shader/build.rs already does for the translator's switches. It takes every string literal that is exactly a VICTORY_ name, with how it is read (toggled!, asked_for!, switch::on, env::var/var_os, or named only) and where. Nothing generated is committed. The table is made again when a member's sources change, so it cannot fall behind the code.
  • victory switches [text] lists the names holding text, with how each is read and its first place:
    > victory switches dlss_mode
    VICTORY_DLSS_MODE                            value                       apps/victory/src/play.rs:608 (+18 more)
    1 of 928 switches the code names
    
  • play: switches it is about to set that the table lacks (from the F1 menu's file or --set) are listed in the window and on a # switches not in this build's sources: ... line of the log, after the header. Each comes with the name most likely meant: at most two edits after VICTORY_, and none on a tie. Case doesn't matter, since Windows reads environment variables that way. Prefixes the code tests with starts_with (VICTORY_PAD_, VICTORY_MENU_) count as known. With an empty table (a build outside the workspace) nothing is reported.
  • A test checks that every switch play sets by default (SETTINGS) is in the table. All 57 are.

How each switch is read is a best effort from the call on the same line: a name read through a constant or a helper of its own shows as "named only". Telling whether a switch is live or read at the next start, and a one-line description of each, are left for the next step of #4612.

How it was tested

  • Windows 11, toolchain 1.98.1. cargo test -p victory --locked: 95 + 1 + 2 passed, including the new switches::tests (table sorted and filled, unknown names with their suggestion, case and prefix families, play's defaults all known).
  • cargo clippy -p victory --all-targets with and without --all-features, -D warnings: clean. The whole-workspace steps still stop at the findings #4296 fixes. cargo xtask policy: 466 files ok.
  • victory switches on this branch: 928 names (782 read as values, 70 on/off, 76 named only).
  • GPU-independent; no shader or runtime change.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #4612. #4434 also adds to apps/victory/build.rs: one line each, easy to merge in either order.

Reviewed with GPT-6.2 before opening: watching each member's src folder rather than whole directories, an empty table reporting nothing, the cautious wording, case folding and the stricter suggestion all came from that review.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5576158930 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4626). Originally posted by [tyr0nsur](https://github.com/tyr0nsur) on 2026-12-01T00:09:51Z. --- Step 1 of #4612 (the switch registry). ## What it changes There is no list of switches. **928 `VICTORY_*` names** are read across the crates, almost all through `std::env::var` (`toggled!`/`asked_for!` cover 36), and only F1's lines and `docs/dlss.md` describe a few. A switch typed wrong, or kept from another fork or an old guide, is ignored with nothing said. The play logs attached to 30 issues of 2026-11-30 set 14 names that no code on `main` reads (`VICTORY_TEXTURE_DROP_MIPS`, `VICTORY_DLSS_RR`, `VICTORY_STAGING_PACK`, ...). - **`apps/victory/build/switches.rs`** (called from `build.rs`) scans the `src` folder of each member of `crates/*` and `apps/*` when `victory` is built, as `crates/victory-shader/build.rs` already does for the translator's switches. It takes every string literal that is exactly a `VICTORY_` name, with how it is read (`toggled!`, `asked_for!`, `switch::on`, `env::var`/`var_os`, or named only) and where. Nothing generated is committed. The table is made again when a member's sources change, so it cannot fall behind the code. - **`victory switches [text]`** lists the names holding *text*, with how each is read and its first place: ``` > victory switches dlss_mode VICTORY_DLSS_MODE value apps/victory/src/play.rs:608 (+18 more) 1 of 928 switches the code names ``` - **`play`**: switches it is about to set that the table lacks (from the F1 menu's file or `--set`) are listed in the window and on a `# switches not in this build's sources: ...` line of the log, after the header. Each comes with the name most likely meant: at most two edits after `VICTORY_`, and none on a tie. Case doesn't matter, since Windows reads environment variables that way. Prefixes the code tests with `starts_with` (`VICTORY_PAD_`, `VICTORY_MENU_`) count as known. With an empty table (a build outside the workspace) nothing is reported. - A test checks that every switch `play` sets by default (`SETTINGS`) is in the table. All 57 are. How each switch is read is a best effort from the call on the same line: a name read through a constant or a helper of its own shows as "named only". Telling whether a switch is live or read at the next start, and a one-line description of each, are left for the next step of #4612. ## How it was tested - Windows 11, toolchain 1.98.1. `cargo test -p victory --locked`: 95 + 1 + 2 passed, including the new `switches::tests` (table sorted and filled, unknown names with their suggestion, case and prefix families, `play`'s defaults all known). - `cargo clippy -p victory --all-targets` with and without `--all-features`, `-D warnings`: clean. The whole-workspace steps still stop at the findings #4296 fixes. `cargo xtask policy`: 466 files ok. - `victory switches` on this branch: 928 names (782 read as values, 70 on/off, 76 named only). - GPU-independent; no shader or runtime change. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #4612. #4434 also adds to `apps/victory/build.rs`: one line each, easy to merge in either order. Reviewed with GPT-6.2 before opening: watching each member's `src` folder rather than whole directories, an empty table reporting nothing, the cautious wording, case folding and the stricter suggestion all came from that review. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/4626:upstream-pr/4626'
git switch 'upstream-pr/4626'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/4626'
git switch 'upstream-pr/4626'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/4626'
git switch 'upstream-pr/4626'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/4626'
git switch 'main'
git merge --squash 'upstream-pr/4626'
git switch 'main'
git merge --ff-only 'upstream-pr/4626'
git switch 'main'
git merge 'upstream-pr/4626'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!4626
No description provided.