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

Open
github-bot wants to merge 1 commit from github-bot/gh-4626 into main AGit
Owner

@⁠tyr0nsur on GitHub · 2026-12-01 00:09 UTC · original
tyr0nsur:claude/switch-registry → main · +325 −1 · 5 files · 1 commits · open

Step 1 of #4613 (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 #4613.

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 #4297 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: #4613. #4435 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

**@⁠tyr0nsur** on GitHub · 2026-12-01 00:09 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4626) `tyr0nsur:claude/switch-registry` → `main` · +325 −1 · 5 files · 1 commits · open Step 1 of #4613 (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 #4613. ## 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 #4297 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: #4613. #4435 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)
Step 1 of #4612. There is no list of switches: 928 names are read across
the crates, almost all through std::env::var, 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 no code on main reads.

apps/victory/build/switches.rs scans the src folders of crates/* and apps/*
when victory is built, as crates/victory-shader/build.rs does for the
translator's switches: every string literal that is exactly a VICTORY_ name,
with how it is read (toggled!, asked_for!, switch::on, env::var, or named
only) and where. Nothing generated is committed; the table is made again
when a member's sources change.

- victory switches [text]: the names holding text, how and where read.
- play: switches it is about to set that the table lacks are listed in the
  window and on a '# switches not in this build's sources:' line of the log,
  with the name most likely meant (two edits at most after VICTORY_, none on
  a tie). Case aside, as Windows reads them; prefixes the code tests with
  starts_with (VICTORY_PAD_, VICTORY_MENU_) count as known.
- A test checks that every switch play sets by default is in the table.

Reviewed with GPT-6.2: rerun-if-changed per member src folder, an empty
table warns of nothing, cautious wording, case folding and a stricter
suggestion came from that review.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 00:11:30 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/4627/head:github-bot/gh-4626'
git switch 'github-bot/gh-4626'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4626'
git switch 'github-bot/gh-4626'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4626'
git switch 'github-bot/gh-4626'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4626'
git switch 'main'
git merge --squash 'github-bot/gh-4626'
git switch 'main'
git merge --ff-only 'github-bot/gh-4626'
git switch 'main'
git merge 'github-bot/gh-4626'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/trustno1-coder--VIctory-NVIDIA!4627
No description provided.