Repository navigation
Diagnostics: opt-in native Graphics settings tab and menu traces - #2863
AwkGrep256 wants to merge 16 commits into
Conversation
VICTORY_MENU_GRAPHICS=1 registers the title's hidden Graphics section right after Video through its own section-registration code, on builds whose call sites match the validated byte patterns. Unrecognized builds are left alone. VICTORY_MENU_ROW_TRACE=1 logs the row IDs created for Video and Graphics. VICTORY_MENU_TRACE=1 logs section registration, controller changes and the settings save path. All switches are off by default. Confirming a change to a stock Graphics option can crash the title, so the tab is for browsing only.
434b884 to
0c0bb04
Compare
kotekompotek
left a comment
There was a problem hiding this comment.
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.
|
Thanks for the review. One correction: the xgamesave change is also behind the switch. It only builds with the |
alias_source read the resource behind a null handle and faulted at startup (read of address 0x30). Return None for a null handle, like host_resource does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VIctory settings are now fieldless enums implementing `Choice` (victory-core::settings): options, menu labels and victory.toml spelling in one impl. From it follow the native ◀ ▶ row in Settings → Graphics, loading at startup and saving when the player changes the value. - settings::text: const joaat, `Text::own` rejects non-`victory_` keys at compile time so our labels cannot replace the title's. - settings::choice: `Choice`, `validate()` (unique options, plain spellings, default among them). - settings::file: rewrites one `[section] key` line of victory.toml, keeping comments and layout; replaces the file in one rename. - menu_trace::native_list: the only unsafe part. Turns a pooled title row into a list row with an empty descriptor and a copy of the quality list's function table (refresh, enabled, publish, commit are ours). Commit saves the pick and posts the title's "settings changed" event so the counter follows. The UI context passed to publish lives on the caller's stack and is never kept. - menu_trace::settings_list / upscaling: the settings as rows, the Upscaling section built from them. - The hidden Graphics tab is named: a tab shows its screen ID's text. - The menu text scan reads through read_memory, so a region the title decommits mid-scan is skipped instead of faulting. Behind VICTORY_MENU_GRAPHICS and VICTORY_MENU_UPSCALING_PROBE. How to add or tweak a setting: docs/native-settings.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review: - Saving parses the edited victory.toml and refuses unless only the one key changed (inline tables and dotted keys are refused, not mangled); unique temp file, removed if the replace fails. - A pick is saved before it becomes the choice: a failed save keeps the old choice and can be retried. - The config path is made absolute at load (the title can change the working directory). - Native list rows check that the commit-side table is the primary table's slot 10 and that what they read lies in the image; unaligned reads. - A row is adopted only if the helper appended exactly one, non-null row. - One registry of list settings for loading and for the section's rows. - Docs: the `victory_` prefix is a naming rule, not collision-proof; upscaling.rs also touches title memory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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. |
The Graphics text census swept every loaded text map on the menu thread the first time Settings built the tab. It now only runs with VICTORY_MENU_TEXT_CENSUS=1. Map discovery and the census log their duration so the Settings open delay can be attributed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A search that ran before the Settings text map was loaded swept all mapped memory on the menu thread (~4.5 s). Each search now stops after 400 ms, checked before every chunk; the next menu visit searches again. A hit takes ~0.25 s and is cached for later visits. Also adds an opt-in probe (VICTORY_MENU_TEXT_PATH_PROBE) that looks for a pointer to the map in the title image, to replace the search later. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Settings text map is loaded from a file when Settings opens. The DirectStorage module now keeps the last 512 plain reads (no texture unpacking, up to 16 MiB each), and the menu looks for the map in those buffers, newest first, with the same shape checks as before: 29 us in game instead of ~0.25 s for the memory search. No address or offset is assumed. A miss usually means the file is not loaded yet, so the next menu visit looks again; only three misses in a row fall back to the time-boxed memory search. Each read can also be logged (dstorage_dest=debug). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The DirectStorage reader can now watch for one 4-byte word: every plain read that lands is checked for it on the reading thread, and the spots are kept (only hits, so loads never push them out). The menu watches for the text map's type hash and then only validates those spots, in microseconds, on its own thread. The menu thread no longer searches memory at all. After repeated misses (a build that keeps the map elsewhere), one read-only search runs on a background thread and leaves its result for a later visit. The image pointer probe found nothing and is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The title's own Graphics rows show blank: this build does not load their text. Each row names itself by joaat(key) and its help by joaat(key + "_desc"). settings::stock_labels holds VIctory's English for five rows whose keys are confirmed by their hashes (tested against the rows' IDs), one table per language. The menu text provider adds them with VIctory's own labels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rows are matched by their name and help IDs instead of label keys, so all 69 stock rows that carry a name ID get VIctory's English (the other eight have none to attach text to). Five recovered keys still check the ID scheme in the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[graphics] frame_generation (off / amd_fsr) is read from victory.toml and shown as a second native list row through the same Choice impl as the upscaler, saved when changed. It is a setting only for now: this branch does not insert generated frames yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Eight stock Graphics rows carry no name ID, so no text can be found for them. The row hook now recognises each by the labelled row before it (the nth nameless row after a given name ID, not a position) and gives it VIctory's IDs and English as the title builds it. Also logs every settings group's heading ID once, found through the owner's group array that holds VIctory's own group, to give the stock headings text next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Some stock Graphics groups are built with heading ID 0, so they show no title. After the stock rows are built, each such group in the owner's group array (the one holding VIctory's group) gets VIctory's heading, recognised by a row it holds. Five named rows without a help ID get VIctory's help the same way the nameless rows get their names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Update: now at
|
| 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.
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
cf6ab2b7/f40ffdf8fdfc1ed38b10d9bd70ae1381🧩 How the settings module works
A VIctory setting is one Rust enum plus one
Choiceimpl. Everything else (the menu row, its range, readingvictory.toml, saving it) comes from that impl.1. The value (
crates/victory-core/src/config.rs): a plain enum, spelled invictory.tomlby serde.2. The setting (
crates/victory-core/src/settings/graphics.rs): where it is saved, what the menu says, and its options.3. The row (
apps/victory/src/menu_trace/settings_list.rs): one line makes it a menu row.What the trait gives for free:
OPTIONS.len()from_configOpt::toml+CONFIGfile::saverewrites just[graphics] frame_generation = '…', keeping the user's comments and orderNAME/HELP/Opt::labelChecks that stop mistakes at test time:
Text::ownrefuses any key that doesn't start withvictory_, 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: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 byVICTORY_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=1andVICTORY_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_DIRat 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.