WIP feat(graphics): Reset to defaults at the top of the Graphics tab #1467

Open
Victor wants to merge 2 commits from Victor/Longshot:feat/graphics-reset-defaults into main
Contributor

Type: feat · Risk: low · Tested on: Linux, NVIDIA (RTX 3050 Ti Laptop, 4 GB), in the game; Windows, built (llvm-mingw cross build) · Needs: Windows, any GPU, in the game

Why

A player who changed the Graphics settings and now has a game that runs badly or looks wrong has no quick way back:
they have to find and undo each row by hand, or delete longshot_options.ini and lose every other setting too. The
defaults a new install picks are almost always the right setup, so the Graphics tab gets a button at the top that puts
them back. See #1117; the reporter agreed on the place, the top of the tab.

What changed

Reset to defaults is the Graphics tab's first row. Pressed twice (as Restart and Quit), it puts the Graphics rows
back as a new install starts on this PC: Auto (this PC) chooses the Quality preset's rows for this card again, the
Output resolution goes back to a new install's, and the other rows to their defaults. The rows that set up this PC's
screen and card stay as the player set them (Fullscreen, Fullscreen monitor, HDR and its levels, GPU device), and the
other tabs are not touched.

  • menu: graphics_reset() and reset_keeps() in gpu/vk/vk_menu.cpp. "Default" is a first start's, not Options{}
    alone: Options{} would give a small card the full-size picture (a GTX 1050 lost the device that way, Discord
    2026-11-10). The same switches as a first start apply: RX_VK_LOW_SPEC is Minimum, lighter;
    RX_VK_AUTO_PRESET=0 keeps the built-in values. Every row it sets is the player's from then on (env_release), as
    a preset's; the rows that take a restart ask at the next close (restart_state.note).
  • menu: new_install_output(), the Output resolution a new install starts at, now shared by menu_init and the reset.
    The reset applies it through Custom output size's own output_field_apply(), which keeps the Aspect ratio's shapes
    and the restart slots in step.
  • menu: the row is pressed twice through the same pending path as Restart and Quit (confirms_row), with the same
    prompts in the full menu and the compact bar; its cell reads Apply, "Press again to confirm", then Done until the menu
    closes. tab_selected starts the Graphics tab on the Quality preset, so the menu does not open on the reset.
  • translations: the row's help in all 13 languages (gpu/vk/menu_i18n.h); its label and cell texts were already there.
  • docs: the README's option table and paragraph, the guide's Graphics section, and the guide image recaptured
    (docs/images/guide/, with source-review-graphics-reset.md).
  • tests: tests/test_graphics_reset.py (new); test_menu_sections, test_readme_menu_rows and test_output_resolution
    follow the new first row and the shared function.

Measurements

Nothing to measure: a menu action, nothing runs per frame, and nothing at all until the row is pressed twice.

Flags and settings

One menu row added; no switch, ini key or build flag added. The reset reads three switches that already exist, as a first start reads them, without changing them.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
Graphics → Reset to defaults Menu action Not there First row of the Graphics tab Puts the Graphics rows back as a new install's on this PC, but Fullscreen, Fullscreen monitor, HDR and GPU device Helps (Linux, in the game) Shipped for everyone
RX_VK_AUTO_PRESET Existing: 0 makes a first start keep the built-in values Read at a first start Also read by the reset With 0, the reset gives the built-in values, Custom, as a first start Untested in the game Unchanged: for testing
RX_VK_LOW_SPEC Existing: a first start on Minimum, lighter Read at a first start Also read by the reset With it on, the reset gives Minimum, lighter, as a first start Untested in the game Unchanged: for 4 GB cards
HOS_HANDHELD Existing: the handheld profile from the environment Read at boot and by a first start's Output resolution Also read by the reset With it on, the reset leaves the Output resolution at the game's own, as a first start Untested in the game Unchanged

Testing

Tested: Linux, game-free: python -I -B tests/run_all.py gives 601 passed, 36 failed, 88 skipped (this PR rebased @ 64accd2c); the failures
are the same files that fail on a clean main @ c14641a6 on this PC (no Tooling checkout beside it, missing Vulkan/SPIR-V
headers). The menu compiled and rendered with the UI-only fixture (scripts/screenshots/menu.cpp): the row at the top
with the tab opening on the Quality preset, and the row after its first press.

Tested in the game: Linux, RTX 3050 Ti Laptop 4 GB, 1920x1080, this PR @ dbeef12a packed over main @ 544229a2
(Spanish menu). With Fullscreen on and several Graphics rows changed (Frame generation on Auto among them), Reset to
defaults pressed twice gave Auto (this PC) with its tier-1 rows (Render resolution 50%, Sharpness 0%), Output
resolution 1920x1080, Frame generation off, Fullscreen still on, Done in the cell, and the restart question on close.
longshot_options.ini afterwards: quality_preset=6, frame_generation=0, fullscreen=1. The same function run alone
(the menu built with stubs) takes Frame generation from Auto to off in one call, twice in a row.

UI-only fixture, this PR @ dbeef12a, English, 1280x720: the Graphics tab as it opens

Graphics tab with Reset to defaults above the Quality preset

UI-only fixture, this PR @ dbeef12a: Reset to defaults selected after its first press

Reset to defaults asking to press again to confirm

Built for Windows: longshot_vk.dll cross-built on Linux from this PR @ 64accd2c with llvm-mingw 20261104 (ucrt), RX_TARGET=windows nx2/build.py --standalone: 0 failed, no warnings, mkwvk_init exported, the new row and its help in the DLL.

Not tested: running on Windows; a GPU with HDR (the HDR rows kept).

Must be tested:

  • Windows, any GPU, in the game: change several Graphics rows (Quality preset to Custom, Upscaler, Render resolution,
    Output resolution, Frame generation, Anisotropic filtering), and turn Fullscreen on. Press Reset to defaults once:
    expecting "Press again to confirm" and nothing changed. Press it again: expecting the Quality preset on Auto (this PC)
    with its rows, the Output resolution a new install's, the other rows at their defaults, Fullscreen still on, Done in
    the row's cell, and on closing the menu the restart question if a restart row changed. Restart: the settings are
    kept (by hand)
  • Windows, a GPU with HDR, in the game: turn HDR on, change its paper white and peak brightness, choose a GPU device, then press Reset to defaults twice, expecting the HDR rows and GPU device to keep their values while the other rows go back (by hand)

Risks

What could break: only the Graphics tab's first row and what it sets: a row reset to a wrong value, or the restart
question asked or not asked wrongly. Nothing runs until the row is pressed twice.

Turning it off: revert the commit.

Compatibility: Nothing changes: longshot_options.ini keeps its keys, and no cache, save or ABI is touched.

Issues

See #1117

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (the renderer, the only code changed: Linux in the game; Windows cross-built with llvm-mingw 20261104, longshot_vk.dll exports mkwvk_init)
  • Docs updated.

🤖 Generated with Claude Code

**Type:** feat · **Risk:** low · **Tested on:** Linux, NVIDIA (RTX 3050 Ti Laptop, 4 GB), in the game; Windows, built (llvm-mingw cross build) · **Needs:** Windows, any GPU, in the game ## Why A player who changed the Graphics settings and now has a game that runs badly or looks wrong has no quick way back: they have to find and undo each row by hand, or delete `longshot_options.ini` and lose every other setting too. The defaults a new install picks are almost always the right setup, so the Graphics tab gets a button at the top that puts them back. See #1117; the reporter agreed on the place, the top of the tab. ## What changed **Reset to defaults** is the Graphics tab's first row. Pressed twice (as Restart and Quit), it puts the Graphics rows back as a new install starts on this PC: Auto (this PC) chooses the Quality preset's rows for this card again, the Output resolution goes back to a new install's, and the other rows to their defaults. The rows that set up this PC's screen and card stay as the player set them (Fullscreen, Fullscreen monitor, HDR and its levels, GPU device), and the other tabs are not touched. - menu: `graphics_reset()` and `reset_keeps()` in `gpu/vk/vk_menu.cpp`. "Default" is a first start's, not `Options{}` alone: `Options{}` would give a small card the full-size picture (a GTX 1050 lost the device that way, Discord 2026-11-10). The same switches as a first start apply: `RX_VK_LOW_SPEC` is Minimum, lighter; `RX_VK_AUTO_PRESET=0` keeps the built-in values. Every row it sets is the player's from then on (`env_release`), as a preset's; the rows that take a restart ask at the next close (`restart_state.note`). - menu: `new_install_output()`, the Output resolution a new install starts at, now shared by `menu_init` and the reset. The reset applies it through Custom output size's own `output_field_apply()`, which keeps the Aspect ratio's shapes and the restart slots in step. - menu: the row is pressed twice through the same `pending` path as Restart and Quit (`confirms_row`), with the same prompts in the full menu and the compact bar; its cell reads Apply, "Press again to confirm", then Done until the menu closes. `tab_selected` starts the Graphics tab on the Quality preset, so the menu does not open on the reset. - translations: the row's help in all 13 languages (`gpu/vk/menu_i18n.h`); its label and cell texts were already there. - docs: the README's option table and paragraph, the guide's Graphics section, and the guide image recaptured (`docs/images/guide/`, with `source-review-graphics-reset.md`). - tests: `tests/test_graphics_reset.py` (new); `test_menu_sections`, `test_readme_menu_rows` and `test_output_resolution` follow the new first row and the shared function. ## Measurements Nothing to measure: a menu action, nothing runs per frame, and nothing at all until the row is pressed twice. ### Flags and settings One menu row added; no switch, ini key or build flag added. The reset reads three switches that already exist, as a first start reads them, without changing them. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | Graphics → Reset to defaults | Menu action | Not there | First row of the Graphics tab | Puts the Graphics rows back as a new install's on this PC, but Fullscreen, Fullscreen monitor, HDR and GPU device | Helps (Linux, in the game) | Shipped for everyone | | `RX_VK_AUTO_PRESET` | Existing: 0 makes a first start keep the built-in values | Read at a first start | Also read by the reset | With 0, the reset gives the built-in values, Custom, as a first start | Untested in the game | Unchanged: for testing | | `RX_VK_LOW_SPEC` | Existing: a first start on Minimum, lighter | Read at a first start | Also read by the reset | With it on, the reset gives Minimum, lighter, as a first start | Untested in the game | Unchanged: for 4 GB cards | | `HOS_HANDHELD` | Existing: the handheld profile from the environment | Read at boot and by a first start's Output resolution | Also read by the reset | With it on, the reset leaves the Output resolution at the game's own, as a first start | Untested in the game | Unchanged | ## Testing **Tested:** Linux, game-free: `python -I -B tests/run_all.py` gives 601 passed, 36 failed, 88 skipped (this PR rebased @ 64accd2c); the failures are the same files that fail on a clean `main` @ c14641a6 on this PC (no Tooling checkout beside it, missing Vulkan/SPIR-V headers). The menu compiled and rendered with the UI-only fixture (`scripts/screenshots/menu.cpp`): the row at the top with the tab opening on the Quality preset, and the row after its first press. **Tested in the game:** Linux, RTX 3050 Ti Laptop 4 GB, 1920x1080, this PR @ dbeef12a packed over `main` @ 544229a2 (Spanish menu). With Fullscreen on and several Graphics rows changed (Frame generation on Auto among them), Reset to defaults pressed twice gave Auto (this PC) with its tier-1 rows (Render resolution 50%, Sharpness 0%), Output resolution 1920x1080, Frame generation off, Fullscreen still on, Done in the cell, and the restart question on close. `longshot_options.ini` afterwards: `quality_preset=6`, `frame_generation=0`, `fullscreen=1`. The same function run alone (the menu built with stubs) takes Frame generation from Auto to off in one call, twice in a row. UI-only fixture, this PR @ dbeef12a, English, 1280x720: the Graphics tab as it opens ![Graphics tab with Reset to defaults above the Quality preset](https://git.magicbean.dev/attachments/a3892115-a19c-4fdc-9f31-4354fc9b4261) UI-only fixture, this PR @ dbeef12a: Reset to defaults selected after its first press ![Reset to defaults asking to press again to confirm](https://git.magicbean.dev/attachments/d1723bc3-e01a-4775-94c4-d2313b405531) **Built for Windows:** `longshot_vk.dll` cross-built on Linux from this PR @ 64accd2c with llvm-mingw 20261104 (ucrt), `RX_TARGET=windows nx2/build.py --standalone`: 0 failed, no warnings, `mkwvk_init` exported, the new row and its help in the DLL. **Not tested:** running on Windows; a GPU with HDR (the HDR rows kept). **Must be tested:** - Windows, any GPU, in the game: change several Graphics rows (Quality preset to Custom, Upscaler, Render resolution, Output resolution, Frame generation, Anisotropic filtering), and turn Fullscreen on. Press Reset to defaults once: expecting "Press again to confirm" and nothing changed. Press it again: expecting the Quality preset on Auto (this PC) with its rows, the Output resolution a new install's, the other rows at their defaults, Fullscreen still on, Done in the row's cell, and on closing the menu the restart question if a restart row changed. Restart: the settings are kept (by hand) - Windows, a GPU with HDR, in the game: turn HDR on, change its paper white and peak brightness, choose a GPU device, then press Reset to defaults twice, expecting the HDR rows and GPU device to keep their values while the other rows go back (by hand) ## Risks **What could break:** only the Graphics tab's first row and what it sets: a row reset to a wrong value, or the restart question asked or not asked wrongly. Nothing runs until the row is pressed twice. **Turning it off:** revert the commit. **Compatibility:** Nothing changes: `longshot_options.ini` keeps its keys, and no cache, save or ABI is touched. ## Issues See #1117 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (the renderer, the only code changed: Linux in the game; Windows cross-built with llvm-mingw 20261104, longshot_vk.dll exports mkwvk_init) - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Puts the Graphics rows back as a new install starts on this PC: the rows to
their defaults, the Output resolution a new install's (new_install_output,
shared with menu_init), then the Quality preset as a first start chooses it,
Auto (this PC) and its profile. The rows that set up this PC's screen and card
stay as the player set them: Fullscreen, Fullscreen monitor, HDR and GPU device.
Pressed twice, as Restart and Quit; the tab still opens on the Quality preset.
The other tabs are left alone. The help is translated in all 13 languages.

See #1117

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(guide): the Graphics image with Reset to defaults, and how to use it
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 4s
64accd2ca5
Recaptures settings-graphics.png from 49cca71f with the maintained menu
fixture: the first view gains the Reset to defaults row, the rest is
unchanged. The manifest records the new capture and review, and
source-review-graphics-reset.md the comparison. The guide says what the row
puts back and what it keeps.

See #1117

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Tested in game: Linux, NVIDIA RTX 3050 Ti Laptop 4 GB, 1920x1080, this PR packed over main 544229a2 (dev_packs): Graphics tab, Reset to defaults pressed twice after changing several rows with Fullscreen on: Auto (this PC) with its tier-1 rows (Render resolution 50%, Sharpness 0%), Output resolution 1920x1080, Frame generation off, Fullscreen kept, Done in the cell, the restart question on close; longshot_options.ini afterwards quality_preset=6, frame_generation=0, fullscreen=1.

Tested in game: Linux, NVIDIA RTX 3050 Ti Laptop 4 GB, 1920x1080, this PR packed over main 544229a2 (dev_packs): Graphics tab, Reset to defaults pressed twice after changing several rows with Fullscreen on: Auto (this PC) with its tier-1 rows (Render resolution 50%, Sharpness 0%), Output resolution 1920x1080, Frame generation off, Fullscreen kept, Done in the cell, the restart question on close; longshot_options.ini afterwards quality_preset=6, frame_generation=0, fullscreen=1.
Author
Contributor

Screenshots for the description: UI-only menu fixture (no game), English, 1280x720.

Graphics tab with Reset to defaults above the Quality preset

Reset to defaults asking to press again to confirm

Screenshots for the description: UI-only menu fixture (no game), English, 1280x720. ![Graphics tab with Reset to defaults above the Quality preset](https://git.magicbean.dev/attachments/a3892115-a19c-4fdc-9f31-4354fc9b4261) ![Reset to defaults asking to press again to confirm](https://git.magicbean.dev/attachments/d1723bc3-e01a-4775-94c4-d2313b405531)
Author
Contributor

Built for Windows: longshot_vk.dll cross-built on Linux from 64accd2c with llvm-mingw 20261104 (ucrt), RX_TARGET=windows nx2/build.py --standalone: 0 failed, no warnings, mkwvk_init exported. Not run on Windows yet (no Windows PC here); the two by-hand tests under Must be tested still stand.

Built for Windows: longshot_vk.dll cross-built on Linux from 64accd2c with llvm-mingw 20261104 (ucrt), RX_TARGET=windows nx2/build.py --standalone: 0 failed, no warnings, mkwvk_init exported. Not run on Windows yet (no Windows PC here); the two by-hand tests under Must be tested still stand.
Victor changed title from WIP: feat(graphics): Reset to defaults at the top of the Graphics tab to feat(graphics): Reset to defaults at the top of the Graphics tab 2026-11-17 20:25:48 +00:00
HumanBean left a comment

Verdict: Request changes. The reset is a real gain and the code is careful, but it also changes two rows on other tabs (Frame pacing and Game speed) while the README, the guide and the description promise "the other tabs are not touched". The description also fails the current template's check, and the Windows run, where the Aspect ratio takes a different path, is still missing.

For a player, this adds a way back from a Graphics setup that runs badly or looks wrong without deleting longshot_options.ini: two presses put the tab back as a new install starts on this PC (Auto (this PC) for the card, a new install's Output resolution), and Fullscreen, the monitor, HDR and the GPU device stay. It makes the code better on net. It reuses the first start's own steps (new_install_output() is now shared with menu_init, the Output resolution goes through output_field_apply()), and it adds nothing per frame. The one regression is the cross-tab change below.

Reviewed: 64accd2c against fork point c14641a6 (main@origin 26354a62 is 6 commits ahead, none of them in the menu files or the tests this PR touches). Read in full: gpu/vk/vk_menu.cpp's changes and the code they rely on (apply_preset, apply_auto, menu_init, menu_auto_for_gpu, set_row, output_field_apply, aspect_monitor_value / aspect_follows_host / aspect_of_choice, env_release / saved_value, restart_values / restart_state, the menu_tick press and mouse paths, draw_options, draw_tune_bar, row_value_cell), Options in vk_menu.h, the four test files, the README and guide text. Skimmed: the 13 new menu_i18n.h entries (each is a real translation, sorted in place, counts bumped) and the guide image's manifest (its reviewed_source hashes match every listed file at the head, and the revision hash matches its pairs). Nothing run: this is a code review.
Fixed in this review: nothing.
Checked and fine:

  • It takes two presses. The first only sets pending, the second calls graphics_reset(), and graphics_reset() has no other caller. Moving off the row, Esc/B or a right click cancels the first press. The full menu and the compact bar both say "Confirm". The menu first opens on the Quality preset (tab_selected = {1}, and TAB_GRAPHICS is 0). A controller gets there only by Up from the Quality preset, or by wrapping Down from GPU device, and the cell then reads "Press again to confirm". That is the same guard as Restart and Quit.
  • Adding a row at the top shifts no fixed index. kRestartRow, kQuitRow and kBugReportRow count back from the table's end. The new row has no value, so it takes no restart slot. No other test pins a Graphics row by index: test_framegen_preset, test_auto_settings and test_menu_save_atomic find the Quality preset row by its text, which is unchanged.
  • Only rows that live in opts are reset (the pointer-range check), and reset_keeps covers every HDR row, Fullscreen, the GPU device and monitor_pick.
  • The defaults are a first start's, not Options{} alone. The preset goes to 0 and then to Auto through apply_auto(), which sets the upscaler for the card, the tier's rows and budget. RX_VK_LOW_SPEC and RX_VK_AUTO_PRESET=0 behave as at a first start, and with no card known yet it falls back to Custom.
  • Output resolution and Aspect ratio. Where the monitor's shape is known (Windows), the -1 from aspect_monitor_value() is the "follows the host" value that aspect_follows_host reads. output_field_apply then puts ultrawide back to a real place, keeps r.hi and the restart slots in step, and clears the player's custom size.
  • What changes in play is picked up. V-Sync and Frame generation are polled by the replay (vsync_was), so the swapchain is made again with no extra call. HDR and Fullscreen are kept, so there is no HDR swap and no mode change. samplers_changed() and temporal_reset_failure() cover Anisotropic filtering and the Upscaler. Rows that need a restart are noted before save() and asked about when the menu closes.
  • longshot_options.ini keeps its keys. Rows the environment held are released, as a preset's are, so the reset's values are the ones saved.
  • The translations cover the help in all 13 languages. "Reset to defaults", "Apply", "Done", "Press again to confirm" and "Confirm" were already there.

Blocking (to change before merge)

  1. gpu/vk/vk_menu.cpp:3150 (and the RX_VK_LOW_SPEC branch above it): apply_auto() → apply_preset(tier) also sets opts.pace (Debug → Frame pacing) and opts.realtime (Gameplay → Game speed), and calls env_release on both. Example: a player who chose Game speed: Per frame, or turned Frame pacing off, presses Reset to defaults. Both come back on and are saved, yet the README (line 438), the guide (docs/graphics-and-controls.md:45) and the description say the other tabs are left as they are. test_only_the_graphics_rows_change only greps graphics_reset's text for TAB_ names, so it can't see this. Fix: keep opts.pace and opts.realtime (and their env holds) across the reset, which I'd prefer for a "Graphics" reset. Or say in the help, README, guide and description that the preset sets those two, as choosing Auto on the Quality preset row does.
  2. The description fails the template on current main (CI "PR description / Description follows the template" fails). Since #1454, Everyone has two more boxes: "Tested on my own PC where it runs…" and "Nothing gets worse that I know of…". "Rebased on current main" is ticked, but the branch is 6 commits behind (no conflicts). Fix: rebase, add and tick the two boxes once they hold, and add the cost from point 1 to Risks if it stays.

Suggestions (the author may take or leave)

  • Game frame rate cap and V-Sync go back to 60 and Auto. A player who capped at 144 on a 144 Hz screen, or turned V-Sync off for VRR, will feel that as much as losing Fullscreen. Those two may belong with what reset_keeps keeps ("this PC's screen"). That is a judgement call; a new install does give 60 and Auto.
  • tests/test_graphics_reset.py checks the text of the fix, not what it does, and has its own brace counter. AGENTS.md asks new checks to cut with tests/srccut.py. A check that compiles graphics_reset with stubs, as the menu's other checks do, and compares every Options field outside the Graphics rows before and after would have caught point 1.
  • vk_menu.cpp:2036: only the menu's first opening is on the Quality preset. After a visit to Reset to defaults, the selection stays there for the next opening. That is harmless with two presses, but the comment says more than holds.

Testing: Victor ran it in the game on Linux with an RTX 3050 Ti 4 GB and posted the ini afterwards. Windows was cross-built with llvm-mingw but not run. The CI's other jobs are still blocked, waiting on required conditions, so nothing beyond the description check has run on the head. Missing: the PR's two Must be tested Windows runs, by hand. They hold the merge. On Windows the menu knows the monitor's shape (Linux doesn't), so the reset's Aspect ratio goes through the aspect_monitor_value() == -1 path that the Linux run never took.
Overlaps and merge order: #1466 retains the same guide image (settings-graphics.png in docs/images/guide/manifest.json), so whichever merges second redoes its fingerprints and review note. #1388 changes what Custom with no preset behind it (budget 0) does, and that is what this reset leaves under RX_VK_AUTO_PRESET=0. Neither has to go first.

**Verdict: Request changes.** The reset is a real gain and the code is careful, but it also changes two rows on other tabs (Frame pacing and Game speed) while the README, the guide and the description promise "the other tabs are not touched". The description also fails the current template's check, and the Windows run, where the Aspect ratio takes a different path, is still missing. For a player, this adds a way back from a Graphics setup that runs badly or looks wrong without deleting `longshot_options.ini`: two presses put the tab back as a new install starts on this PC (Auto (this PC) for the card, a new install's Output resolution), and Fullscreen, the monitor, HDR and the GPU device stay. It makes the code better on net. It reuses the first start's own steps (`new_install_output()` is now shared with `menu_init`, the Output resolution goes through `output_field_apply()`), and it adds nothing per frame. The one regression is the cross-tab change below. **Reviewed:** 64accd2c against fork point c14641a6 (main@origin 26354a62 is 6 commits ahead, none of them in the menu files or the tests this PR touches). Read in full: `gpu/vk/vk_menu.cpp`'s changes and the code they rely on (`apply_preset`, `apply_auto`, `menu_init`, `menu_auto_for_gpu`, `set_row`, `output_field_apply`, `aspect_monitor_value` / `aspect_follows_host` / `aspect_of_choice`, `env_release` / `saved_value`, `restart_values` / `restart_state`, the `menu_tick` press and mouse paths, `draw_options`, `draw_tune_bar`, `row_value_cell`), `Options` in `vk_menu.h`, the four test files, the README and guide text. Skimmed: the 13 new `menu_i18n.h` entries (each is a real translation, sorted in place, counts bumped) and the guide image's manifest (its `reviewed_source` hashes match every listed file at the head, and the revision hash matches its pairs). Nothing run: this is a code review. **Fixed in this review:** nothing. **Checked and fine:** - It takes two presses. The first only sets `pending`, the second calls `graphics_reset()`, and `graphics_reset()` has no other caller. Moving off the row, Esc/B or a right click cancels the first press. The full menu and the compact bar both say "Confirm". The menu first opens on the Quality preset (`tab_selected = {1}`, and `TAB_GRAPHICS` is 0). A controller gets there only by Up from the Quality preset, or by wrapping Down from GPU device, and the cell then reads "Press again to confirm". That is the same guard as Restart and Quit. - Adding a row at the top shifts no fixed index. `kRestartRow`, `kQuitRow` and `kBugReportRow` count back from the table's end. The new row has no value, so it takes no restart slot. No other test pins a Graphics row by index: `test_framegen_preset`, `test_auto_settings` and `test_menu_save_atomic` find the Quality preset row by its text, which is unchanged. - Only rows that live in `opts` are reset (the pointer-range check), and `reset_keeps` covers every HDR row, Fullscreen, the GPU device and `monitor_pick`. - The defaults are a first start's, not `Options{}` alone. The preset goes to 0 and then to Auto through `apply_auto()`, which sets the upscaler for the card, the tier's rows and `budget`. `RX_VK_LOW_SPEC` and `RX_VK_AUTO_PRESET=0` behave as at a first start, and with no card known yet it falls back to Custom. - Output resolution and Aspect ratio. Where the monitor's shape is known (Windows), the `-1` from `aspect_monitor_value()` is the "follows the host" value that `aspect_follows_host` reads. `output_field_apply` then puts `ultrawide` back to a real place, keeps `r.hi` and the restart slots in step, and clears the player's custom size. - What changes in play is picked up. V-Sync and Frame generation are polled by the replay (`vsync_was`), so the swapchain is made again with no extra call. HDR and Fullscreen are kept, so there is no HDR swap and no mode change. `samplers_changed()` and `temporal_reset_failure()` cover Anisotropic filtering and the Upscaler. Rows that need a restart are noted before `save()` and asked about when the menu closes. - `longshot_options.ini` keeps its keys. Rows the environment held are released, as a preset's are, so the reset's values are the ones saved. - The translations cover the help in all 13 languages. "Reset to defaults", "Apply", "Done", "Press again to confirm" and "Confirm" were already there. **Blocking** (to change before merge) 1. `gpu/vk/vk_menu.cpp:3150` (and the `RX_VK_LOW_SPEC` branch above it): `apply_auto()` → `apply_preset(tier)` also sets `opts.pace` (Debug → Frame pacing) and `opts.realtime` (Gameplay → Game speed), and calls `env_release` on both. Example: a player who chose Game speed: Per frame, or turned Frame pacing off, presses Reset to defaults. Both come back on and are saved, yet the README (line 438), the guide (`docs/graphics-and-controls.md:45`) and the description say the other tabs are left as they are. `test_only_the_graphics_rows_change` only greps `graphics_reset`'s text for `TAB_` names, so it can't see this. Fix: keep `opts.pace` and `opts.realtime` (and their env holds) across the reset, which I'd prefer for a "Graphics" reset. Or say in the help, README, guide and description that the preset sets those two, as choosing Auto on the Quality preset row does. 2. The description fails the template on current `main` (CI "PR description / Description follows the template" fails). Since https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1454, *Everyone* has two more boxes: "Tested on my own PC where it runs…" and "Nothing gets worse that I know of…". "Rebased on current `main`" is ticked, but the branch is 6 commits behind (no conflicts). Fix: rebase, add and tick the two boxes once they hold, and add the cost from point 1 to Risks if it stays. **Suggestions** (the author may take or leave) - Game frame rate cap and V-Sync go back to 60 and Auto. A player who capped at 144 on a 144 Hz screen, or turned V-Sync off for VRR, will feel that as much as losing Fullscreen. Those two may belong with what `reset_keeps` keeps ("this PC's screen"). That is a judgement call; a new install does give 60 and Auto. - `tests/test_graphics_reset.py` checks the text of the fix, not what it does, and has its own brace counter. AGENTS.md asks new checks to cut with `tests/srccut.py`. A check that compiles `graphics_reset` with stubs, as the menu's other checks do, and compares every `Options` field outside the Graphics rows before and after would have caught point 1. - `vk_menu.cpp:2036`: only the menu's first opening is on the Quality preset. After a visit to Reset to defaults, the selection stays there for the next opening. That is harmless with two presses, but the comment says more than holds. **Testing:** Victor ran it in the game on Linux with an RTX 3050 Ti 4 GB and posted the ini afterwards. Windows was cross-built with llvm-mingw but not run. The CI's other jobs are still blocked, waiting on required conditions, so nothing beyond the description check has run on the head. Missing: the PR's two *Must be tested* Windows runs, by hand. They hold the merge. On Windows the menu knows the monitor's shape (Linux doesn't), so the reset's Aspect ratio goes through the `aspect_monitor_value() == -1` path that the Linux run never took. **Overlaps and merge order:** https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1466 retains the same guide image (`settings-graphics.png` in `docs/images/guide/manifest.json`), so whichever merges second redoes its fingerprints and review note. https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1388 changes what Custom with no preset behind it (`budget` 0) does, and that is what this reset leaves under `RX_VK_AUTO_PRESET=0`. Neither has to go first.
@ -435,0 +435,4 @@
**Reset to defaults**, above them all, puts the Graphics rows back as a new install starts on your PC: the Quality preset
on Auto (this PC) with the rows it chooses, the Output resolution a new install's, and the other rows at the defaults
below. What sets up your screen and card stays as you set it: Fullscreen, Fullscreen monitor, the HDR rows and GPU
device. Press Enter or A twice; rows that apply after a restart ask for one when the menu closes. The other tabs are left
Owner

"The other tabs are left as they are": not quite, since the Auto preset also sets Frame pacing and Game speed. See the comment on vk_menu.cpp:3150.

"The other tabs are left as they are": not quite, since the Auto preset also sets Frame pacing and Game speed. See the comment on `vk_menu.cpp:3150`.
@ -42,0 +42,4 @@
To go back to that start, choose **Graphics → Reset to defaults**, the tab's first row, and press <kbd>Enter</kbd> or A
twice. It puts the Graphics rows back as a new install starts on your PC: **Auto (this PC)** chooses again, the Output
resolution goes back to a new install's, and the other rows to their defaults. **Fullscreen**, **Fullscreen monitor**,
the **HDR** rows and **GPU device** stay as you set them, and the other tabs are not touched.
Owner

Same as the README: Frame pacing (Debug) and Game speed (Gameplay) are set by the preset the reset applies.

Same as the README: Frame pacing (Debug) and Game speed (Gameplay) are set by the preset the reset applies.
@ -2018,1 +2034,3 @@
int tab_selected[TAB_FPS_DEV + 1] = {}; // (and the pages' a row opens: Motion, the FPS counter's details)
// (and the pages' a row opens: Motion, the FPS counter's details). The Graphics tab opens on the Quality preset, its second
// row, not on Reset to defaults above it
int tab_selected[TAB_FPS_DEV + 1] = {1};
Owner

Nit: this holds for the menu's first opening only. After a visit to Reset to defaults, the next opening starts on it. That is harmless with two presses, but the comment says more than holds.

Nit: this holds for the menu's first opening only. After a visit to Reset to defaults, the next opening starts on it. That is harmless with two presses, but the comment says more than holds.
@ -3099,0 +3147,4 @@
apply_preset(1);
opts.upscale = 0, opts.sharpness = 0;
} else if (env_int("RX_VK_AUTO_PRESET", 1) && auto_choice.tier >= 1) {
apply_auto();
Owner

Blocking: apply_auto() -> apply_preset(tier) also sets and env_releases opts.pace (Debug → Frame pacing) and opts.realtime (Gameplay → Game speed). A player on Game speed: Per frame, or with Frame pacing off, gets both turned back on. The README and the guide say the other tabs are left as they are. Keep those two across the reset, or say that it changes them. (The RX_VK_LOW_SPEC branch's apply_preset(1) does the same.)

Blocking: `apply_auto()` -> `apply_preset(tier)` also sets and `env_release`s `opts.pace` (Debug → Frame pacing) and `opts.realtime` (Gameplay → Game speed). A player on Game speed: Per frame, or with Frame pacing off, gets both turned back on. The README and the guide say the other tabs are left as they are. Keep those two across the reset, or say that it changes them. (The `RX_VK_LOW_SPEC` branch's `apply_preset(1)` does the same.)
@ -0,0 +19,4 @@
I18N = (ROOT / "gpu" / "vk" / "menu_i18n.h").read_text(encoding="utf-8")
def function(marker):
Owner

Nit: AGENTS.md asks new checks to cut with tests/srccut.py (block, between) rather than their own brace counter. Also, these checks read the fix's text; a stubbed compile of graphics_reset that compares the non-Graphics Options fields before and after would have caught the Frame pacing / Game speed change.

Nit: AGENTS.md asks new checks to cut with `tests/srccut.py` (`block`, `between`) rather than their own brace counter. Also, these checks read the fix's text; a stubbed compile of `graphics_reset` that compares the non-Graphics `Options` fields before and after would have caught the Frame pacing / Game speed change.
mooki left a comment

Request changes. The reset is careful, it does what #1117 asks, and it reuses the first start's own steps. Three things need to change before it can merge, all small: (1) it also resets Frame pacing and Game speed, which are on other tabs, while the README, the guide, the help text and the description say the other tabs are untouched (I agree with the earlier review, and I confirmed it by running the code); (2) it breaks the website's Settings page build and 13 website tests that pass on main; (3) since #1466 landed the branch no longer merges cleanly (guide manifest), and the description needs the current template's boxes and the new TL;DR and Breakdown.

What it does for players

A player who changed Graphics rows and now has a game that runs badly or looks wrong gets one row at the top of the Graphics tab, pressed twice, that puts the tab back as a new install starts on this PC: the Quality preset on Auto (this PC) with the rows it picks for the card, the Output resolution a new install's, the rest at their defaults. Fullscreen, Fullscreen monitor, the HDR rows and GPU device stay. The tab still opens on the Quality preset, not on the new row.

Exactly what the reset touches

I read graphics_reset() and reset_keeps() (gpu/vk/vk_menu.cpp:3130-3174) against the Graphics rows (vk_menu.cpp:1499-1601), then ran graphics_reset() on a state changed on every tab (game-free, see "What I ran"). Graphics rows, in the tab's order:

Row After the reset
Quality preset Auto (this PC). With RX_VK_AUTO_PRESET=0: Custom on the built-in values. With RX_VK_LOW_SPEC: Custom on Minimum's values, lighter
Aspect ratio the monitor's shape (restart row)
Output resolution a new install's: 2560x1440, or the screen's own size where that has fewer pixels (1920x1080, 1280x800, 2560x1080 in my runs); the game's own with HOS_HANDHELD (restart row)
Custom output size emptied (it holds the size only when a new install's size is not one of the offered ones)
Profile Docked (restart row)
Upscaler what Auto chose for this card (the game's own with Auto off)
DLSS model the first one (K)
Render resolution, Sharpness, Window scaling filter the Auto tier's values (in my 8 GB run: 100%, 30%, Catmull-Rom; plain scale and 0% at Minimum)
Frame generation, Frame generation by Off, DLSS FG
Game frame rate cap 60
NVIDIA Reflex, AMD Anti-Lag 2 Off
V-Sync Auto
CRT filter, CRT lines Off, 240
Ultrawide menus, HUD layout middle 16:9 with blurred sides, corners at the screen's edges
Anisotropic filtering 16x
Shadow resolution Auto
Fullscreen, Fullscreen monitor kept
HDR, HDR paper white, HDR peak brightness, HDR contrast, HDR tone mapper kept
GPU device kept

Not rows, but also changed and saved: memory_budget (the Auto tier, so Minimum's texture trimming follows it), auto_for, and the measured tuning (auto_tuned and auto_steps are cleared at vk_menu.cpp:1103-1104, so Auto measures again in play and may move Render resolution; that is what a first start does too). The Debug tab's "Set up for a weak laptop" cell goes back to "Apply" (vk_menu.cpp:3152).

Outside the Graphics tab, also changed (the finding below): Game speed (Gameplay) and Frame pacing (Debug). Rows I changed on the other tabs for the run and found untouched: Volume, FPS counter, Field of view, Mouse sensitivity (Audio, Gameplay, Controls) and Threaded rendering, Intel shader compiles (Debug).

Problems

1. Blocking: it also resets Frame pacing (Debug) and Game speed (Gameplay). Agreed with review 1686, and checked by running it. graphics_reset() calls apply_auto() (vk_menu.cpp:3150) or, with RX_VK_LOW_SPEC, apply_preset(1) (:3147). apply_auto() calls apply_preset(c.tier) (:1099), and every tier from 1 to 5 sets opts.pace = 1 and opts.realtime = 1 and calls env_release() on both (:1060, :1066-:1082). Those are the rows "Frame pacing" (:1793, Debug tab, "for testing, not a player's choice") and "Game speed" (:1655, Gameplay tab). On a state with Frame pacing Off and Game speed on Per frame, the reset gave:

[Gameplay] Game speed    0 -> 1
[Debug   ] Frame pacing  0 -> 1

and save() writes both. A player who chose Per frame (slower frames, slower game, on purpose) loses it silently; the README (README.md:438), the guide (docs/graphics-and-controls.md:45), the code comment (vk_menu.cpp:3127) and the description all say the other tabs are left as they are. With RX_VK_AUTO_PRESET=0 the two rows do not move, so only the Auto and Low spec paths do it.

A second effect of the same cause: when a test run holds those rows through RX_VK_PACE or HOS_REALTIME_STEP, env_release() makes save() write the run's value over the player's own. In my probe the player's saved Frame pacing and Game speed were 0 and 0, the environment forced 1 and 1 for the run, and after the reset save() would write 1 and 1.

What a correct scope looks like: keep those two across the reset, and keep their environment holds, in graphics_reset() only. This is the smaller fix: the README, guide, help text and all 13 translations stay true as written (the other way out, saying in the help that the preset sets them, changes the help in 13 languages and their counts). Patch, on top of the head:

@@ void graphics_reset() {
     opts.budget = defaults.budget;   // (the preset the settings came from: none, until the preset below sets it)
+    // (a preset also sets Frame pacing (Debug) and Game speed (Gameplay), which are not Graphics rows: as the player has them,
+    // and the environment's hold on them where it has one)
+    const int pace = opts.pace, realtime = opts.realtime;
+    EnvOverride env_was[sizeof env_overrides / sizeof env_overrides[0]];
+    std::copy(std::begin(env_overrides), std::end(env_overrides), env_was);
     if (env_on("RX_VK_LOW_SPEC")) {   // (as menu_init's first start)
         apply_preset(1);
         opts.upscale = 0, opts.sharpness = 0;
     } else if (env_int("RX_VK_AUTO_PRESET", 1) && auto_choice.tier >= 1) {
         apply_auto();
     }
+    opts.pace = pace, opts.realtime = realtime;
+    for (int i = 0; i < env_override_count; i++)   // (env_release only empties a place: the same one holds the row again)
+        if (env_was[i].value == &opts.pace || env_was[i].value == &opts.realtime) env_overrides[i] = env_was[i];
     laptop_applied = false;   // (Set up for a weak laptop's rows are gone)

menu_setting_set already snapshots env_overrides the same way (vk_menu.cpp:5849-5851). I built the probe with this patch: Game speed and Frame pacing no longer move, every Graphics row moves exactly as before, and the saved values in the environment case are the player's (0 and 0, the hold kept). The patch adds no warning under -Wall -Wextra, and tests/test_graphics_reset.py, test_menu_env_overrides.py and test_preset_exempt.py still pass with it.

2. Blocking: the website's Settings page build stops, and 13 website tests fail that pass on main. docs/graphics-and-controls.md is turned into the Settings page by formatGraphicsSettings (website/src/repo-docs/pages.ts:68), which reads README's menu table and vk_menu.cpp's row table and stops on any drift. With this head readGraphicsSettings throws Incomplete README graphics setting, because the new README line (README.md:443) has an empty Default cell. With the cell filled in it throws the next check, README/menu graphics coverage mismatch at Reset to defaults, because a Graphics row with no value is only accepted for the registered text field and the monitor selector (website/src/repo-docs/graphics-settings.ts:148); ACTIONS covers Restart and Quit on other tabs only. tests/test_readme_menu_rows.py was changed to allow the empty cell, but the website reader was not. The source-review note says the website build was not checked.

Website tests (node --test tests/*.test.ts in website/, all 106): main 104 pass, 2 fail ("HDR Native condition accepts current prose but remains required" and "cards take the menu's help, the source restart flag and README conditions", both already failing on main); this head 91 pass, 15 fail (those two and 13 new ones: the Graphics settings tests, plus "guide tables retain headers and are keyboard reachable without JavaScript" and "canonical guide images resolve to this site, with descriptive alt text"). With the patch below: 104 pass, the same 2 fail as main.

website.yml builds on every push to main that changes docs/** and every hour (schedule), and runs npm run build and npm run check; I did not run the full Astro build, but the reader is on its path (pages.ts:68) and it throws. This PR does not show it, because the website job is blocked for a fork PR until a maintainer adds the preview label. Fix, four lines in website/src/repo-docs/graphics-settings.ts, leaving README as it is:

 const ACTIONS = new Set(['Restart', 'Quit']);   // (rows that do a thing, with no choice to list)
+const GRAPHICS_ACTIONS = new Set(['Reset to defaults']);   // (a Graphics row that does a thing: README gives it no default)
@@
-    if (!name || !choices || !defaultValue) throw new Error('Incomplete README graphics setting');
+    if (!name || !choices || (!defaultValue && !GRAPHICS_ACTIONS.has(name))) throw new Error('Incomplete README graphics setting');
@@
-    if (!row.value.startsWith('&opts.') && !row.textField && !row.monitorSelector) throw new Error(`README/menu graphics coverage mismatch at ${row.name}`);
+    if (!row.value.startsWith('&opts.') && !row.textField && !row.monitorSelector && !GRAPHICS_ACTIONS.has(row.name)) throw new Error(`README/menu graphics coverage mismatch at ${row.name}`);
@@ in formatGraphicsSettings
-<p class="graphics-default"><span>Default</span> ${await inline(setting.defaultValue)}</p>
+<p class="graphics-default"><span>Default</span> ${await inline(setting.defaultValue || '\u2014')}</p>

('\u2014' is the dash the other tabs already show for a row with no default.) The card for the new row lands in the "Quality preset" group, ahead of the Quality preset card; that is fine, but a maintainer may want it in a group of its own. This makes the PR touch website/, so the preview needs a maintainer's preview label for a fork PR; that would give a real build of the page.

3. Blocking: the branch no longer merges cleanly. It did until #1466 merged (21:18 UTC). Now git merge-tree against main (93bc8a7fb, and again against 92c5fca28) has one conflict, docs/images/guide/manifest.json: #1466 re-reviewed the same settings-graphics.png entry (its reviewed_source revision and hashes changed, and its file list grew from 67 to 77 by ten headers that device_policy.h brings in). Everything else merges. Resolution: take main's reviewed_source list, re-hash gpu/vk/vk_menu.cpp and gpu/vk/menu_i18n.h for the rebased head, recompute the revision (SHA-256 of the sorted path=hash lines with final newlines), and re-run the capture helper on the rebased head so captured_source and the new note (docs/images/guide/source-review-graphics-reset.md:4 and docs/images/guide/README.md:13 still say "based on main 544229a2") are true. I did the hash part by hand on a scratch merge: scripts/check_guide_screenshots.py --review-sources passes on it (ASSET OK: settings-graphics.png). I did not re-run the capture helper.

4. Blocking (process): the description. The current checker (main 93bc8a7fb, run on the live body) gives two errors: the two Everyone boxes added by #1454 are missing ("Tested on my own PC where it runs..." and "Nothing gets worse that I know of..."), and two warnings that came with #1470: no ## TL;DR and no ## Breakdown after the status line. "Rebased on current main" is ticked but is not true any more. "Nothing gets worse" can only be ticked once problem 1 is fixed, and the description's "the other tabs are not touched" must stay true. "Tested" should say the website was checked once problem 2 is fixed. The CI context "PR description / Description follows the template" is red on this head for the first reason; every other context is "Blocked by required conditions" or skipped, so no other check has run.

5. Suggestion: tests/test_graphics_reset.py reads the text of the fix, it does not run it (agreed with the inline comment on line 22). It passes on this head with problem 1 present. The check that would have caught it compiles the menu with the stubs of scripts/screenshots/menu.cpp (the guide-screenshot job already compiles that unit), sets a value on every tab, calls graphics_reset(), and compares every Options field outside the Graphics rows before and after. My probe is that, about 150 lines, and takes about 10 seconds to build here.

6. Nit: laptop_applied = false (vk_menu.cpp:3152). The comment says Set up for a weak laptop's rows are gone. That action also sets Intel shader compiles to one at a time and Intel quick compute builds on (Debug tab), and the reset leaves those; only its cell goes back to "Apply". Integrated GPUs only. Either leave the flag alone or say what stays.

Saved file

graphics_reset() ends with restart_state.note() then save() (vk_menu.cpp:3164-3169), the same order as set_row. Nothing new in longshot_options.ini: the same keys, options_version=6. After a reset on the Auto path the file has quality_preset=6, memory_budget=<the Auto tier>, auto_for=<this PC>, output_res=<WxH>, ultrawide=1 (follows the monitor), the reset values for every Graphics row, and the kept rows as they were; auto_tuned and auto_steps lines are dropped. Lines the menu does not own (controls, toggle_, unknown keys) are kept by save(). The author's pasted lines (quality_preset=6, frame_generation=0, fullscreen=1) match what I get. With RX_VK_AUTO_PRESET=0 the file gets quality_preset=0 and memory_budget=0; an old auto_for stays, which is harmless under Custom. Rows the environment held are released, as a preset does, so the reset's values are what is saved (the exception is problem 1). I did not read the file back after a restart.

Restart-needed rows

Graphics rows that take a restart: Aspect ratio, Output resolution (with Custom output size), Profile, and GPU device (kept). The reset changes them, then notes the new values before save(), and the question is asked when the menu closes, only for rows that differ from what the run started with, and again even after a "Later" if a value moved (menu_restart.h note). I checked the Aspect ratio and Output path game-free with the menu's screen size faked to four screens, starting the run as a new install, changing to a custom 3840x2160 and 16:9, then resetting:

Screen Output resolution after Aspect ratio after Graphics rows still pending a restart
1920x1080 1920x1080 16:9 (monitor's) none
3440x1440 2560x1440 21:9 (monitor's) none
1280x800 1280x800 16:10 (monitor's) none
2560x1080 2560x1080 21:9 (monitor's) none

Each matches what a new install gives on that screen. The two Debug rows I had changed (Threaded rendering, Intel shader compiles) stayed pending, which again shows the other tabs are left alone. When the run started on the player's own values (the usual case: they are in the ini) a reset that changes them asks to restart at close; the author saw that on Linux. This path (monitor's shape known, aspect_monitor_value() == -1) is also taken on Linux whenever the host reports the screen's size, which the author's 1920x1080 result shows it did, so the earlier review's remark that the Linux run never took it is probably not right; the Windows-only parts that this does not cover are the window's monitor (window_monitor) and the list of display modes, so the Windows run is still needed.

HDR

reset_keeps (vk_menu.cpp:3130-3133) keeps HDR, paper white, peak brightness, contrast and tone mapper, and neither apply_preset nor apply_auto sets any of them (I read both), so they stay; the probe shows them unchanged (hdr=1 white=300 peak=800 contrast=120 tonemap=1 before and after). The reset does change several rows in one frame that the present loop watches (V-Sync, Frame generation, Reflex); present_image checks them in one condition and makes the swapchain once (vk_replay.cpp:5559-5585), and hdr_was equals opts.hdr, so the HDR format is asked for again, not dropped. I cannot judge that on this PC: no HDR display, no Windows. For the HDR run, please also have Frame generation on (and Native HDR) before pressing the reset, and look for a flash to SDR or a lost device after it.

Questions

  1. HDR: should the reset keep the HDR mode (Off, Expanded, Native) as well as the levels? A new install has it Off, and a picture that looks wrong because HDR is on a display that is not set up for it cannot be fixed with this button. Keeping the calibrated levels but putting the mode to Off would cover that; it is a judgement call, not a blocker.
  2. Game frame rate cap and V-Sync go back to 60 and Auto (earlier review: they may belong with "this PC's screen"). I would leave them reset: the button is for a game that runs badly, and a new install gives those values. If you want them kept, add &opts.fps_cap and &opts.vsync to reset_keeps, and the help sentence and its 13 translations change.
  3. reset_keeps is a list of pointers, so every Graphics row added later is reset unless its author remembers to add it. Open PRs that add Graphics rows: #1393 and #1394 (12 PsychoV35 HDR look rows, with their own "reset all"), #139 (Colour filter, an accessibility setting), #774 (HUD mode), #1382 (Grass distance), #656 (Don't wait for the GPU), #727 and #1151 (ray tracing). Is "reset unless kept" what you want, and should a check list every Graphics row as one or the other?

Overlaps and merge order

I took the 91 other open PRs that touch the files this one changes, and ran git merge-tree of each against main and against main plus this PR (the resolved merge), and read the hunks of the new conflicts.

  • #1466 (guide image retention): merged, causes problem 3.
  • #1388 (Custom with no preset behind it trims large textures): merged since the earlier review, no text conflict. What it changes is what the reset leaves under RX_VK_AUTO_PRESET=0 (Custom, budget 0): that now trims the large textures where Auto would pick Minimum, which is also what a first start with Auto off gives, so I see nothing to change here. #1442 (frame generation's fixed multipliers) also merged and edits vk_menu.cpp and menu_i18n.h: no conflict, but the guide manifest hashes must be taken after it.
  • #142 (a Window choice for the Aspect ratio): conflicts in the README table (the Aspect ratio line right under the new row) and in tests/test_output_resolution.py (a comment line and the saved-aspect fixture); vk_menu.cpp merges. By reading, it moves aspect_monitor_value() to -2 and gives Window -1; the reset sets opts.ultrawide = aspect_monitor_value() and output_field_apply() follows the host's shape, so a player on Window ends on the monitor's shape, a new install's value. Not run.
  • #134 (Mods tab): conflicts in menu_tick, in the press block this PR changes (it re-indents it). Textual only; whichever lands second re-indents.
  • Seven PRs edit the same exemption tuple in tests/test_readme_menu_rows.py that this one extends (#204, #280, #392, #613, #616, #1393, #1394): a one-line conflict for each.
  • Several PRs add translations and conflict on the sorted tables and the per-language counts in menu_i18n.h (#619, #620, #822, #1092, #1318, #1349): any two such PRs conflict there.
  • My own drafts #61 (restart in place) and #68 (co-op) also conflict. #61 rewrites the same confirm block in menu_tick and the Restart row's cell in row_value_cell; its scripted-run rule (own = mine || scripted) will need to apply to the reset's second press too, which I will do on my side. #68 conflicts at the tab_selected declaration and re-captures the same guide picture and manifest entry, so it redoes its fingerprints after this lands. No overlap with my launcher work on saves: this PR touches no launcher file and no save.
  • Merge order: this PR needs the rebase, the two fixes and the description first; none of the others has to wait for it.

What I ran

Game-free only; no game run and no GPU (the card is reserved for my own PRs by day), no Windows.

  • Read the whole thread and the executable diff first; fetched the head; read the code the diff relies on (apply_preset, apply_auto, menu_init, menu_auto_for_gpu, set_row, output_field_apply, the aspect_* helpers, save, env_release/saved_value, menu_restart.h, present_image, menu_tick, draw_options, draw_tune_bar, row_value_cell).
  • The new test on main's source: 10 errors (the row is not there); on the head: 10 tests pass.
  • A probe (about 150 lines, kept locally) that compiles the menu with the stubs of scripts/screenshots/menu.cpp, sets a value on every tab, calls graphics_reset() and prints every Options field and row that moved. Run on the head: plain Auto path, Auto off, Low spec, a held environment, and four faked screens; and on the head with the patch from problem 1.
  • Trial merge with main 93bc8a7fb (one conflict, resolved by hand as described), the guide-screenshot check on the PR head and on the resolved merge: both pass. The same again on main 92c5fca28 (the guide check and the focused checks test_graphics_reset, test_menu_i18n, test_menu_sections, test_readme_menu_rows, test_output_resolution, test_guide_screenshots, test_preset_exempt, test_menu_env_overrides, test_menu_restart_slots, test_menu_setting_walk): all pass.
  • Whole suite (run_all.py --jobs 6 --strict, fresh home) on main 93bc8a7fb: 675 passed, 38 failed, 17 skipped. On the trial merge (main plus this PR): 676 passed (the new test is the one more), 38 failed, 17 skipped. The 38 failing names are the same on both, so nothing new fails; they are this PC's, not this PR's. I also ran the 93 checks that read a file this PR changes, singly, on main and on the merge: the same 9 failing names with the same diagnostics (test_bug_report_defaults, test_crt_options, test_damage_debug_menu, test_framegen_preset, test_hud_layout_row, test_rumble_menu, test_upscaler_round_trip, test_upscaler_rows, test_walk_key).
  • Website: the settings reader on main, head and head plus patch, and node --test tests/*.test.ts in website/ on the three (numbers in problem 2). Not the full Astro build and not scripts/check-site.ts.
  • The description checker on the live body, with main's checker. The statuses of the head.
  • Windows-target syntax check: gpu/vk/vk_menu.cpp compiled for x86_64-w64-mingw32 against llvm-mingw's headers (-fsyntax-only -Wall -Wextra): the head has 0 errors and the same 4 warnings as main; with my patch also 0 errors and the same 4. The fixture check for the C++ fixture this PR touches (tests/test_output_resolution.py) fails on this head and on main alike, on host/hos_wide_size.h:55 (getenv deprecated under -Werror), before it reaches this PR's lines, so that driver's later variants are not judged. A syntax pass is not a Windows run.

Not run, and what would settle it

  • Any game run. Tonight, Linux NVIDIA: set Game speed to Per frame and Frame pacing Off (Debug), change a few Graphics rows, press the reset twice; after the fix, expect both to stay and the two lines in longshot_options.ini to be unchanged (on this head they flip). Also Frame generation on, then reset: expect Frame generation Off with no lost device.
  • The two by-hand Windows runs in the description (Windows, any GPU; Windows with HDR). The HDR one should have Frame generation on and Native HDR before the press, and look for a flash to SDR (see HDR above). Windows execution of the changed C++ fixture (tests/test_output_resolution.py) is not covered by a syntax check.
  • The full website build and the website preview.
  • The picture itself after a rebase (the capture helper was not re-run).

Inline-comment candidates

  • gpu/vk/vk_menu.cpp:3146: apply_preset(1) here and apply_auto() at :3150 set Frame pacing (Debug) and Game speed (Gameplay) and release their environment holds (:1060, :1066-1082). I ran it: Game speed Per frame and Frame pacing Off both come back On and are saved. Keep them across the reset; patch in my review.
  • gpu/vk/vk_menu.cpp:3152: this also puts the Debug cell back to Apply while Intel shader compiles and Intel quick compute builds, which that action set, stay. Leave it alone or say what stays.
  • gpu/vk/vk_menu.cpp:3127: "the other tabs" is only true once Frame pacing and Game speed are kept.
  • README.md:438 and docs/graphics-and-controls.md:45: same, true after the fix.
  • README.md:443: the website's Settings page reads this table; with this empty Default and no entry for the row in website/src/repo-docs/graphics-settings.ts its build stops (see my review).
  • tests/test_graphics_reset.py:70: agreed with the earlier comment; this check passes with the Frame pacing and Game speed change present. A probe that compiles the menu with the screenshot fixture's stubs and compares the other tabs' Options fields would catch it.
  • docs/images/guide/manifest.json:900: after #1466 this entry conflicts with main; take main's list and re-hash.
  • docs/images/guide/source-review-graphics-reset.md:4: "based on main 544229a2" and the dependency list need the rebase's values.
**Request changes.** The reset is careful, it does what #1117 asks, and it reuses the first start's own steps. Three things need to change before it can merge, all small: (1) it also resets Frame pacing and Game speed, which are on other tabs, while the README, the guide, the help text and the description say the other tabs are untouched (I agree with the earlier review, and I confirmed it by running the code); (2) it breaks the website's Settings page build and 13 website tests that pass on main; (3) since #1466 landed the branch no longer merges cleanly (guide manifest), and the description needs the current template's boxes and the new TL;DR and Breakdown. ## What it does for players A player who changed Graphics rows and now has a game that runs badly or looks wrong gets one row at the top of the Graphics tab, pressed twice, that puts the tab back as a new install starts on this PC: the Quality preset on Auto (this PC) with the rows it picks for the card, the Output resolution a new install's, the rest at their defaults. Fullscreen, Fullscreen monitor, the HDR rows and GPU device stay. The tab still opens on the Quality preset, not on the new row. ## Exactly what the reset touches I read `graphics_reset()` and `reset_keeps()` (`gpu/vk/vk_menu.cpp:3130-3174`) against the Graphics rows (`vk_menu.cpp:1499-1601`), then ran `graphics_reset()` on a state changed on every tab (game-free, see "What I ran"). Graphics rows, in the tab's order: | Row | After the reset | |---|---| | Quality preset | Auto (this PC). With `RX_VK_AUTO_PRESET=0`: Custom on the built-in values. With `RX_VK_LOW_SPEC`: Custom on Minimum's values, lighter | | Aspect ratio | the monitor's shape (restart row) | | Output resolution | a new install's: 2560x1440, or the screen's own size where that has fewer pixels (1920x1080, 1280x800, 2560x1080 in my runs); the game's own with `HOS_HANDHELD` (restart row) | | Custom output size | emptied (it holds the size only when a new install's size is not one of the offered ones) | | Profile | Docked (restart row) | | Upscaler | what Auto chose for this card (the game's own with Auto off) | | DLSS model | the first one (K) | | Render resolution, Sharpness, Window scaling filter | the Auto tier's values (in my 8 GB run: 100%, 30%, Catmull-Rom; plain scale and 0% at Minimum) | | Frame generation, Frame generation by | Off, DLSS FG | | Game frame rate cap | 60 | | NVIDIA Reflex, AMD Anti-Lag 2 | Off | | V-Sync | Auto | | CRT filter, CRT lines | Off, 240 | | Ultrawide menus, HUD layout | middle 16:9 with blurred sides, corners at the screen's edges | | Anisotropic filtering | 16x | | Shadow resolution | Auto | | Fullscreen, Fullscreen monitor | kept | | HDR, HDR paper white, HDR peak brightness, HDR contrast, HDR tone mapper | kept | | GPU device | kept | Not rows, but also changed and saved: `memory_budget` (the Auto tier, so Minimum's texture trimming follows it), `auto_for`, and the measured tuning (`auto_tuned` and `auto_steps` are cleared at `vk_menu.cpp:1103-1104`, so Auto measures again in play and may move Render resolution; that is what a first start does too). The Debug tab's "Set up for a weak laptop" cell goes back to "Apply" (`vk_menu.cpp:3152`). **Outside the Graphics tab, also changed (the finding below):** Game speed (Gameplay) and Frame pacing (Debug). Rows I changed on the other tabs for the run and found untouched: Volume, FPS counter, Field of view, Mouse sensitivity (Audio, Gameplay, Controls) and Threaded rendering, Intel shader compiles (Debug). ## Problems **1. Blocking: it also resets Frame pacing (Debug) and Game speed (Gameplay).** Agreed with review 1686, and checked by running it. `graphics_reset()` calls `apply_auto()` (`vk_menu.cpp:3150`) or, with `RX_VK_LOW_SPEC`, `apply_preset(1)` (`:3147`). `apply_auto()` calls `apply_preset(c.tier)` (`:1099`), and every tier from 1 to 5 sets `opts.pace = 1` and `opts.realtime = 1` and calls `env_release()` on both (`:1060`, `:1066`-`:1082`). Those are the rows "Frame pacing" (`:1793`, Debug tab, "for testing, not a player's choice") and "Game speed" (`:1655`, Gameplay tab). On a state with Frame pacing Off and Game speed on Per frame, the reset gave: ``` [Gameplay] Game speed 0 -> 1 [Debug ] Frame pacing 0 -> 1 ``` and `save()` writes both. A player who chose Per frame (slower frames, slower game, on purpose) loses it silently; the README (`README.md:438`), the guide (`docs/graphics-and-controls.md:45`), the code comment (`vk_menu.cpp:3127`) and the description all say the other tabs are left as they are. With `RX_VK_AUTO_PRESET=0` the two rows do not move, so only the Auto and Low spec paths do it. A second effect of the same cause: when a test run holds those rows through `RX_VK_PACE` or `HOS_REALTIME_STEP`, `env_release()` makes `save()` write the run's value over the player's own. In my probe the player's saved Frame pacing and Game speed were 0 and 0, the environment forced 1 and 1 for the run, and after the reset `save()` would write 1 and 1. What a correct scope looks like: keep those two across the reset, and keep their environment holds, in `graphics_reset()` only. This is the smaller fix: the README, guide, help text and all 13 translations stay true as written (the other way out, saying in the help that the preset sets them, changes the help in 13 languages and their counts). Patch, on top of the head: ```diff @@ void graphics_reset() { opts.budget = defaults.budget; // (the preset the settings came from: none, until the preset below sets it) + // (a preset also sets Frame pacing (Debug) and Game speed (Gameplay), which are not Graphics rows: as the player has them, + // and the environment's hold on them where it has one) + const int pace = opts.pace, realtime = opts.realtime; + EnvOverride env_was[sizeof env_overrides / sizeof env_overrides[0]]; + std::copy(std::begin(env_overrides), std::end(env_overrides), env_was); if (env_on("RX_VK_LOW_SPEC")) { // (as menu_init's first start) apply_preset(1); opts.upscale = 0, opts.sharpness = 0; } else if (env_int("RX_VK_AUTO_PRESET", 1) && auto_choice.tier >= 1) { apply_auto(); } + opts.pace = pace, opts.realtime = realtime; + for (int i = 0; i < env_override_count; i++) // (env_release only empties a place: the same one holds the row again) + if (env_was[i].value == &opts.pace || env_was[i].value == &opts.realtime) env_overrides[i] = env_was[i]; laptop_applied = false; // (Set up for a weak laptop's rows are gone) ``` `menu_setting_set` already snapshots `env_overrides` the same way (`vk_menu.cpp:5849-5851`). I built the probe with this patch: Game speed and Frame pacing no longer move, every Graphics row moves exactly as before, and the saved values in the environment case are the player's (0 and 0, the hold kept). The patch adds no warning under `-Wall -Wextra`, and `tests/test_graphics_reset.py`, `test_menu_env_overrides.py` and `test_preset_exempt.py` still pass with it. **2. Blocking: the website's Settings page build stops, and 13 website tests fail that pass on main.** `docs/graphics-and-controls.md` is turned into the Settings page by `formatGraphicsSettings` (`website/src/repo-docs/pages.ts:68`), which reads README's menu table and `vk_menu.cpp`'s row table and stops on any drift. With this head `readGraphicsSettings` throws `Incomplete README graphics setting`, because the new README line (`README.md:443`) has an empty Default cell. With the cell filled in it throws the next check, `README/menu graphics coverage mismatch at Reset to defaults`, because a Graphics row with no value is only accepted for the registered text field and the monitor selector (`website/src/repo-docs/graphics-settings.ts:148`); `ACTIONS` covers Restart and Quit on other tabs only. `tests/test_readme_menu_rows.py` was changed to allow the empty cell, but the website reader was not. The source-review note says the website build was not checked. Website tests (`node --test tests/*.test.ts` in `website/`, all 106): main 104 pass, 2 fail ("HDR Native condition accepts current prose but remains required" and "cards take the menu's help, the source restart flag and README conditions", both already failing on main); this head 91 pass, 15 fail (those two and 13 new ones: the Graphics settings tests, plus "guide tables retain headers and are keyboard reachable without JavaScript" and "canonical guide images resolve to this site, with descriptive alt text"). With the patch below: 104 pass, the same 2 fail as main. `website.yml` builds on every push to main that changes `docs/**` and every hour (`schedule`), and runs `npm run build` and `npm run check`; I did not run the full Astro build, but the reader is on its path (`pages.ts:68`) and it throws. This PR does not show it, because the website job is blocked for a fork PR until a maintainer adds the `preview` label. Fix, four lines in `website/src/repo-docs/graphics-settings.ts`, leaving README as it is: ```diff const ACTIONS = new Set(['Restart', 'Quit']); // (rows that do a thing, with no choice to list) +const GRAPHICS_ACTIONS = new Set(['Reset to defaults']); // (a Graphics row that does a thing: README gives it no default) @@ - if (!name || !choices || !defaultValue) throw new Error('Incomplete README graphics setting'); + if (!name || !choices || (!defaultValue && !GRAPHICS_ACTIONS.has(name))) throw new Error('Incomplete README graphics setting'); @@ - if (!row.value.startsWith('&opts.') && !row.textField && !row.monitorSelector) throw new Error(`README/menu graphics coverage mismatch at ${row.name}`); + if (!row.value.startsWith('&opts.') && !row.textField && !row.monitorSelector && !GRAPHICS_ACTIONS.has(row.name)) throw new Error(`README/menu graphics coverage mismatch at ${row.name}`); @@ in formatGraphicsSettings -<p class="graphics-default"><span>Default</span> ${await inline(setting.defaultValue)}</p> +<p class="graphics-default"><span>Default</span> ${await inline(setting.defaultValue || '\u2014')}</p> ``` (`'\u2014'` is the dash the other tabs already show for a row with no default.) The card for the new row lands in the "Quality preset" group, ahead of the Quality preset card; that is fine, but a maintainer may want it in a group of its own. This makes the PR touch `website/`, so the preview needs a maintainer's `preview` label for a fork PR; that would give a real build of the page. **3. Blocking: the branch no longer merges cleanly.** It did until #1466 merged (21:18 UTC). Now `git merge-tree` against main (93bc8a7fb, and again against 92c5fca28) has one conflict, `docs/images/guide/manifest.json`: #1466 re-reviewed the same `settings-graphics.png` entry (its `reviewed_source` revision and hashes changed, and its file list grew from 67 to 77 by ten headers that `device_policy.h` brings in). Everything else merges. Resolution: take main's `reviewed_source` list, re-hash `gpu/vk/vk_menu.cpp` and `gpu/vk/menu_i18n.h` for the rebased head, recompute the revision (SHA-256 of the sorted `path=hash` lines with final newlines), and re-run the capture helper on the rebased head so `captured_source` and the new note (`docs/images/guide/source-review-graphics-reset.md:4` and `docs/images/guide/README.md:13` still say "based on main 544229a2") are true. I did the hash part by hand on a scratch merge: `scripts/check_guide_screenshots.py --review-sources` passes on it (`ASSET OK: settings-graphics.png`). I did not re-run the capture helper. **4. Blocking (process): the description.** The current checker (main 93bc8a7fb, run on the live body) gives two errors: the two Everyone boxes added by #1454 are missing ("Tested on my own PC where it runs..." and "Nothing gets worse that I know of..."), and two warnings that came with #1470: no `## TL;DR` and no `## Breakdown` after the status line. "Rebased on current main" is ticked but is not true any more. "Nothing gets worse" can only be ticked once problem 1 is fixed, and the description's "the other tabs are not touched" must stay true. "Tested" should say the website was checked once problem 2 is fixed. The CI context "PR description / Description follows the template" is red on this head for the first reason; every other context is "Blocked by required conditions" or skipped, so no other check has run. **5. Suggestion: `tests/test_graphics_reset.py` reads the text of the fix, it does not run it** (agreed with the inline comment on line 22). It passes on this head with problem 1 present. The check that would have caught it compiles the menu with the stubs of `scripts/screenshots/menu.cpp` (the guide-screenshot job already compiles that unit), sets a value on every tab, calls `graphics_reset()`, and compares every `Options` field outside the Graphics rows before and after. My probe is that, about 150 lines, and takes about 10 seconds to build here. **6. Nit: `laptop_applied = false` (`vk_menu.cpp:3152`).** The comment says Set up for a weak laptop's rows are gone. That action also sets Intel shader compiles to one at a time and Intel quick compute builds on (Debug tab), and the reset leaves those; only its cell goes back to "Apply". Integrated GPUs only. Either leave the flag alone or say what stays. ## Saved file `graphics_reset()` ends with `restart_state.note()` then `save()` (`vk_menu.cpp:3164-3169`), the same order as `set_row`. Nothing new in `longshot_options.ini`: the same keys, `options_version=6`. After a reset on the Auto path the file has `quality_preset=6`, `memory_budget=<the Auto tier>`, `auto_for=<this PC>`, `output_res=<WxH>`, `ultrawide=1` (follows the monitor), the reset values for every Graphics row, and the kept rows as they were; `auto_tuned` and `auto_steps` lines are dropped. Lines the menu does not own (controls, `toggle_`, unknown keys) are kept by `save()`. The author's pasted lines (`quality_preset=6`, `frame_generation=0`, `fullscreen=1`) match what I get. With `RX_VK_AUTO_PRESET=0` the file gets `quality_preset=0` and `memory_budget=0`; an old `auto_for` stays, which is harmless under Custom. Rows the environment held are released, as a preset does, so the reset's values are what is saved (the exception is problem 1). I did not read the file back after a restart. ## Restart-needed rows Graphics rows that take a restart: Aspect ratio, Output resolution (with Custom output size), Profile, and GPU device (kept). The reset changes them, then notes the new values before `save()`, and the question is asked when the menu closes, only for rows that differ from what the run started with, and again even after a "Later" if a value moved (`menu_restart.h` `note`). I checked the Aspect ratio and Output path game-free with the menu's screen size faked to four screens, starting the run as a new install, changing to a custom 3840x2160 and 16:9, then resetting: | Screen | Output resolution after | Aspect ratio after | Graphics rows still pending a restart | |---|---|---|---| | 1920x1080 | 1920x1080 | 16:9 (monitor's) | none | | 3440x1440 | 2560x1440 | 21:9 (monitor's) | none | | 1280x800 | 1280x800 | 16:10 (monitor's) | none | | 2560x1080 | 2560x1080 | 21:9 (monitor's) | none | Each matches what a new install gives on that screen. The two Debug rows I had changed (Threaded rendering, Intel shader compiles) stayed pending, which again shows the other tabs are left alone. When the run started on the player's own values (the usual case: they are in the ini) a reset that changes them asks to restart at close; the author saw that on Linux. This path (monitor's shape known, `aspect_monitor_value() == -1`) is also taken on Linux whenever the host reports the screen's size, which the author's 1920x1080 result shows it did, so the earlier review's remark that the Linux run never took it is probably not right; the Windows-only parts that this does not cover are the window's monitor (`window_monitor`) and the list of display modes, so the Windows run is still needed. ## HDR `reset_keeps` (`vk_menu.cpp:3130-3133`) keeps HDR, paper white, peak brightness, contrast and tone mapper, and neither `apply_preset` nor `apply_auto` sets any of them (I read both), so they stay; the probe shows them unchanged (`hdr=1 white=300 peak=800 contrast=120 tonemap=1` before and after). The reset does change several rows in one frame that the present loop watches (V-Sync, Frame generation, Reflex); `present_image` checks them in one condition and makes the swapchain once (`vk_replay.cpp:5559-5585`), and `hdr_was` equals `opts.hdr`, so the HDR format is asked for again, not dropped. I cannot judge that on this PC: no HDR display, no Windows. For the HDR run, please also have Frame generation on (and Native HDR) before pressing the reset, and look for a flash to SDR or a lost device after it. ## Questions 1. HDR: should the reset keep the HDR mode (Off, Expanded, Native) as well as the levels? A new install has it Off, and a picture that looks wrong because HDR is on a display that is not set up for it cannot be fixed with this button. Keeping the calibrated levels but putting the mode to Off would cover that; it is a judgement call, not a blocker. 2. Game frame rate cap and V-Sync go back to 60 and Auto (earlier review: they may belong with "this PC's screen"). I would leave them reset: the button is for a game that runs badly, and a new install gives those values. If you want them kept, add `&opts.fps_cap` and `&opts.vsync` to `reset_keeps`, and the help sentence and its 13 translations change. 3. `reset_keeps` is a list of pointers, so every Graphics row added later is reset unless its author remembers to add it. Open PRs that add Graphics rows: #1393 and #1394 (12 PsychoV35 HDR look rows, with their own "reset all"), #139 (Colour filter, an accessibility setting), #774 (HUD mode), #1382 (Grass distance), #656 (Don't wait for the GPU), #727 and #1151 (ray tracing). Is "reset unless kept" what you want, and should a check list every Graphics row as one or the other? ## Overlaps and merge order I took the 91 other open PRs that touch the files this one changes, and ran `git merge-tree` of each against main and against main plus this PR (the resolved merge), and read the hunks of the new conflicts. - #1466 (guide image retention): merged, causes problem 3. - #1388 (Custom with no preset behind it trims large textures): merged since the earlier review, no text conflict. What it changes is what the reset leaves under `RX_VK_AUTO_PRESET=0` (Custom, `budget` 0): that now trims the large textures where Auto would pick Minimum, which is also what a first start with Auto off gives, so I see nothing to change here. #1442 (frame generation's fixed multipliers) also merged and edits `vk_menu.cpp` and `menu_i18n.h`: no conflict, but the guide manifest hashes must be taken after it. - #142 (a Window choice for the Aspect ratio): conflicts in the README table (the Aspect ratio line right under the new row) and in `tests/test_output_resolution.py` (a comment line and the saved-aspect fixture); `vk_menu.cpp` merges. By reading, it moves `aspect_monitor_value()` to -2 and gives Window -1; the reset sets `opts.ultrawide = aspect_monitor_value()` and `output_field_apply()` follows the host's shape, so a player on Window ends on the monitor's shape, a new install's value. Not run. - #134 (Mods tab): conflicts in `menu_tick`, in the press block this PR changes (it re-indents it). Textual only; whichever lands second re-indents. - Seven PRs edit the same exemption tuple in `tests/test_readme_menu_rows.py` that this one extends (#204, #280, #392, #613, #616, #1393, #1394): a one-line conflict for each. - Several PRs add translations and conflict on the sorted tables and the per-language counts in `menu_i18n.h` (#619, #620, #822, #1092, #1318, #1349): any two such PRs conflict there. - My own drafts #61 (restart in place) and #68 (co-op) also conflict. #61 rewrites the same confirm block in `menu_tick` and the Restart row's cell in `row_value_cell`; its scripted-run rule (`own = mine || scripted`) will need to apply to the reset's second press too, which I will do on my side. #68 conflicts at the `tab_selected` declaration and re-captures the same guide picture and manifest entry, so it redoes its fingerprints after this lands. No overlap with my launcher work on saves: this PR touches no launcher file and no save. - Merge order: this PR needs the rebase, the two fixes and the description first; none of the others has to wait for it. ## What I ran Game-free only; no game run and no GPU (the card is reserved for my own PRs by day), no Windows. - Read the whole thread and the executable diff first; fetched the head; read the code the diff relies on (`apply_preset`, `apply_auto`, `menu_init`, `menu_auto_for_gpu`, `set_row`, `output_field_apply`, the `aspect_*` helpers, `save`, `env_release`/`saved_value`, `menu_restart.h`, `present_image`, `menu_tick`, `draw_options`, `draw_tune_bar`, `row_value_cell`). - The new test on main's source: 10 errors (the row is not there); on the head: 10 tests pass. - A probe (about 150 lines, kept locally) that compiles the menu with the stubs of `scripts/screenshots/menu.cpp`, sets a value on every tab, calls `graphics_reset()` and prints every `Options` field and row that moved. Run on the head: plain Auto path, Auto off, Low spec, a held environment, and four faked screens; and on the head with the patch from problem 1. - Trial merge with main 93bc8a7fb (one conflict, resolved by hand as described), the guide-screenshot check on the PR head and on the resolved merge: both pass. The same again on main 92c5fca28 (the guide check and the focused checks `test_graphics_reset`, `test_menu_i18n`, `test_menu_sections`, `test_readme_menu_rows`, `test_output_resolution`, `test_guide_screenshots`, `test_preset_exempt`, `test_menu_env_overrides`, `test_menu_restart_slots`, `test_menu_setting_walk`): all pass. - Whole suite (`run_all.py --jobs 6 --strict`, fresh home) on main 93bc8a7fb: 675 passed, 38 failed, 17 skipped. On the trial merge (main plus this PR): 676 passed (the new test is the one more), 38 failed, 17 skipped. The 38 failing names are the same on both, so nothing new fails; they are this PC's, not this PR's. I also ran the 93 checks that read a file this PR changes, singly, on main and on the merge: the same 9 failing names with the same diagnostics (`test_bug_report_defaults`, `test_crt_options`, `test_damage_debug_menu`, `test_framegen_preset`, `test_hud_layout_row`, `test_rumble_menu`, `test_upscaler_round_trip`, `test_upscaler_rows`, `test_walk_key`). - Website: the settings reader on main, head and head plus patch, and `node --test tests/*.test.ts` in `website/` on the three (numbers in problem 2). Not the full Astro build and not `scripts/check-site.ts`. - The description checker on the live body, with main's checker. The statuses of the head. - Windows-target syntax check: `gpu/vk/vk_menu.cpp` compiled for x86_64-w64-mingw32 against llvm-mingw's headers (`-fsyntax-only -Wall -Wextra`): the head has 0 errors and the same 4 warnings as main; with my patch also 0 errors and the same 4. The fixture check for the C++ fixture this PR touches (`tests/test_output_resolution.py`) fails on this head and on main alike, on `host/hos_wide_size.h:55` (`getenv` deprecated under `-Werror`), before it reaches this PR's lines, so that driver's later variants are not judged. A syntax pass is not a Windows run. ## Not run, and what would settle it - Any game run. Tonight, Linux NVIDIA: set Game speed to Per frame and Frame pacing Off (Debug), change a few Graphics rows, press the reset twice; after the fix, expect both to stay and the two lines in `longshot_options.ini` to be unchanged (on this head they flip). Also Frame generation on, then reset: expect Frame generation Off with no lost device. - The two by-hand Windows runs in the description (Windows, any GPU; Windows with HDR). The HDR one should have Frame generation on and Native HDR before the press, and look for a flash to SDR (see HDR above). Windows execution of the changed C++ fixture (`tests/test_output_resolution.py`) is not covered by a syntax check. - The full website build and the website preview. - The picture itself after a rebase (the capture helper was not re-run). ## Inline-comment candidates - gpu/vk/vk_menu.cpp:3146: `apply_preset(1)` here and `apply_auto()` at :3150 set Frame pacing (Debug) and Game speed (Gameplay) and release their environment holds (:1060, :1066-1082). I ran it: Game speed Per frame and Frame pacing Off both come back On and are saved. Keep them across the reset; patch in my review. - gpu/vk/vk_menu.cpp:3152: this also puts the Debug cell back to Apply while Intel shader compiles and Intel quick compute builds, which that action set, stay. Leave it alone or say what stays. - gpu/vk/vk_menu.cpp:3127: "the other tabs" is only true once Frame pacing and Game speed are kept. - README.md:438 and docs/graphics-and-controls.md:45: same, true after the fix. - README.md:443: the website's Settings page reads this table; with this empty Default and no entry for the row in `website/src/repo-docs/graphics-settings.ts` its build stops (see my review). - tests/test_graphics_reset.py:70: agreed with the earlier comment; this check passes with the Frame pacing and Game speed change present. A probe that compiles the menu with the screenshot fixture's stubs and compares the other tabs' `Options` fields would catch it. - docs/images/guide/manifest.json:900: after #1466 this entry conflicts with main; take main's list and re-hash. - docs/images/guide/source-review-graphics-reset.md:4: "based on main 544229a2" and the dependency list need the rebase's values.
Victor changed title from feat(graphics): Reset to defaults at the top of the Graphics tab to WIP feat(graphics): Reset to defaults at the top of the Graphics tab 2026-11-18 05:05:53 +00:00
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 4s
This pull request has changes conflicting with the target branch.
  • docs/images/guide/manifest.json
  • gpu/vk/menu_i18n.h
  • tests/test_readme_menu_rows.py
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/graphics-reset-defaults:Victor-feat/graphics-reset-defaults'
git switch 'Victor-feat/graphics-reset-defaults'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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
MagicBeanDev/Longshot!1467
No description provided.