Diagnostics: opt-in native Graphics settings tab and menu traces #2861

Open
AwkGrep256 wants to merge 16 commits from upstream-pr/2863 into main
AwkGrep256 commented 2026-11-25 22:37:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AwkGrep256 on 2026-11-25T22:37:22Z.


Draft · Native Graphics settings on Windows

@Marvisak, VIctory's settings now live inside the game's own Settings → Graphics menu. The Upscaler and Frame generation rows use the native arrows and counter, save to victory.toml, and apply on restart. The stock Graphics rows, which this build ships without text, now all have readable English. Related discussion #2862.

📊 What works

Status Result
✅ In game · cf6ab2b7/f40ffdf8 Upscaler row: arrows, counter, saved choice after reopening Settings, read on the next launch; AMD FSR then upscaled 1080p → 4K.
✅ In game · fdfc1ed3 Every stock Graphics row named (69 by label ID, 8 that have no ID). Frame generation row shows.
✅ In game · 8b10d9bd VIctory's share of opening Settings: ~0.4 ms (was ~4.7 s). The text table is found from DirectStorage reads as they land.
🧪 Next launch · 70ae1381 Headings for the two untitled groups, help text for 5 rows that had none.
🟡 Next Our own option names (Title default / AMD FSR / Off) instead of the borrowed Low / Medium. Frame generation is saved only until frame generation lands on this branch.

🧩 How the settings module works

A VIctory setting is one Rust enum plus one Choice impl. Everything else (the menu row, its range, reading victory.toml, saving it) comes from that impl.

victory.toml ──read──▶ Config ──from_config──▶ ListSetting ◀──▶ native ◀ ▶ row
     ▲                                             │
     └──────────────── file::save ◀── player picks ┘

1. The value (crates/victory-core/src/config.rs): a plain enum, spelled in victory.toml by serde.

#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum FrameGeneration {
    #[default]
    Off,
    AmdFsr,
}

2. The setting (crates/victory-core/src/settings/graphics.rs): where it is saved, what the menu says, and its options.

impl Choice for FrameGeneration {
    const CONFIG: ConfigKey = ConfigKey { section: "graphics", key: "frame_generation" };
    const NAME: Text = Text::own("victory_frame_generation", "Frame generation");
    const HELP: Text = Text::own(
        "victory_frame_generation_desc",
        "Inserts generated frames between rendered ones for smoother motion. \
         Applies after a restart.",
    );
    const OPTIONS: &'static [Opt<Self>] = &[
        Opt { value: FrameGeneration::Off,    label: Text::own("victory_frame_generation_off", "Off"),         toml: "off" },
        Opt { value: FrameGeneration::AmdFsr, label: Text::own("victory_frame_generation_amd_fsr", "AMD FSR"), toml: "amd_fsr" },
    ];

    fn from_config(config: &crate::Config) -> Self {
        config.frame_generation
    }
}

3. The row (apps/victory/src/menu_trace/settings_list.rs): one line makes it a menu row.

pub(super) static FRAME_GENERATION: ListSetting = ListSetting::of::<FrameGeneration>();
pub(super) static ALL: [&ListSetting; 2] = [&UPSCALER, &FRAME_GENERATION];

What the trait gives for free:

From the impl Used for
OPTIONS.len() The row's range (◀ ▶ stops at the ends)
from_config The choice shown when Settings opens
Opt::toml + CONFIG file::save rewrites just [graphics] frame_generation = '…', keeping the user's comments and order
NAME / HELP / Opt::label Menu text, added to the title's text table

Checks that stop mistakes at test time:

#[test]
fn frame_generation_is_well_formed() {
    assert_eq!(validate::<FrameGeneration>(), Ok(())); // no duplicate values, spellings or label IDs
}

#[test]
fn frame_generation_spellings_load_back() {
    assert_matches_serde::<FrameGeneration>();         // what the menu saves, victory.toml loads
}

Text::own refuses any key that doesn't start with victory_, at compile time, so our IDs stay apart from the title's.

🏷️ Text for the game's own rows

The same module holds the English for the stock rows (crates/victory-core/src/settings/stock_labels.rs), one table per language:

// A labelled row: matched by its name and help IDs, never by position.
StockLabel {
    name_id: 0x0b25_dfcf,
    name: "Upscaling quality",
    help_id: 0xda15_102a,
    help: Some("Render resolution used by the upscaler. Lower is faster, higher is sharper."),
},

// A row with no name ID: recognised by the labelled row before it.
UnnamedRow {
    after: 0x4d02_1b51, // Particle lighting quality
    nth: 1,
    name: Text::own("victory_stock_character_textures", "Character texture quality"),
    help: Text::own("victory_stock_character_textures_desc", "Resolution of character textures."),
},

// A group built without a heading: recognised by a row it holds.
GroupHeading {
    holds: 0xff7f_05de, // Display adapter
    heading: Text::own("victory_stock_group_display", "Display"),
},

The app side only applies these tables: it adds the text to the menu's text table and, as the title builds a nameless row or an untitled group, writes VIctory's IDs into it. If an update moves things, a row stays blank rather than getting the wrong name.

🌍 Localization proposal

The English for every VIctory control and every stock Graphics row is written and in one file. Would you like VIctory to ship translations for all languages the title supports? Each language is one more table next to EN, selected by VICTORY_LOCALE.

🧪 Try the draft

Use a Windows diagnostics build, Series X mode, title build 1.0.2.1, and a copied profile and config. Enable VICTORY_MENU_GRAPHICS=1 and VICTORY_MENU_UPSCALING_PROBE=1. Open Settings → Graphics: the stock rows should all have names, and the Upscaling section holds VIctory's two rows. Change only the VIctory rows. Applying a stock Graphics change previously caused an OOM, so please leave stock options and reset alone.

The menu and save test can run without the SDK. For host FSR after relaunch, point VICTORY_FIDELITYFX_DIR at the signed DX12 DLL folder and leave the manual upscaler and scale overrides unset.

@kotekompotek, @Jrjy3, and @z395977743-svg, thanks for the previous review and testing. A quick check on another setup would help. Please include the commit, GPU, and whether the row names, counter and saved choice behaved as expected.

Developer guide · Related Series X FSR work #1793 · The null placed-resource fix is a separate commit, 69e80cd1.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5500376130 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2863). Originally posted by [AwkGrep256](https://github.com/AwkGrep256) on 2026-11-25T22:37:22Z. --- **Draft · Native Graphics settings on Windows** @Marvisak, VIctory's settings now live inside the game's own **Settings → Graphics** menu. The **Upscaler** and **Frame generation** rows use the native arrows and counter, save to `victory.toml`, and apply on restart. The stock Graphics rows, which this build ships without text, now all have readable English. Related discussion #2862. ## 📊 What works | Status | Result | | --- | --- | | ✅ In game · `cf6ab2b7`/`f40ffdf8` | Upscaler row: arrows, counter, saved choice after reopening Settings, read on the next launch; AMD FSR then upscaled 1080p → 4K. | | ✅ In game · `fdfc1ed3` | **Every stock Graphics row named** (69 by label ID, 8 that have no ID). Frame generation row shows. | | ✅ In game · `8b10d9bd` | VIctory's share of opening Settings: **~0.4 ms** (was ~4.7 s). The text table is found from DirectStorage reads as they land. | | 🧪 Next launch · `70ae1381` | Headings for the two untitled groups, help text for 5 rows that had none. | | 🟡 Next | Our own option names (**Title default / AMD FSR / Off**) instead of the borrowed **Low / Medium**. Frame generation is saved only until frame generation lands on this branch. | ## 🧩 How the settings module works A VIctory setting is **one Rust enum plus one `Choice` impl**. Everything else (the menu row, its range, reading `victory.toml`, saving it) comes from that impl. ```text victory.toml ──read──▶ Config ──from_config──▶ ListSetting ◀──▶ native ◀ ▶ row ▲ │ └──────────────── file::save ◀── player picks ┘ ``` **1. The value** (`crates/victory-core/src/config.rs`): a plain enum, spelled in `victory.toml` by serde. ```rust #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Deserialize)] #[serde(rename_all = "snake_case")] pub enum FrameGeneration { #[default] Off, AmdFsr, } ``` **2. The setting** (`crates/victory-core/src/settings/graphics.rs`): where it is saved, what the menu says, and its options. ```rust impl Choice for FrameGeneration { const CONFIG: ConfigKey = ConfigKey { section: "graphics", key: "frame_generation" }; const NAME: Text = Text::own("victory_frame_generation", "Frame generation"); const HELP: Text = Text::own( "victory_frame_generation_desc", "Inserts generated frames between rendered ones for smoother motion. \ Applies after a restart.", ); const OPTIONS: &'static [Opt<Self>] = &[ Opt { value: FrameGeneration::Off, label: Text::own("victory_frame_generation_off", "Off"), toml: "off" }, Opt { value: FrameGeneration::AmdFsr, label: Text::own("victory_frame_generation_amd_fsr", "AMD FSR"), toml: "amd_fsr" }, ]; fn from_config(config: &crate::Config) -> Self { config.frame_generation } } ``` **3. The row** (`apps/victory/src/menu_trace/settings_list.rs`): one line makes it a menu row. ```rust pub(super) static FRAME_GENERATION: ListSetting = ListSetting::of::<FrameGeneration>(); pub(super) static ALL: [&ListSetting; 2] = [&UPSCALER, &FRAME_GENERATION]; ``` **What the trait gives for free:** | From the impl | Used for | |---|---| | `OPTIONS.len()` | The row's range (◀ ▶ stops at the ends) | | `from_config` | The choice shown when Settings opens | | `Opt::toml` + `CONFIG` | `file::save` rewrites just `[graphics] frame_generation = '…'`, keeping the user's comments and order | | `NAME` / `HELP` / `Opt::label` | Menu text, added to the title's text table | **Checks that stop mistakes at test time:** ```rust #[test] fn frame_generation_is_well_formed() { assert_eq!(validate::<FrameGeneration>(), Ok(())); // no duplicate values, spellings or label IDs } #[test] fn frame_generation_spellings_load_back() { assert_matches_serde::<FrameGeneration>(); // what the menu saves, victory.toml loads } ``` `Text::own` refuses any key that doesn't start with `victory_`, at compile time, so our IDs stay apart from the title's. ### 🏷️ Text for the game's own rows The same module holds the English for the stock rows (`crates/victory-core/src/settings/stock_labels.rs`), one table per language: ```rust // A labelled row: matched by its name and help IDs, never by position. StockLabel { name_id: 0x0b25_dfcf, name: "Upscaling quality", help_id: 0xda15_102a, help: Some("Render resolution used by the upscaler. Lower is faster, higher is sharper."), }, // A row with no name ID: recognised by the labelled row before it. UnnamedRow { after: 0x4d02_1b51, // Particle lighting quality nth: 1, name: Text::own("victory_stock_character_textures", "Character texture quality"), help: Text::own("victory_stock_character_textures_desc", "Resolution of character textures."), }, // A group built without a heading: recognised by a row it holds. GroupHeading { holds: 0xff7f_05de, // Display adapter heading: Text::own("victory_stock_group_display", "Display"), }, ``` The app side only applies these tables: it adds the text to the menu's text table and, as the title builds a nameless row or an untitled group, writes VIctory's IDs into it. If an update moves things, a row stays blank rather than getting the wrong name. ## 🌍 Localization proposal The English for every VIctory control and every stock Graphics row is written and in one file. Would you like VIctory to ship translations for **all languages the title supports**? Each language is one more table next to `EN`, selected by `VICTORY_LOCALE`. ## 🧪 Try the draft Use a Windows diagnostics build, Series X mode, title build 1.0.2.1, and a copied profile and config. Enable `VICTORY_MENU_GRAPHICS=1` and `VICTORY_MENU_UPSCALING_PROBE=1`. Open **Settings → Graphics**: the stock rows should all have names, and the **Upscaling** section holds VIctory's two rows. Change only the VIctory rows. Applying a stock Graphics change previously caused an OOM, so please leave stock options and reset alone. The menu and save test can run without the SDK. For host FSR after relaunch, point `VICTORY_FIDELITYFX_DIR` at the signed DX12 DLL folder and leave the manual upscaler and scale overrides unset. @kotekompotek, @Jrjy3, and @z395977743-svg, thanks for the previous review and testing. A quick check on another setup would help. Please include the commit, GPU, and whether the row names, counter and saved choice behaved as expected. [Developer guide](https://github.com/AwkGrep256/VIctory/blob/e476e1a6/docs/native-settings.md) · Related Series X FSR work #1793 · The null placed-resource fix is a separate commit, `69e80cd1`.
kotekompotek commented 2026-11-25 22:52:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T22:52:43Z.

Review: COMMENTED


Scoped review: +1500 but almost all additive — new opt-in menu_trace/settings_trace modules plus plumbing, flag-gated behind a diagnostics switch, so it can't affect a default run. The xgamesave extension (listing container contents) is the only behavioral surface outside the flag; reads like an additive query API. Worth a maintainer pass on the trace-format stability, but the risk profile is low.

<!-- greyfinch-sync:Marvisak/VIctory:review:6066084018 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2863#pullrequestreview-6066084018). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T22:52:43Z. **Review:** COMMENTED --- Scoped review: +1500 but almost all additive — new opt-in menu_trace/settings_trace modules plus plumbing, flag-gated behind a diagnostics switch, so it can't affect a default run. The xgamesave extension (listing container contents) is the only behavioral surface outside the flag; reads like an additive query API. Worth a maintainer pass on the trace-format stability, but the risk profile is low.
AwkGrep256 commented 2026-11-25 23:06:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AwkGrep256 on 2026-11-25T22:55:36Z.


Thanks for the review. One correction: the xgamesave change is also behind the switch. It only builds with the diagnostics feature and only runs with VICTORY_MENU_TRACE=1. It records what a settings save writes, compared with the blob it replaces, and adds no new API. Default runs are unchanged.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7176946315 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2863#issuecomment-7176946315). Originally posted by [AwkGrep256](https://github.com/AwkGrep256) on 2026-11-25T22:55:36Z. --- Thanks for the review. One correction: the xgamesave change is also behind the switch. It only builds with the `diagnostics` feature and only runs with `VICTORY_MENU_TRACE=1`. It records what a settings save writes, compared with the blob it replaces, and adds no new API. Default runs are unchanged.
AwkGrep256 commented 2026-11-26 18:32:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AwkGrep256 on 2026-11-26T18:32:45Z.


Belobug/VIctory-Belobug-AMD#274 tracks a test port of the native Graphics settings on Belobug’s current AMD fork. It links back here and has the menu, FSR and frame-generation test matrix. The upstream menu’s working save flow is the starting point. Fork gameplay results will go on Belobug/VIctory-Belobug-AMD#118 with the exact tested build.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7200583546 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2863#issuecomment-7200583546). Originally posted by [AwkGrep256](https://github.com/AwkGrep256) on 2026-11-26T18:32:45Z. --- Belobug/VIctory-Belobug-AMD#274 tracks a test port of the native Graphics settings on Belobug’s current AMD fork. It links back here and has the menu, FSR and frame-generation test matrix. The upstream menu’s working save flow is the starting point. Fork gameplay results will go on Belobug/VIctory-Belobug-AMD#118 with the exact tested build.
AwkGrep256 commented 2026-11-27 01:03:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AwkGrep256 on 2026-11-27T01:03:49Z.


Update: now at e476e1a6 (still a draft)

Area Change In game
Menu text lookup Found from DirectStorage reads as they land; no memory search on the menu thread ✅ ~0.4 ms on first Settings open (was ~4.7 s)
Stock Graphics rows VIctory English for every row, including 8 rows with no name ID ✅ all rows named
Frame generation Second Choice row, saved as [graphics] frame_generation ✅ row shows; saving shares the Upscaler path; not applied yet
Group headings, missing help Untitled groups and 5 rows get VIctory's text 🧪 next launch
Option names Still borrowed (Low / Medium) ⏳ next

Wording lives in crates/victory-core/src/settings/stock_labels.rs; how it fits is in docs/native-settings.md. cargo xtask policy, clippy and tests pass. Findings and details: #2862.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7206979488 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2863#issuecomment-7206979488). Originally posted by [AwkGrep256](https://github.com/AwkGrep256) on 2026-11-27T01:03:49Z. --- ### Update: now at `e476e1a6` (still a draft) | Area | Change | In game | |---|---|---| | Menu text lookup | Found from DirectStorage reads as they land; no memory search on the menu thread | ✅ ~0.4 ms on first Settings open (was ~4.7 s) | | Stock Graphics rows | VIctory English for every row, including 8 rows with no name ID | ✅ all rows named | | Frame generation | Second `Choice` row, saved as `[graphics] frame_generation` | ✅ row shows; saving shares the Upscaler path; not applied yet | | Group headings, missing help | Untitled groups and 5 rows get VIctory's text | 🧪 next launch | | Option names | Still borrowed (Low / Medium) | ⏳ next | Wording lives in `crates/victory-core/src/settings/stock_labels.rs`; how it fits is in `docs/native-settings.md`. `cargo xtask policy`, clippy and tests pass. Findings and details: #2862.
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/2863:upstream-pr/2863'
git switch 'upstream-pr/2863'

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/2863'
git switch 'upstream-pr/2863'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2863'
git switch 'upstream-pr/2863'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2863'
git switch 'main'
git merge --squash 'upstream-pr/2863'
git switch 'main'
git merge --ff-only 'upstream-pr/2863'
git switch 'main'
git merge 'upstream-pr/2863'
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
Marvisak/VIctory!2861
No description provided.