fix(vk): Skip Upscaler Wait, the late-page rules and Reflex Off's calls behind one Debug row, off by default #3287
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3287
Loading…
Reference in a new issue
No description provided.
Delete branch "Veix/Longshot:ui/skip-upscaler-wait-debug"
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
Skip Upscaler Wait, the two late-page rules and Reflex Off's NVIDIA calls go behind one row on the Debug tab, off by
default: with V-Sync they make the game's frames uneven in light scenes.
With V-Sync (FIFO), all four on make the game's frame times alternate where frames are short. Kokiri Forest, 4K DLSS
from 1080p, RTX 4070 SUPER: fps rises 10 %, the real presents stay even, but 37 % of the game's frames are over 1.25x the
median (0 % without) and the 1 % low falls from 75.6 to 62.8 fps. An RTX 3090 report comparing v3.2.0 with nightly 1179
on Linux shows the same pattern (+4 % fps, 1 % low -23 % in Kokiri, -15 % in Hyrule Field), likely because a compositor
holds presents to the refresh. With V-Sync off the four are better in every measure.
What changes:
restart, and is shown with every Upscaler. With Upscaler Off the skip applies too (the linear stretch stands in for
the game's network), while the row was hidden there.
skip_row_at_start()(gpu/vk/vk_replay.cpp) gives the row as the run started.late_by_part_on(),late_read_same_on()(gpu/vk/vk_memory.cpp) andoff_paced()(gpu/vk/vk_reflex.cpp) are nowtheir switch and that value; the skip itself follows the row at once, as before. The late rules judge a page at the
capture, the take and the fix's build, so they are read once for the run; the Reflex calls need the swapchain made in
latency mode.
HOS_FRAME_SKIP_TAIL,RX_VK_LATE_BY_PART,RX_VK_LATE_READ_SAMEandRX_VK_REFLEX_OFF_PACEDstay kill switches;HOS_FRAME_SKIP_TAIL=1turns the row on for a run.these functions alone get a stand-in for the row.
Read first: the
skip_upscaler_waitrow ingame/mods/graphics/mod.toml, thenskip_row_at_startingpu/vk/vk_replay.cpp.Testing
Tested: Windows 11, RTX 4070 SUPER, NVIDIA 621.24, 4K DLSS from 1080p, uncapped, standing still (numbers below):
Kokiri Forest with the four switches off against on, V-Sync off and on; and this PR's build with the row off (no
switch) against on (
HOS_FRAME_SKIP_TAIL=1) in the Market, Hyrule Field and Kokiri. Row off logsSkip Upscaler Wait (HOS_FRAME_SKIP_TAIL): off, repairs 52 pages a capture (the old late rule) and makes no Reflex call; row on logson,repairs 0.9 pages a capture and puts the swapchain in latency mode. The changed files' checks pass; the ones that fail
also fail on main
2d87a5c9a.Still to test:
lower with the row off (by hand)
Measurements
Verdict: off by default trades the four's fps gain for even game frames with V-Sync.
Setup: Windows 11, RTX 4070 SUPER, Ryzen 9 9900X; Kokiri Forest standing 30 s, 4K output, DLSS at 50 % (1080p in),
uncapped, windowed; one pair each, on one build (main
2d87a5c9aplus this branch's first commit) with the four switchesat 1 (main's behaviour) and at 0 (what this PR's default gives). 1 % low = the slowest 1 % of the game's frame times, as
fps. The row on this PR's build follows below.
2d87a5c9a(the four on)e2e09f516(the row off)The row on this PR's build, standing 40 s, the same settings, one pair each (1 % low in fps):
Risks
Players lose the four's fps gain by default (here +27 % in Kokiri with V-Sync off); the Debug row brings it back after a
restart. A player who had the row on keeps their saved value. A revert is enough.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named): the changed files' checks pass;test_settings_area_keys,test_i18n_complete,test_present_image_free,test_input_background,test_present_semaphores,test_dlssg,test_present_held_image,test_vk_draw_overhead_leanandtest_present_acquire_aheadfail onmain2d87a5c9atoo.main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
gpu/vk/switches.def.tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Written with help from Claude (Anthropic), reviewed and tested by me.
🤖 Generated with Claude Code
Tested in game: Windows 11, RTX 4070 SUPER: Kokiri at 4K DLSS from 1080p, the four off against on, V-Sync off and on; the branch's build starts with the row off
Possibly related, for context:
@review
Recommendation: Request changes. The default sacrifices substantial performance with V-Sync off, and disabling Reflex's Off-mode calls also restores a previously observed NVIDIA frame-generation stall. The reported V-Sync improvement needs repeated measurements on the actual branch and coverage of the other affected paths.
Moves Skip Upscaler Wait to Debug and uses its startup value to control two late-page optimizations and Reflex Off-mode calls. This can improve frame-time consistency with V-Sync, but couples unrelated optimizations and makes players pay their costs even when V-Sync is off.
Blocking (2): must change before merging.
game/mods/graphics/mod.toml:659: The new default disables all four optimizations even when V-Sync is off, where the reported result is substantially worse in every metric. (more on the line) Do: Keep the optimizations enabled for V-Sync-off presentation, and address the FIFO pacing problem without making those players find and restart with a Debug setting.gpu/vk/vk_reflex.cpp:98: Gating Reflex Off-mode calls on this unrelated setting restores the NVIDIA frame-generation stall that those calls were introduced to prevent. (more on the line) Do: Keep Off-mode pacing available independently when frame generation needs it, including when Skip Upscaler Wait is off.Should fix (1): not blocking, but worth doing before merging.
game/mods/graphics/mod.toml:659: The player guide and switch table still describe the previous location, default and behavior. (more on the line) Do: Update the player guide and the affected switch-table entries to describe the final location, defaults, restart behavior and dependencies.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_memory.cpp:2704: The final branch's pacing benefit and the cost of disabling the late-page rules across affected systems remain unmeasured. (more on the line) Do: Run repeated interleaved base-versus-final-head measurements with FIFO and V-Sync off, including NVIDIA on Linux and representative AMD or Intel hardware, and check frame times and 1% lows as well as average fps.@fixcan do L1, L2 and L3.Questions (1) (not confirmed from the code; they don't hold the recommendation)
tests/test_reflex_swapchain_lifetime.py:88: Is there a concrete case where a consumer fails to follow the startup row or its kill switch?Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven as a general default. The author's single Windows RTX 4070 SUPER pair reports V-Sync-on 1% lows improving from 62.8 to 75.6 fps, but V-Sync-off average falls from 104.6 to 82.5 fps and its 1% low from 88.5 to 73.9 fps. The comparison used one build with switches, not repeated runs of the base and final head.
Other systems: The late-page and frame-wait paths affect Vulkan players across GPUs and operating systems. Reflex Off-mode affects NVIDIA, including the built-in frame generator; DLSS Frame Generation uses Streamline's own Reflex. No final-head runs are reported for Linux, AMD, Intel, Steam Deck, other upscalers, or frame generation.
Switches: Skip Upscaler Wait and HOS_FRAME_SKIP_TAIL now default off, are exposed for every upscaler, and also gate RX_VK_LATE_BY_PART, RX_VK_LATE_READ_SAME and RX_VK_REFLEX_OFF_PACED at startup. Those three remain individually disableable, but their switch-table descriptions still say they default on without mentioning the new gate. The off default causes the reported V-Sync-off regression.
Reviewed:
e2e09f5167against2d87a5c9a3: Read the repository rules, PR template, diff, commit messages, changed setting and Reflex implementation, and traced the changed functions, settings snapshot and relevant callers. Skimmed the translation deletions and changed test fixtures. The large vk_memory.cpp and vk_replay.cpp files and the remaining changed files were not read in full. docs/review-checklist.md was absent.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run, as requested. The supplied CI checks are still running; the author reports a Windows game run and checks, with the stated limitations.
Overlaps and merge order: Not checked; network access is unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by Veix. Nothing was run; a maintainer decides.
@ -660,3 +659,1 @@# (every upscaler but Off, 6: with none there is no upscale to leave behind; "Game's own", 0, is one)shownIf = "dlss"shownIn = [1, 2, 3, 4, 5, 7, 8, 9, 10, 0]default = falseL1 (blocking): The new default disables all four optimizations even when V-Sync is off, where the reported result is substantially worse in every metric.
When: A player using the default with V-Sync off in the measured Kokiri scene loses 21.1% average fps and 16.5% of the 1% low compared with the four enabled.
Do: Keep the optimizations enabled for V-Sync-off presentation, and address the FIFO pacing problem without making those players find and restart with a Debug setting.
L3 (should fix): The player guide and switch table still describe the previous location, default and behavior.
When: docs/user/graphics-and-controls.md tells a player that Skip Upscaler Wait is on by default on Graphics and changes immediately; switches.def describes the three gated switches as on without the startup-row condition.
Do: Update the player guide and the affected switch-table entries to describe the final location, defaults, restart behavior and dependencies.
@ -2702,3 +2702,3 @@bool late_by_part_on() {static const bool on = env_on_or("RX_VK_LATE_BY_PART", 1);return on;return on && skip_row_at_start(); // (the Skip Upscaler Wait row as the run started: off by default)L4 (should fix): The final branch's pacing benefit and the cost of disabling the late-page rules across affected systems remain unmeasured.
When: The reported comparison is a single pair on one NVIDIA Windows system using switches on an earlier build; it does not establish the final startup-row behavior or its effect on other Vulkan paths and hardware.
Do: Run repeated interleaved base-versus-final-head measurements with FIFO and V-Sync off, including NVIDIA on Linux and representative AMD or Intel hardware, and check frame times and 1% lows as well as average fps.
@ -96,3 +96,3 @@bool off_paced() {static const bool v = env_on_or("RX_VK_REFLEX_OFF_PACED", 1);return v;return v && skip_row_at_start(); // (the Skip Upscaler Wait row as the run started: off by default)L2 (blocking): Gating Reflex Off-mode calls on this unrelated setting restores the NVIDIA frame-generation stall that those calls were introduced to prevent.
When: With the new default, Reflex Off and the built-in frame generator on, off_paced() returns false, so the swapchain receives no latency mode, markers or sleep. The existing implementation documents NVIDIA holding a present for up to about 200 ms in this configuration, blocking replay submits behind the queue lock.
Do: Keep Off-mode pacing available independently when frame generation needs it, including when Skip Upscaler Wait is off.
Pull request closed