fix(menu): a settings row is built from the same sample of the renderer as the fact that sends it again (#3277) #3289

Merged
HumanBean merged 3 commits from cuecuemoar/Longshot:fix/caps-sample-row-3277 into main 2026-12-06 01:50:12 +00:00
Contributor

Summary

Fixes #3277. A settings row in the menu could keep showing a lock (or an upscaler's reason, a slider's ceiling, a choice) that the renderer no longer had.

The cause. Since #3208/#3223, two things in game/crates/api/src/services/settings_host.rs read the renderer's capabilities at different times:

  • the row itself (its locked text, its hint, its ceiling, which choices can be picked) asked the renderer live, each time it was built (link::capabilities());
  • the fact that decides whether to send a watched row again, Fact::CapsState, and the declarations' generation come from caps_hashes(), a sample kept for 250 ms (CAPS_EVERY_NS).

So a state that came and went inside one window could be read by the menu and never taken back. Sample 1 sees "free", the renderer locks a row, the menu reads it (live: locked), the lock goes, and sample 2 sees "free" again. CapsState never moved, the row is not dirty, and nothing sends it again. The row keeps the lock until some unrelated fact moves.

The fix. The sample now keeps the renderer's answer beside its two hashes (caps_sample() / CapsKept), and row and declaration reads in settings_host.rs use that answer (caps()). A row and the fact that resends it then come from the same answer: a change shows up to 250 ms late, never a state no sample saw. Device selections use the capabilities that supplied the last declared choices for that mod and row, so a changed device list does not turn a selection into a different device. Without a capabilities snapshot, only choices available without one can be selected. When a sample is available, it is reused for the window.

One read stays live on purpose: list_choice_texts, the control bridge's lists. The bridge rebuilds them when the renderer's own live generation moves (game/crates/longshot-game/src/menu.rs, caps_generation). Fed from a sample that can be behind, it would rebuild with the old list and keep it until the next change. A cold review caught this.

How to see it on main: nobody has reported it in the game, and the issue says as much. It needs a lock that comes and goes within a quarter of a second with no setting change. The new test shows it with the fake renderer.

Read first: caps_sample and caps in settings_host.rs, then the test a_lock_that_comes_and_goes_between_two_samples_does_not_stay_on_a_row_read_meanwhile at the end of that file.

Testing

Tested: Windows 10 22H2, RTX 4090, NVIDIA 617.42, keyboard and mouse, this PR's head 7c7bae93e on a copy of a save, Insert menu, Graphics tab, by hand. This build has no DLSS, FSR 4 or XeSS (only FSR 3.1), so the locks those give couldn't be shown here.

  • Fullscreen on and off: the Window scaling filter row locks while the window is the Output resolution's size and unlocks otherwise (the renderer's upscaling lock).
  • Frame generation off, then a mode: the Frame gen. multiplier and its related rows hide and show with the mode, following the menu's own rules. Their lock (framegen_2x) only applies under DLSS Frame Generation, which this build doesn't have.
  • Upscaler changed a few times (FSR 3.1 and the built-in ones): the rows follow it.

Game-free, in WSL (Linux), against main de091ae29:

  • New test in settings_host.rs, run with cargo test -p api --lib a_lock_that_comes_and_goes. It drives the real settings_host_step and settingsHost.rows on the fake renderer:
    1. a frame samples the renderer with Render resolution free;
    2. the renderer locks it ("DLAA") and the menu reads the row;
    3. the lock goes inside the same window, then three frames run past it;
    4. the row the menu ends up with has no lock;
    5. then a lock that stays is pushed once a sample sees it ("DLAA").
    • It fails on the test commit e4bf89821 with left: "DLAA", right: "" and passes on the tested head 7c7bae93e.
    • It fails again if the fix's caps() is changed back to a live link::capabilities() read.
    • With the fake renderer, caps_hashes normally asks again at every call, so the window never applies. A #[cfg(test)] thread-local makes the window apply on the test's own thread, by its fake clock. It doesn't change the game's code.
  • The test commit also gives texts_reads_capabilities_once_across_all_values the FAKE_RENDERER lock, as the file's other tests that set the fake renderer already have. Run beside the new test, it saw the fake renderer change between two reads (1 suite run in 6); on main alone it passed 8 of 8.
  • cargo test -p api --lib: 651 passed, 1 failed, in 5 runs of 5. The failure is settings_push::tests::a_rows_dependencies_come_from_its_data, which fails on main too (650 passed there); this change doesn't touch it.
  • cargo clippy -p api --all-targets: nothing new. The warnings in settings_host.rs are older test lines.
  • tests/run_all.py --strict: this PR 876 passed, 67 failed, 13 skipped; main the same 876/67/13. No file fails only here; the failures come from this machine's g++ 11 (no C++23) and lack of Vulkan. This ran at an earlier head; the current head also changes settings_host.rs and settings/service.rs.
  • The checks under tests/ that read settings_host.rs (test_menu_locked_button, test_menu_restart, test_menu_slider_ends, test_menu_text_field, test_microphone_test_gain): all passed at the tested head, unchanged.
  • scripts/check_host_compile.py: 83 host units, 0 failed, on both sides.
  • A cold review by a second agent of the diff and the test. Its one blocking finding, the bridge's lists, is fixed as described above.

Still to test:

  • Windows, an NVIDIA RTX 40 or 50 with DLSS: on the Graphics tab, switch Upscaler between DLSS, DLAA and others, and Frame generation between NVIDIA DLSS Frame Generation and Built-in. Expect the DLSS model, Render resolution and Frame gen. multiplier rows' locks and reasons to follow each change within a quarter of a second, with none left behind (by hand, or @Beanstalk on RTX 40)
  • A Steam Deck or AMD PC: open the Graphics tab and change Upscaler. Expect the rows to follow as on main (@Beanstalk)

Measurements

Nothing to measure: the change makes rows read an answer the game already samples, so an available answer is reused for a quarter of a second instead of asking the renderer at each read (the existing tests count those calls).

Risks

Small. A row's renderer-derived state (lock, reason, ceiling, which choices can be picked, an Output resolution value's size) now shows up to 250 ms after the renderer changes, as the fact that resends it already did. Within that window a value the renderer has just made available can be refused, or one it has just withdrawn accepted, as the menu offered it. A revert is enough. Nothing changes in saves, settings.toml or the caches.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VxeaZi9Np8FcHAzJs2LM9d

## Summary Fixes #3277. A settings row in the menu could keep showing a lock (or an upscaler's reason, a slider's ceiling, a choice) that the renderer no longer had. **The cause.** Since #3208/#3223, two things in `game/crates/api/src/services/settings_host.rs` read the renderer's capabilities at different times: - the row itself (its `locked` text, its hint, its ceiling, which choices can be picked) asked the renderer live, each time it was built (`link::capabilities()`); - the fact that decides whether to send a watched row again, `Fact::CapsState`, and the declarations' generation come from `caps_hashes()`, a sample kept for 250 ms (`CAPS_EVERY_NS`). So a state that came and went inside one window could be read by the menu and never taken back. Sample 1 sees "free", the renderer locks a row, the menu reads it (live: locked), the lock goes, and sample 2 sees "free" again. `CapsState` never moved, the row is not dirty, and nothing sends it again. The row keeps the lock until some unrelated fact moves. **The fix.** The sample now keeps the renderer's answer beside its two hashes (`caps_sample()` / `CapsKept`), and row and declaration reads in `settings_host.rs` use that answer (`caps()`). A row and the fact that resends it then come from the same answer: a change shows up to 250 ms late, never a state no sample saw. Device selections use the capabilities that supplied the last declared choices for that mod and row, so a changed device list does not turn a selection into a different device. Without a capabilities snapshot, only choices available without one can be selected. When a sample is available, it is reused for the window. One read stays live on purpose: `list_choice_texts`, the control bridge's lists. The bridge rebuilds them when the renderer's own live generation moves (`game/crates/longshot-game/src/menu.rs`, `caps_generation`). Fed from a sample that can be behind, it would rebuild with the old list and keep it until the next change. A cold review caught this. **How to see it on `main`:** nobody has reported it in the game, and the issue says as much. It needs a lock that comes and goes within a quarter of a second with no setting change. The new test shows it with the fake renderer. Read first: `caps_sample` and `caps` in `settings_host.rs`, then the test `a_lock_that_comes_and_goes_between_two_samples_does_not_stay_on_a_row_read_meanwhile` at the end of that file. ## Testing **Tested:** Windows 10 22H2, RTX 4090, NVIDIA 617.42, keyboard and mouse, this PR's head 7c7bae93e on a copy of a save, Insert menu, Graphics tab, by hand. This build has no DLSS, FSR 4 or XeSS (only FSR 3.1), so the locks those give couldn't be shown here. - **Fullscreen on and off:** the Window scaling filter row locks while the window is the Output resolution's size and unlocks otherwise (the renderer's `upscaling` lock). - **Frame generation off, then a mode:** the Frame gen. multiplier and its related rows hide and show with the mode, following the menu's own rules. Their lock (`framegen_2x`) only applies under DLSS Frame Generation, which this build doesn't have. - **Upscaler changed a few times (FSR 3.1 and the built-in ones):** the rows follow it. Game-free, in WSL (Linux), against `main` de091ae29: - **New test** in `settings_host.rs`, run with `cargo test -p api --lib a_lock_that_comes_and_goes`. It drives the real `settings_host_step` and `settingsHost.rows` on the fake renderer: 1. a frame samples the renderer with Render resolution free; 2. the renderer locks it ("DLAA") and the menu reads the row; 3. the lock goes inside the same window, then three frames run past it; 4. the row the menu ends up with has no lock; 5. then a lock that stays is pushed once a sample sees it ("DLAA"). - It fails on the test commit e4bf89821 with `left: "DLAA"`, `right: ""` and passes on the tested head 7c7bae93e. - It fails again if the fix's `caps()` is changed back to a live `link::capabilities()` read. - With the fake renderer, `caps_hashes` normally asks again at every call, so the window never applies. A `#[cfg(test)]` thread-local makes the window apply on the test's own thread, by its fake clock. It doesn't change the game's code. - **The test commit also gives `texts_reads_capabilities_once_across_all_values` the `FAKE_RENDERER` lock**, as the file's other tests that set the fake renderer already have. Run beside the new test, it saw the fake renderer change between two reads (1 suite run in 6); on `main` alone it passed 8 of 8. - **`cargo test -p api --lib`:** 651 passed, 1 failed, in 5 runs of 5. The failure is `settings_push::tests::a_rows_dependencies_come_from_its_data`, which fails on `main` too (650 passed there); this change doesn't touch it. - **`cargo clippy -p api --all-targets`:** nothing new. The warnings in `settings_host.rs` are older test lines. - **`tests/run_all.py --strict`:** this PR 876 passed, 67 failed, 13 skipped; `main` the same 876/67/13. No file fails only here; the failures come from this machine's g++ 11 (no C++23) and lack of Vulkan. This ran at an earlier head; the current head also changes `settings_host.rs` and `settings/service.rs`. - **The checks under `tests/` that read `settings_host.rs`** (`test_menu_locked_button`, `test_menu_restart`, `test_menu_slider_ends`, `test_menu_text_field`, `test_microphone_test_gain`): all passed at the tested head, unchanged. - **`scripts/check_host_compile.py`:** 83 host units, 0 failed, on both sides. - A cold review by a second agent of the diff and the test. Its one blocking finding, the bridge's lists, is fixed as described above. **Still to test:** - Windows, an NVIDIA RTX 40 or 50 with DLSS: on the Graphics tab, switch Upscaler between DLSS, DLAA and others, and Frame generation between NVIDIA DLSS Frame Generation and Built-in. Expect the DLSS model, Render resolution and Frame gen. multiplier rows' locks and reasons to follow each change within a quarter of a second, with none left behind (by hand, or @Beanstalk on RTX 40) - A Steam Deck or AMD PC: open the Graphics tab and change Upscaler. Expect the rows to follow as on `main` (@Beanstalk) ## Measurements Nothing to measure: the change makes rows read an answer the game already samples, so an available answer is reused for a quarter of a second instead of asking the renderer at each read (the existing tests count those calls). ## Risks Small. A row's renderer-derived state (lock, reason, ceiling, which choices can be picked, an Output resolution value's size) now shows up to 250 ms after the renderer changes, as the fact that resends it already did. Within that window a value the renderer has just made available can be refused, or one it has just withdrawn accepted, as the menu offered it. A revert is enough. Nothing changes in saves, `settings.toml` or the caches. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01VxeaZi9Np8FcHAzJs2LM9d
The menu reads a row's lock live from the renderer, while the fact that sends the row again is a sample kept for a
quarter of a second. The test locks Render resolution, reads the row, lets the lock go inside the same window, and
runs the frames after it: on main the row keeps "DLAA". caps_hashes keeps its window on the test's own thread when a
test asks (tests only; the fake renderer is otherwise asked at every call).

texts_reads_capabilities_once_across_all_values now takes FAKE_RENDERER like the binary's other tests that set the
stand-in renderer: run beside the new test it saw the renderer change between two reads of the same declarations
(1 suite run in 6 without the lock).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VxeaZi9Np8FcHAzJs2LM9d
fix(menu): a settings row is built from the same sample of the renderer as the fact that sends it again (#3277)
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
7c7bae93e4
The rows, their declarations and the values a set takes read the renderer's capabilities live, while the fact that
sends a watched row again (CapsState) and the declarations' generation come from a sample kept for a quarter of a
second. A lock, an upscaler's reason, a ceiling or a choice that came and went inside one window was shown on a row
read meanwhile and never taken back: both samples the same, nothing moved. The sample now keeps the renderer's answer
with its two hashes, and settings_host reads that answer: a change is seen up to 250 ms late, never a state no sample
made. One renderer call per window instead of one per read.

list_choice_texts, the control bridge's lists, still asks live: the bridge makes them again by the renderer's own
generation (longshot-game's menu.rs), which a sample can be behind.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VxeaZi9Np8FcHAzJs2LM9d
Author
Contributor

Tested in game: Windows 10 22H2, RTX 4090, NVIDIA 617.42, head 7c7bae93e, Insert menu > Graphics, by hand: Window scaling filter locks while the window is the Output resolution's size and unlocks otherwise (Fullscreen on/off); Frame generation's rows hide and show with the mode; Upscaler changes (FSR 3.1, built-in) followed by the rows. No DLSS/FSR 4/XeSS in this build, so their locks are in Still to test.

Tested in game: Windows 10 22H2, RTX 4090, NVIDIA 617.42, head 7c7bae93e, Insert menu > Graphics, by hand: Window scaling filter locks while the window is the Output resolution's size and unlocks otherwise (Fullscreen on/off); Frame generation's rows hide and show with the mode; Upscaler changes (FSR 3.1, built-in) followed by the rows. No DLSS/FSR 4/XeSS in this build, so their locks are in Still to test.
Member

Possibly related, for context:

  • issue #3229 Sharpness row occasionally disappears in place on the Graphics tab when switching Upscaler — Graphics row intermittently disappears while switching Upscaler; explicitly fixes #3277, not this report’s layout bug
Possibly related, for context: - issue #3229 Sharpness row occasionally disappears in place on the Graphics tab when switching Upscaler — Graphics row intermittently disappears while switching Upscaler; explicitly fixes #3277, not this report’s layout bug
cuecuemoar changed title from WIP: fix(menu): a settings row is built from the same sample of the renderer as the fact that sends it again (#3277) to fix(menu): a settings row is built from the same sample of the renderer as the fact that sends it again (#3277) 2026-12-05 23:15:48 +00:00
Member
@review
BeanBot left a comment

Recommendation: Request changes. A device list can change while the menu still shows the cached list, causing a selection to save a different device from the one the player chose. The lock fix is demonstrated by the reported game-free test, but the remaining in-game DLSS check and CI are still pending.

The change builds menu rows and declarations from the same cached renderer capabilities used to decide when to refresh them. This prevents a transient lock from remaining on a row, at the cost of delaying capability changes by up to 250 ms and creating a mismatch with live device selection.

Blocking (1): must change before merging.

  1. L1 game/crates/api/src/services/settings_host.rs:693: The menu now displays cached device choices, but the settings codec resolves the selected index against the live device list. (more on the line) Do: Resolve a selection against the same capabilities snapshot that supplied its displayed choices, or detect a changed live list and reject or refresh the selection before saving it. Add a test that changes the device list between display and selection.

Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)

  • L2: The renderer locks most directly involved in the fix have not yet been exercised in the game. When: The reported Windows build did not include DLSS, so it could not show that DLAA and DLSS frame-generation locks and reasons follow changes and clear correctly. Do: Run the stated Graphics-tab DLSS and DLAA switching check on an RTX 40 or 50 and record the result.

@fix can do L1.

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes: the reported fake-renderer test fails on the test commit against main with a lingering DLAA lock and passes at this head; it also fails when the live row read is restored. The reported Windows game run exercised other locks, but could not exercise DLSS.

Other systems: The sampled capabilities also supply output sizes, monitors, audio devices, GPUs, microphones, upscaler reasons and restart rules. The control bridge and settings codecs still read live capabilities; the latter can interpret a cached choice index as a different device. The reported Windows run covered fullscreen, frame-generation visibility and FSR 3.1; DLSS and Steam Deck or AMD runs remain outstanding.

Switches: None.

Reviewed: 7c7bae93e4 against de091ae295: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the applicable standards, the commit log and the settings_host.rs diff and surrounding implementation. Examined settings_push.rs, the control bridge, graphics declarations and settings codecs around their relevant paths. Skimmed existing tests and reported runs; did not read translations or generated files. docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent.; nothing run (a code review).

Checked and fine:

  • Both commits record AI assistance in trailers.
  • The diff adds no switch, generated output, game-derived file or renderer API change.
  • The new test exercises watched rows and is reported to fail when the key live read is restored.

Testing: No code or tests were run during this read-only review. The author reports the new regression test passing, the same known suite failure on both branches, and a Windows in-game run; CI is still running.

Overlaps and merge order: Not checked; network access was unavailable.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** A device list can change while the menu still shows the cached list, causing a selection to save a different device from the one the player chose. The lock fix is demonstrated by the reported game-free test, but the remaining in-game DLSS check and CI are still pending. The change builds menu rows and declarations from the same cached renderer capabilities used to decide when to refresh them. This prevents a transient lock from remaining on a row, at the cost of delaying capability changes by up to 250 ms and creating a mismatch with live device selection. **Blocking (1)**: must change before merging. 1. **L1** `game/crates/api/src/services/settings_host.rs:693`: The menu now displays cached device choices, but the settings codec resolves the selected index against the live device list. (more on the line) **Do:** Resolve a selection against the same capabilities snapshot that supplied its displayed choices, or detect a changed live list and reject or refresh the selection before saving it. Add a test that changes the device list between display and selection. **Testing before merging (1)** (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation) - **L2**: The renderer locks most directly involved in the fix have not yet been exercised in the game. *When:* The reported Windows build did not include DLSS, so it could not show that DLAA and DLSS frame-generation locks and reasons follow changes and clear correctly. **Do:** Run the stated Graphics-tab DLSS and DLAA switching check on an RTX 40 or 50 and record the result. `@fix` can do L1. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes: the reported fake-renderer test fails on the test commit against main with a lingering DLAA lock and passes at this head; it also fails when the live row read is restored. The reported Windows game run exercised other locks, but could not exercise DLSS. **Other systems:** The sampled capabilities also supply output sizes, monitors, audio devices, GPUs, microphones, upscaler reasons and restart rules. The control bridge and settings codecs still read live capabilities; the latter can interpret a cached choice index as a different device. The reported Windows run covered fullscreen, frame-generation visibility and FSR 3.1; DLSS and Steam Deck or AMD runs remain outstanding. **Switches:** None. **Reviewed:** 7c7bae93e489 against de091ae295b7: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the applicable standards, the commit log and the settings_host.rs diff and surrounding implementation. Examined settings_push.rs, the control bridge, graphics declarations and settings codecs around their relevant paths. Skimmed existing tests and reported runs; did not read translations or generated files. docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent.; nothing run (a code review). **Checked and fine:** - Both commits record AI assistance in trailers. - The diff adds no switch, generated output, game-derived file or renderer API change. - The new test exercises watched rows and is reported to fail when the key live read is restored. **Testing:** No code or tests were run during this read-only review. The author reports the new regression test passing, the same known suite failure on both branches, and a Windows in-game run; CI is still running. **Overlaps and merge order:** Not checked; network access was unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -648,3 +691,3 @@
) -> Vec<J> {
let wanted = |key: &str, page: &str| keys.iter().any(|k| k == key) || pages.iter().any(|p| p == page);
let caps = link::capabilities();
let caps = caps();
Member

L1 (blocking): The menu now displays cached device choices, but the settings codec resolves the selected index against the live device list. A list change during the cache window can therefore save a different device from the one displayed.

When: For example, the cached audio output list contains devices A and B. If A disappears and the player selects the displayed A before the sample refreshes, set_service passes its index to the settings service, whose Device codec looks that index up in the live list and saves B's ID and name.

Do: Resolve a selection against the same capabilities snapshot that supplied its displayed choices, or detect a changed live list and reject or refresh the selection before saving it. Add a test that changes the device list between display and selection.

**L1** (blocking): The menu now displays cached device choices, but the settings codec resolves the selected index against the live device list. A list change during the cache window can therefore save a different device from the one displayed. *When:* For example, the cached audio output list contains devices A and B. If A disappears and the player selects the displayed A before the sample refreshes, set_service passes its index to the settings service, whose Device codec looks that index up in the live list and saves B's ID and name. **Do:** Resolve a selection against the same capabilities snapshot that supplied its displayed choices, or detect a changed live list and reject or refresh the selection before saving it. Add a test that changes the device list between display and selection.
Owner
@fix
BeanBot force-pushed fix/caps-sample-row-3277 from 7c7bae93e4
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 40d2e466a6
Some checks are pending
PR description / Title and description (pull_request_target) Waiting to run
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Waiting to run
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Waiting to run
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
2026-12-05 23:44:50 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The fake-renderer test demonstrates the original stale-lock fix, and the reported Windows run exercises some affected rows. The DLSS lock and AMD or Steam Deck runs remain outstanding. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is 40d2e466a6. I rebased it onto main (8c0beeec5d). I edited its description to match the change.

Changed

  • Cached device choices and selections: Preserved the capabilities snapshot used for each device declaration through the queued settings edit, and added a regression test for a device disappearing between display and selection in game/crates/api/src/services/settings_host.rs:1639 and game/crates/api/src/settings/service.rs:439. The test was not run, as requested.
  • Device choices without a capabilities snapshot: Updated game/crates/api/src/services/settings_host.rs:1369 to accept built-in choices without a snapshot while requiring one for listed devices. No tests were run, as instructed.

Nothing was built or run: the checks run again on the new head.

Settings rows use the same sampled renderer capabilities as the fact that triggers updates, preventing a transient lock from remaining displayed. Device selections retain the capabilities used to declare their choices; the tradeoff is that renderer-derived changes can appear up to 250 ms later.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L2: The renderer locks most directly involved in the fix have not yet been exercised in the game. When: The reported Windows build did not include DLSS, so it could not show that DLAA and DLSS frame-generation locks and reasons follow changes and clear correctly. Do: Run the stated Graphics-tab DLSS and DLAA switching check on an RTX 40 or 50 and record the result.

Checks: they run again on this head; a failure shows on the pull request.

Also noticed (3; not asked for, not blocking)
  • The pull request description predates the device-selection follow-up and does not describe that change or its unrun test.
  • The base-to-head diff also contains content-model and collapsible-section changes outside the stated menu capability fix.
  • The device-selection regression test added by the fix has not been run.
More: does it help, other systems, switches, what was read

Does it help: Yes for the reported stale-lock case: the described fake-renderer test fails on the test commit and passes on the tested head. The subsequent device-selection fix has not been run.

Other systems: The menu paths apply across Windows and Linux and renderer vendors. The reported Windows NVIDIA run covers several rows but lacks DLSS; AMD or Steam Deck coverage remains outstanding. Device selections also affect saved device IDs and names.

Switches: None.

Reviewed: 40d2e466a6 against 8c0beeec5d: Read the repository rules and pull request template, the fix diff, and the relevant settings host and settings service paths. The full base diff and all changed files were not read in full; recorded runs were read as reported evidence. The referenced Tooling repository was unavailable.; nothing run (a code review).

Checked and fine:

  • The fix preserves the sampled capabilities through the queued device edit.
  • Built-in device choices remain selectable without a capabilities snapshot.
  • The control bridge retains its live capabilities read.

Testing: No commands that build or run code were executed. The author reports a passing stale-lock regression test and a Windows in-game run on the earlier tested head; the latest fix has not been tested.

Overlaps and merge order: none found


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The fake-renderer test demonstrates the original stale-lock fix, and the reported Windows run exercises some affected rows. The DLSS lock and AMD or Steam Deck runs remain outstanding. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 40d2e466a6f0. I rebased it onto `main` (8c0beeec5d6c). I edited its description to match the change. **Changed** - **Cached device choices and selections**: Preserved the capabilities snapshot used for each device declaration through the queued settings edit, and added a regression test for a device disappearing between display and selection in game/crates/api/src/services/settings_host.rs:1639 and game/crates/api/src/settings/service.rs:439. The test was not run, as requested. - **Device choices without a capabilities snapshot**: Updated game/crates/api/src/services/settings_host.rs:1369 to accept built-in choices without a snapshot while requiring one for listed devices. No tests were run, as instructed. Nothing was built or run: the checks run again on the new head. Settings rows use the same sampled renderer capabilities as the fact that triggers updates, preventing a transient lock from remaining displayed. Device selections retain the capabilities used to declare their choices; the tradeoff is that renderer-derived changes can appear up to 250 ms later. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2**: The renderer locks most directly involved in the fix have not yet been exercised in the game. *When:* The reported Windows build did not include DLSS, so it could not show that DLAA and DLSS frame-generation locks and reasons follow changes and clear correctly. **Do:** Run the stated Graphics-tab DLSS and DLAA switching check on an RTX 40 or 50 and record the result. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (3; not asked for, not blocking)</summary> - The pull request description predates the device-selection follow-up and does not describe that change or its unrun test. - The base-to-head diff also contains content-model and collapsible-section changes outside the stated menu capability fix. - The device-selection regression test added by the fix has not been run. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the reported stale-lock case: the described fake-renderer test fails on the test commit and passes on the tested head. The subsequent device-selection fix has not been run. **Other systems:** The menu paths apply across Windows and Linux and renderer vendors. The reported Windows NVIDIA run covers several rows but lacks DLSS; AMD or Steam Deck coverage remains outstanding. Device selections also affect saved device IDs and names. **Switches:** None. **Reviewed:** 40d2e466a6f0 against 8c0beeec5d6c: Read the repository rules and pull request template, the fix diff, and the relevant settings host and settings service paths. The full base diff and all changed files were not read in full; recorded runs were read as reported evidence. The referenced Tooling repository was unavailable.; nothing run (a code review). **Checked and fine:** - The fix preserves the sampled capabilities through the queued device edit. - Built-in device choices remain selectable without a capabilities snapshot. - The control bridge retains its live capabilities read. **Testing:** No commands that build or run code were executed. The author reports a passing stale-lock regression test and a Windows in-game run on the earlier tested head; the latest fix has not been tested. **Overlaps and merge order:** none found </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
@ -1696,1 +1771,3 @@
} else if self.set_service(key, i64::from(v)) {
} else if self.service_row(key).is_some_and(|r| {
if matches!(r.native.choices_from.as_deref(), Some("audioOutputs" | "monitors" | "microphones" | "gpus")) {
let sampled = self.settings_host.borrow().device_choices.get(&(cx.mod_id.clone(), key.to_owned())).cloned();
Member

L3 (should fix): Device rows reject even their built-in choices when no capabilities snapshot was available at declaration time.

When: If the renderer has not provided capabilities, the declaration still offers Default, Auto or Off, but device_choices has no entry and setting one of those values rejects with off_step.

Do: Allow built-in device choices without a capabilities snapshot, while continuing to require the displayed snapshot for choices that identify a listed device.

**L3** (should fix): Device rows reject even their built-in choices when no capabilities snapshot was available at declaration time. *When:* If the renderer has not provided capabilities, the declaration still offers Default, Auto or Off, but device_choices has no entry and setting one of those values rejects with off_step. **Do:** Allow built-in device choices without a capabilities snapshot, while continuing to require the displayed snapshot for choices that identify a listed device.
Member

Tested on Windows 11 Pro (26300), RTX 5080, NVIDIA 621.47, head 40d2e466a, runtime over main 8c0beeec5 with DLSS, windowed 1280x720 on a 1920x1080 360 Hz display, Insert menu > Graphics (mouse, keyboard and the control bridge's option set):

  • Upscaler DLSS -> DLAA (Render resolution 100% (DLAA)): "DLAA before the bloom" shows, unlocked; DLSS model unlocked.
  • DLAA -> AMD FSR 3.1: DLSS model and DLAA before the bloom go; Render resolution back to 67% (1280x720).
  • FSR 3.1 -> NVIDIA DLSS: DLSS model showed locked in a capture right after the pick, unlocked in the next (~0.3-0.5 s later); nothing left behind. Captures are not precise enough to confirm the 250 ms.
  • Frame generation Fixed: Built-in FG reaches 8x; DLSS FG stops at 6x (Left from 8x lands on 6x, Right stays at 6x); back to Built-in, 7x and 8x again.
  • DLSS FG with Upscaler "Game's own": Frame generation by says "Not DLSS FG now: No picture from a temporal Upscaler..."; gone again with DLSS.
  • Audio > Output device (the device-choices commit): picking a listed device saved the matching id and name; set back to Default.

Seen once, not compared with main: system/menu faulted past its 5 ms frame-listener budget (5.1 ms, settingsHost.decls 3.3 ms) when Upscaler went to Game's own with DLSS FG running, during a swapchain rebuild (one 198 ms present). The menu kept working. Same family as #3230.

Also noted, likely not from this PR and not checked on main: with 8x saved, switching to DLSS FG leaves the multiplier row at 8x ("60 x 8 = 480 FPS") while DLSS FG makes up to 6x here.

Tested on Windows 11 Pro (26300), RTX 5080, NVIDIA 621.47, head 40d2e466a, runtime over main 8c0beeec5 with DLSS, windowed 1280x720 on a 1920x1080 360 Hz display, Insert menu > Graphics (mouse, keyboard and the control bridge's option set): - Upscaler DLSS -> DLAA (Render resolution 100% (DLAA)): "DLAA before the bloom" shows, unlocked; DLSS model unlocked. - DLAA -> AMD FSR 3.1: DLSS model and DLAA before the bloom go; Render resolution back to 67% (1280x720). - FSR 3.1 -> NVIDIA DLSS: DLSS model showed locked in a capture right after the pick, unlocked in the next (~0.3-0.5 s later); nothing left behind. Captures are not precise enough to confirm the 250 ms. - Frame generation Fixed: Built-in FG reaches 8x; DLSS FG stops at 6x (Left from 8x lands on 6x, Right stays at 6x); back to Built-in, 7x and 8x again. - DLSS FG with Upscaler "Game's own": Frame generation by says "Not DLSS FG now: No picture from a temporal Upscaler..."; gone again with DLSS. - Audio > Output device (the device-choices commit): picking a listed device saved the matching id and name; set back to Default. Seen once, not compared with main: system/menu faulted past its 5 ms frame-listener budget (5.1 ms, settingsHost.decls 3.3 ms) when Upscaler went to Game's own with DLSS FG running, during a swapchain rebuild (one 198 ms present). The menu kept working. Same family as #3230. Also noted, likely not from this PR and not checked on main: with 8x saved, switching to DLSS FG leaves the multiplier row at 8x ("60 x 8 = 480 FPS") while DLSS FG makes up to 6x here.
HumanBean deleted branch fix/caps-sample-row-3277 2026-12-06 01:50:12 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 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!3289
No description provided.