fix(menu): the frame engine's ceiling moves the declarations, so Frame gen. multiplier stops where its engine allows #3275
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3275
Loading…
Reference in a new issue
No description provided.
Delete branch "omgitsgela/Longshot:fix/framegen-ceiling-declarations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Frame gen. multiplier stops at what this PC's frame engine makes. At NVIDIA DLSS Frame Generation that is what NVIDIA's
runtime makes on this GPU: 2x on an RTX 40, 6x on an RTX 50 (#1486). That stop sits in the row's declaration (its
hi), which the game keeps until the declarations' generation moves on.#3223 took the renderer's locks out of that generation on purpose: an Upscaler change locks and unlocks rows, and moving
the generation with them had the menu read and lay out every tab again over the next frames, each past the 5 ms its frame
listener may, until
system/menustopped and its rows went away (#3230,#3232). What went out with the locks was also the only thing that
moved the generation when a PC stopped making its frames with DLSS FG, because the lock on this row appears and
disappears with the engine.
dlss_fg_most()answers 0 as soon as the row no longer asks for DLSS FG (vk_dlss.cpp:fg_asked()is false),caps.cpppasses that through to the game, and nothing hashed it: the declaration kept theceiling of the engine the player left.
So on main, on an RTX 40: Frame generation Fixed, Frame generation by DLSS FG, and the multiplier stops at 2x (right).
Move Frame generation by to Built-in and restart if it asks: the row is no longer locked, and it still stops at 2x,
where built-in FG makes up to 8x. The row's own help says the stop is "With NVIDIA DLSS Frame Generation". It clears
only when something else moves the generation: a monitor unplugged, a language changed, a mod started.
This hashes
dlss_fg_mostwith the lists, next torefresh_mhz- the two numbers a declaration's values stop at(
CHOICE_TOPS:dlssFgMost,displayHzTarget), and adds a test that names it.Read first:
game/crates/api/src/services/settings_host.rscaps_hashes_of(the lists' hash and the state's),top_in/service_decl_json(where the ceiling becomes the declaration'shi), and the testthe_ceiling_the_frame_engine_reports_moves_the_declarations_on.Testing
Tested: Steam Deck LCD (SteamOS 20261023.100, kernel 7.2.7-valve2-2-neptune, RDNA3 APU: no NVIDIA runtime, so
dlss_fg_mostis 0 here and the ceiling is never set - the in-game run is a no-change-from-main check, not a test ofthe ceiling):
(
cargo test --locked -p api --lib -- --exact …the_ceiling_the_frame_engine_reports… …every_capability_list_moves…):on main
4007f6eaewith only the tests added, both FAILED:the_ceiling_the_frame_engine_reports_moves_the_declarations_onat
settings_host.rs:2225(the generations equal: the ceiling moved nothing) andevery_capability_list_moves_the_generation_onat :2175 (its new "the frame generation ceiling" case). With theone-line hash on top, both ok. The run's log:
$SD/longshot-dev/fg.logon the Deck.--libsuite at this head: 649 passed, 1 failed. That one failure isservices::settings_push::tests::a_rows_dependencies_come_from_its_data(panics atsettings_push.rs:641), and itfails on untouched main in this same Deck setup too - there the suite is 648 passed, 1 failed - so it is main's, not
this change's; the one extra pass at the head is the new test. The run's log:
$SD/longshot-dev/one.log.python3 -I -B tests/run_all.py --changed(Linux): the four checks that readsettings_host.rs-test_menu_restart.py,test_menu_slider_ends.py,test_menu_locked_button.py,byte_compile_tracked.py-4 passed, 0 failed, 1 skipped (
test_microphone_test_gain.py: no clang on this box).mise run testas a whole wasnot run by hand:
misecannot install its pinned pypi tools here (Python dependency locks require uv >= 0.12.10),so CI carries it.
cargo +1.99.1 fmt --all --check(rustfmt 1.10.0-stable, the pinned rust 1.99.1) on Linux reports diffs in eightplaces this change does not touch -
settings_host.rs:1178among them, exactly as main has it - and none in the linesthis change adds. The Deck's own toolchain has no rustfmt component, so CI's rustfmt job is the authority.
rt-fgtopover the base pack3a0f7d8f7, built with--no-prepare-shaders): the Insert menu's Frame gen. multiplier row walked from 2x to 8x and back (12 changes, thevalue 2, 3, 4, 5, 6, 7, 8 then back down to 2) and the Upscaler row 18 changes (distinct 0, 3, 9), at 1280x800
windowed in Kokiri Forest. Every change was confirmed by
option_get, and after a full fault window the row still hadthe focus and the menu answered (35.3 and 49 fps). The Upscaler arm took 0
system/menufaults and 1system/mods-tabfault with no stop; the multiplier arm 3 and 1 and
system/mods-tabwas stopped. Currentmainon the same Deck gives3 and 1 with one stop for the multiplier arm and 3 and 1 with one stop for the Upscaler arm, so this patch added
nothing there - and on this GPU
dlss_fg_mostis always 0, so the ceiling itself never appears: that is theno-change-from-main check, and the NVIDIA runs are asked for above. Runs
$SD/longshot-dev/menu-cycle-runs/fg-*, logsfg-mult.log,fg-upscaler.log; the current-mainruns beside them arecm-*(cm.log), and their numbers are on#3230 (comment).
Still to test:
reach 8x at Built-in FG and to stop at 2x again at DLSS FG (@Beanstalk play on an RTX 40 with Frame generation Fixed:
at Frame generation by DLSS FG the multiplier stops at 2x, at Built-in it reaches 8x)
(@Beanstalk, same steps on an RTX 50)
and the Upscaler row still cycles without a menu mod faulting more than on main (@Beanstalk)
Measurements
Nothing to measure. The capabilities are asked of the renderer at most every 250 ms (
CAPS_EVERY_NS), and this adds oneinteger to a hash that already walks nine lists; the declarations read again only when that ceiling moves, which is when
the player changes
Frame generation byorFrame generation, once, not per frame. What #3223 removed - locks movingthe generation on every Upscaler change - stays removed.
Risks
is one read and one layout at the moment the player changes the engine: on the Deck, one settings change that moved
the generation re-read 31 rows and the frames after it ran 3.9, 3.5, 2.8 and 2.7 ms of script CPU at
cpuScale 2.71(measured on main
7bc53f841, in #3223's description). On a PC with no NVIDIA runtime the ceiling never moves, sonothing changes there at all.
clamps what it makes (
gpu/vk/settings/framegen.cppfgr::fixed_top(dlss_fg_most())) andoptions_storeclamps thesaved value to 2..8, so nothing outside the row's own range can be set.
Checklist
Ready for review
main(4007f6eae); the title is a Conventional Commit.ceiling itself: no NVIDIA runtime - the NVIDIA runs are asked for above).
main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened: none needed changing, and the fourthat read
settings_host.rspass as they are.Assisted-by:/Co-Authored-By:trailers.Tested in game: Steam Deck LCD (SteamOS 20261023.100, kernel 7.2.7-valve2-2-neptune, RDNA3 APU), this change packed as its own runtime rt-fgtop over base pack
3a0f7d8f7: the Insert menu's Frame gen. multiplier walked 2x to 8x and back (12 changes) and the Upscaler row 18 changes, every one confirmed by option_get, the menu still focused and answering after a full fault window (35.3, 49 fps); the arms took 0 menu faults / 1 mods-tab fault and 3 / 1 with system/mods-tab stopped, which is what current main gives on the same Deck, so nothing was added. dlss_fg_most is always 0 on this GPU, so the ceiling itself cannot appear here: the NVIDIA runs are asked for in the description.@review
758a1aabb6f8a33c9d16Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The hash change and game-free test address the stale ceiling, but the corrected behavior has not been exercised with an NVIDIA frame engine. The PR is also still WIP. Recommend approval; not approved on the forge.
The menu refreshes its multiplier declaration when the frame engine’s reported ceiling changes, allowing the full built-in range after leaving DLSS Frame Generation. This adds a declaration refresh when the ceiling changes.
Nits (1): optional.
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)
game/crates/api/src/services/settings_host.rs:242: The corrected ceiling and the resulting menu refresh have not been exercised on a GPU where the ceiling changes. (more on the line) Do: Run the stated multiplier and engine-switch steps on NVIDIA hardware, including an upscaler change while DLSS FG is selected, and check that the menu remains responsive and the multiplier reaches the appropriate limits.@fixcan do L2.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven in game on the affected hardware. The author reports that both relevant game-free tests fail on base
4007f6eaeand pass with this change; the Steam Deck run cannot exercise the NVIDIA ceiling.Other systems: The hash is shared by settings-host consumers on Windows and Linux. AMD and Steam Deck report a zero DLSS ceiling; the reported Deck run found no additional menu faults against main. On NVIDIA, changing the temporal upscaler can also change the ceiling and refresh declarations; that path still needs an in-game check.
Switches: None added, changed, or removed.
Reviewed:
758a1aabb6against4007f6eae4: Read AGENTS.md, CONTRIBUTING.md, the PR template, applicable standards, the commit and diff, the changed settings-host file and the relevant declaration, renderer capability and menu-generation paths. Skimmed the reported runs and related tests. The optional review checklist and adjacent Tooling checkout were absent.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run. CI was still running in the supplied status.
Overlaps and merge order: None found in the supplied information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -232,3 +240,3 @@use std::hash::{Hash, Hasher};let mut lists = std::collections::hash_map::DefaultHasher::new();(c.n_sizes, c.n_monitors, c.n_gpus, c.n_menu_langs, c.n_game_langs, c.refresh_mhz, c.has).hash(&mut lists);(c.n_sizes, c.n_monitors, c.n_gpus, c.n_menu_langs, c.n_game_langs, c.refresh_mhz, c.dlss_fg_most, c.has)L1 (should fix): The corrected ceiling and the resulting menu refresh have not been exercised on a GPU where the ceiling changes.
When: With DLSS Frame Generation selected on an RTX 40 or 50, switching between it and Built-in, or changing the temporal upscaler, changes the reported ceiling and causes the menu to reload declarations. The Deck run always reports zero and cannot check those transitions.
Do: Run the stated multiplier and engine-switch steps on NVIDIA hardware, including an upscaler change while DLSS FG is selected, and check that the menu remains responsive and the multiplier reaches the appropriate limits.
WIP: fix(menu): the frame engine's ceiling moves the declarations, so Frame gen. multiplier stops where its engine allowsto fix(menu): the frame engine's ceiling moves the declarations, so Frame gen. multiplier stops where its engine allowsNumbers behind what landed, and what is still unverified.
450dbdaeb31b9a33e06b30278b16327d4c6c52d2: 35 insertions, 1 deletion, one file.c.dlss_fg_mostjoins the capability lists incaps_hashes_of, next torefresh_mhz, plus the two tests (the_ceiling_the_frame_engine_reports_moves_the_declarations_on, and the new case inevery_capability_list_moves_the_generation_on).pr checksreads 11 pending onf8a33c9d1), so no green board covers this yet. Closest substitute, run afterwards:cargo test --locked -p api --libon current main with this change in (Deck tree688d47e, Steam Deck LCD) is 650 passed, 1 failed, and that failure isservices::settings_push::tests::a_rows_dependencies_come_from_its_data, which fails on untouched main in the same Deck setup too (panics atsettings_push.rs:641:9; 648 passed, 1 failed there). Logsfg.log,one.log,main-check.logon the Deck.misecannot install its pinned tools on that box:python3 -I -B tests/run_all.py --stricton Linux atf8a33c9d1and atf018d9acd- 759 passed, 179 failed, 13 skipped at both, and the two failing-check name sets are identical in both directions (the box has no glslangValidator, no Vulkan device, no clang). The four checks that readsettings_host.rspass there.dlss_fg_mostis always 0 without an NVIDIA runtime: an RTX 40 (Frame generation by DLSS FG -> Built-in, restart if asked, then the multiplier should reach 8x where main leaves it at 2x) and an RTX 50 (the multiplier should still stop at 6x). Happy to run a pinned test request from anyone who has one of those on hand.system/mods-tab, notsystem/menu, and its numbers are on #3230 (comment); where the ~3 ms in onemodsHost.tabcall goes is claimed and not yet measured.The description check failed on this head (
run 61696), and both gaps are mine, in the text, not in the code:pr statusnamed them as (a)## Measurementswanting a table or a single line saying why there is nothing to measure, and (b) the Ready-for-review list missing themise run testbox. I had both written up by 12:30 MST, but the PR merged before I could push the body, andforge.pywill not edit a merged PR. So the text belongs here, in case it is worth having:CAPS_EVERY_NS), this adds one integer to a hash that already walks nine lists, and the declarations read again only when that ceiling moves, which is when the player changesFrame generation byorFrame generation, once and not per frame.rt-curmainis main with #3223 in,rt-fgtopis this change over the same base pack): Upscaler cycle, 18 changes (system/menufaults,system/mods-tabfaults, stops): 3, 1, 1 before and 0, 1, 0 after. Frame gen. multiplier 2x..8x, 12 changes, the same three: 3, 2, 1 before and 3, 1, 1 after.cargo test --locked -p api --libon the Deck: 648 passed / 1 failed before and 649 passed / 1 failed after. One run each, not interleaved, and the same arm on the same build spreads over 0 to 3 menu faults run to run, so those rows say "nothing added", not "it helps".mise run testpasses (any failure that also fails onmainis named).misecannot install its pinned tools on that Linux box (Python dependency locks require uv >= 0.12.10), so the suite was called directly:python3 -I -B tests/run_all.py --strictatf8a33c9d1and atf018d9acd- 759 passed, 179 failed, 13 skipped at both, and the two failing-check name sets are identical in both directions (no glslangValidator, no Vulkan device, no clang there). The four checks that readsettings_host.rspass. CI'smise run testis the authority.Nothing else about the merge needs action: main at
de6fb7b5dstill carries the change (c.dlss_fg_mostin the lists hash,settings_host.rs:242, and both tests). The rest of the checks were 2 passed and 8 still running when I last looked, and the two runs that can show the ceiling itself, an RTX 40 and an RTX 50, are still open in the comment above.