fix(vk): keep NVIDIA Reflex's calls with the row Off, low latency off #3254

Merged
HumanBean merged 2 commits from Veix/Longshot:fix/reflex-off-paced into main 2026-12-05 17:18:14 +00:00
Member

Summary

With NVIDIA Reflex Off, frame generation no longer stalls the renderer: Off now keeps Reflex's calls running with low latency off, as NVIDIA's Reflex guide asks. RTX 4070 SUPER, DLSS FG 2x at 4K DLSS Quality: 104 -> 128 shown fps, 51.9 -> 64.1 real fps, 1% low 18.3 -> 49.9, frames over 25 ms 501 -> 1. The built-in frame generation gains the same.

With the Reflex row Off, vk_reflex.cpp made the swapchain without latency mode and set no markers, no present ids and no sleep. NVIDIA's Reflex programming guide (Streamline, ProgrammingGuideReflex.md) asks for the opposite, always and not only with frame generation: "slReflexSleep and slPCLSetMarker must always be called even when Reflex Low Latency mode is Off"; the application "should always call slReflexSleep and slPCLSetMarker … without any explicit checks for user enablement, or GPU hardware/vendor/driver version"; its checklist has "slReflexSleep is called regardless of Reflex Low Latency mode state" and "PCL Markers are always sent regardless of Reflex Low Latency mode state", and its test step "Turn Reflex to Off" expects the sleep still called and the markers still updating. The guide names no operating system; this file calls the same driver entry points through VK_NV_low_latency2, so Off follows the rule on every NVIDIA driver that has the extension.

Without them NVIDIA's driver holds vkQueuePresentKHR with frame generation on, up to ~200 ms, with DLSS FG and with the built-in one alike. Our presents hold dev.present_mu across that call, so the recorder's submits wait behind it (the log's recorder: line: up to 3.9 s of every 10 s blocked on the queue's lock), the render thread waits for the recorder at the hand-off before DLSS's evaluate, the game's upscale reaches the GPU late, and the game waits at its frame limiter. The presents blocked with their copy into the window already done (RX_VK_PRESENT_PROBE), in a window and in fullscreen alike.

To see it on main: an NVIDIA GPU, Frame generation Fixed 2x (DLSS FG or Built-in), NVIDIA Reflex Off, V-Sync Off, Castle Town. The log's recorder: line shows seconds of every 10 blocked on the queue's lock, and the frame rate is well below Reflex On's.

  • Off is NVIDIA's Off (engaged, off_paced, gpu/vk/vk_reflex.cpp): with the row Off the swapchain is still made in latency mode, and the markers, present ids and sleep run each frame as with the row on; apply_mode gives the sleep mode lowLatencyMode and lowLatencyBoost off, so the driver does not pace the game.
  • The switch RX_VK_REFLEX_OFF_PACED (kill, on; =0: Off as on main), with its row in gpu/vk/switches.def.
  • As before: On and On + Boost; NVIDIA Streamline's own Reflex while it makes DLSS FG's frames (dlssg_active); GPUs without VK_NV_low_latency2 (AMD, Intel, older NVIDIA drivers).
  • The log now says vk: NVIDIA Reflex: off with the row Off (See #1268).

Read first: engaged and on at the top of gpu/vk/vk_reflex.cpp, and the file's header comment.

Written with AI assistance (Claude); the commits carry Co-Authored-By: trailers.

Testing

Tested: Windows 11, RTX 4070 SUPER, driver 621.24, Ryzen 9 9900X: the walking route (market, castle, market), windowed, 4K output, DLSS Quality, Frame generation Fixed 2x (DLSS FG, then Built-in), NVIDIA Reflex Off, V-Sync Off, Skip Upscaler Wait on. With the calls kept the recorder: line's time blocked on the queue's lock went from 0.3-3.9 s of every 10 s to 0.01-0.12 s, and the log says vk: NVIDIA Reflex: off. The picture as before (by eye). With DLSS FG and Skip Upscaler Wait off: 62.8 real fps, 127 shown, 0 frames over 25 ms (on: 64.1, 128, 1).

tests/test_reflex_swapchain_lifetime.py runs its fixture twice, with RX_VK_REFLEX_OFF_PACED unset and at 0, each told what it expects: with the row Off the sleep and its two markers run, a queue submit is tagged with its frame, the swapchain is made in latency mode (reflex_swapchain_info) and is not stale with the calls kept; none of it at 0. Planted bugs fail it: engaged needing the row on again (exit 32), the swapchain made without latency mode with the row Off (exit 37), the switch's default at off (exit 36). The checks for the changed files pass; tests/test_dlssg.py fails the same way on main @ 7bc53f841 ("vk_draw.cpp reads the Upscaler row's setting").

Still to test:

  • Windows, an NVIDIA RTX 50 GPU: Frame generation Fixed 2x (DLSS FG, then Built-in), NVIDIA Reflex Off, V-Sync Off, Castle Town; expecting the recorder: line's time blocked on the queue's lock under ~0.2 s of every 10 s and no lower FPS than RX_VK_REFLEX_OFF_PACED=0 (by hand).
  • Windows, an NVIDIA GPU, frame generation off, NVIDIA Reflex Off: the market, expecting the same FPS as RX_VK_REFLEX_OFF_PACED=0 (by hand).
  • Linux, an NVIDIA GPU with VK_NV_low_latency2: the same as the first item (by hand).

Measurements

Verdict: with frame generation and Reflex Off, +23 % real frames, +16-23 % shown frames, and the slow frames gone; without frame generation no cost (92.0 -> 94.1 fps).

Setup: Windows 11, RTX 4070 SUPER, driver 621.24, Ryzen 9 9900X, 64 GB; the walking route, windowed, 4K output, DLSS Quality, Frame generation Fixed 2x, NVIDIA Reflex Off, V-Sync Off, uncapped; the second market stay from 5 s after its entry. One run each.

Baseline: this PR's build with RX_VK_REFLEX_OFF_PACED=0, which is main's Off line for line (the switch only chooses between the two engaged results); one build keeps everything else equal. Shown fps: the frame-generation log line's frames shown per 5 s, the median over the stay.

Before: main's Off (this PR @ b33a9c3dc, RX_VK_REFLEX_OFF_PACED=0) After: this PR @ b33a9c3dc
DLSS FG: shown fps 104 128
DLSS FG: real fps 51.9 64.1
DLSS FG: 1% low 18.3 49.9
DLSS FG: p99 frame time 48.4 ms 18.6 ms
DLSS FG: frames over 25 ms 501 1
Built-in FG: shown fps 132 153
Built-in FG: real fps 65.5 76.4
Built-in FG: 1% low 26.9 54.9
Built-in FG: p99 frame time 32.6 ms 16.5 ms
Built-in FG: frames over 25 ms 219 0
No frame generation: real fps 92.0 94.1
No frame generation: 1% low 59.3 60.9
No frame generation: p99 frame time 15.3 ms 14.5 ms

Risks

With the Reflex row Off on an NVIDIA GPU, the driver now gets Reflex's markers and sleep calls with low latency off, as NVIDIA's guide asks for Off; the sleep returns at once in that mode. RX_VK_REFLEX_OFF_PACED=0 brings back Off as on main. Reflex On and On + Boost, Streamline's DLSS FG and GPUs without VK_NV_low_latency2 run as before. Nothing changes in the saved settings.

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.
  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def.
  • A check under tests/ that reads changed source is updated, not weakened.
  • 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

## Summary **With NVIDIA Reflex Off, frame generation no longer stalls the renderer: Off now keeps Reflex's calls running with low latency off, as NVIDIA's Reflex guide asks. RTX 4070 SUPER, DLSS FG 2x at 4K DLSS Quality: 104 -> 128 shown fps, 51.9 -> 64.1 real fps, 1% low 18.3 -> 49.9, frames over 25 ms 501 -> 1. The built-in frame generation gains the same.** With the Reflex row Off, `vk_reflex.cpp` made the swapchain without latency mode and set no markers, no present ids and no sleep. NVIDIA's Reflex programming guide ([Streamline, ProgrammingGuideReflex.md](https://github.com/NVIDIA-RTX/Streamline/blob/main/docs/ProgrammingGuideReflex.md)) asks for the opposite, always and not only with frame generation: "`slReflexSleep` and `slPCLSetMarker` must always be called even when Reflex Low Latency mode is Off"; the application "should always call `slReflexSleep` and `slPCLSetMarker` … without any explicit checks for user enablement, or GPU hardware/vendor/driver version"; its checklist has "`slReflexSleep` is called regardless of Reflex Low Latency mode state" and "PCL Markers are always sent regardless of Reflex Low Latency mode state", and its test step "Turn Reflex to Off" expects the sleep still called and the markers still updating. The guide names no operating system; this file calls the same driver entry points through `VK_NV_low_latency2`, so Off follows the rule on every NVIDIA driver that has the extension. Without them NVIDIA's driver holds `vkQueuePresentKHR` with frame generation on, up to ~200 ms, with DLSS FG and with the built-in one alike. Our presents hold `dev.present_mu` across that call, so the recorder's submits wait behind it (the log's `recorder:` line: up to 3.9 s of every 10 s blocked on the queue's lock), the render thread waits for the recorder at the hand-off before DLSS's evaluate, the game's upscale reaches the GPU late, and the game waits at its frame limiter. The presents blocked with their copy into the window already done (`RX_VK_PRESENT_PROBE`), in a window and in fullscreen alike. To see it on `main`: an NVIDIA GPU, Frame generation Fixed 2x (DLSS FG or Built-in), NVIDIA Reflex Off, V-Sync Off, Castle Town. The log's `recorder:` line shows seconds of every 10 blocked on the queue's lock, and the frame rate is well below Reflex On's. - **Off is NVIDIA's Off** (`engaged`, `off_paced`, `gpu/vk/vk_reflex.cpp`): with the row Off the swapchain is still made in latency mode, and the markers, present ids and sleep run each frame as with the row on; `apply_mode` gives the sleep mode `lowLatencyMode` and `lowLatencyBoost` off, so the driver does not pace the game. - **The switch** `RX_VK_REFLEX_OFF_PACED` (`kill`, on; `=0`: Off as on `main`), with its row in `gpu/vk/switches.def`. - **As before:** On and On + Boost; NVIDIA Streamline's own Reflex while it makes DLSS FG's frames (`dlssg_active`); GPUs without `VK_NV_low_latency2` (AMD, Intel, older NVIDIA drivers). - The log now says `vk: NVIDIA Reflex: off` with the row Off (See #1268). Read first: `engaged` and `on` at the top of `gpu/vk/vk_reflex.cpp`, and the file's header comment. Written with AI assistance (Claude); the commits carry `Co-Authored-By:` trailers. ## Testing **Tested:** Windows 11, RTX 4070 SUPER, driver 621.24, Ryzen 9 9900X: the walking route (market, castle, market), windowed, 4K output, DLSS Quality, Frame generation Fixed 2x (DLSS FG, then Built-in), NVIDIA Reflex Off, V-Sync Off, Skip Upscaler Wait on. With the calls kept the `recorder:` line's time blocked on the queue's lock went from 0.3-3.9 s of every 10 s to 0.01-0.12 s, and the log says `vk: NVIDIA Reflex: off`. The picture as before (by eye). With DLSS FG and Skip Upscaler Wait off: 62.8 real fps, 127 shown, 0 frames over 25 ms (on: 64.1, 128, 1). `tests/test_reflex_swapchain_lifetime.py` runs its fixture twice, with `RX_VK_REFLEX_OFF_PACED` unset and at `0`, each told what it expects: with the row Off the sleep and its two markers run, a queue submit is tagged with its frame, the swapchain is made in latency mode (`reflex_swapchain_info`) and is not stale with the calls kept; none of it at `0`. Planted bugs fail it: `engaged` needing the row on again (exit 32), the swapchain made without latency mode with the row Off (exit 37), the switch's default at off (exit 36). The checks for the changed files pass; `tests/test_dlssg.py` fails the same way on `main` @ 7bc53f841 ("vk_draw.cpp reads the Upscaler row's setting"). **Still to test:** - Windows, an NVIDIA RTX 50 GPU: Frame generation Fixed 2x (DLSS FG, then Built-in), NVIDIA Reflex Off, V-Sync Off, Castle Town; expecting the `recorder:` line's time blocked on the queue's lock under ~0.2 s of every 10 s and no lower FPS than `RX_VK_REFLEX_OFF_PACED=0` (by hand). - Windows, an NVIDIA GPU, frame generation off, NVIDIA Reflex Off: the market, expecting the same FPS as `RX_VK_REFLEX_OFF_PACED=0` (by hand). - Linux, an NVIDIA GPU with `VK_NV_low_latency2`: the same as the first item (by hand). ## Measurements **Verdict:** with frame generation and Reflex Off, +23 % real frames, +16-23 % shown frames, and the slow frames gone; without frame generation no cost (92.0 -> 94.1 fps). Setup: Windows 11, RTX 4070 SUPER, driver 621.24, Ryzen 9 9900X, 64 GB; the walking route, windowed, 4K output, DLSS Quality, Frame generation Fixed 2x, NVIDIA Reflex Off, V-Sync Off, uncapped; the second market stay from 5 s after its entry. One run each. Baseline: this PR's build with `RX_VK_REFLEX_OFF_PACED=0`, which is main's Off line for line (the switch only chooses between the two `engaged` results); one build keeps everything else equal. Shown fps: the frame-generation log line's frames shown per 5 s, the median over the stay. | | Before: main's Off (this PR @ b33a9c3dc, `RX_VK_REFLEX_OFF_PACED=0`) | After: this PR @ b33a9c3dc | |---|---|---| | DLSS FG: shown fps | 104 | 128 | | DLSS FG: real fps | 51.9 | 64.1 | | DLSS FG: 1% low | 18.3 | 49.9 | | DLSS FG: p99 frame time | 48.4 ms | 18.6 ms | | DLSS FG: frames over 25 ms | 501 | 1 | | Built-in FG: shown fps | 132 | 153 | | Built-in FG: real fps | 65.5 | 76.4 | | Built-in FG: 1% low | 26.9 | 54.9 | | Built-in FG: p99 frame time | 32.6 ms | 16.5 ms | | Built-in FG: frames over 25 ms | 219 | 0 | | No frame generation: real fps | 92.0 | 94.1 | | No frame generation: 1% low | 59.3 | 60.9 | | No frame generation: p99 frame time | 15.3 ms | 14.5 ms | ## Risks With the Reflex row Off on an NVIDIA GPU, the driver now gets Reflex's markers and sleep calls with low latency off, as NVIDIA's guide asks for Off; the sleep returns at once in that mode. `RX_VK_REFLEX_OFF_PACED=0` brings back Off as on `main`. Reflex On and On + Boost, Streamline's DLSS FG and GPUs without `VK_NV_low_latency2` run as before. Nothing changes in the saved settings. ## 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. - [x] `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. - [x] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [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)
fix(vk): keep NVIDIA Reflex's calls with the row Off, low latency off
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
b33a9c3dcf
NVIDIA's Reflex guide asks for the sleep and the markers each frame even
when Reflex is Off. Without them NVIDIA's driver held vkQueuePresentKHR
for up to ~200 ms with frame generation on, while our present held the
queue's lock: the recorder's submits waited behind it, DLSS's evaluate
waited for the recorder, and the game waited at its limiter.

Off now keeps the latency-mode swapchain, the markers, the present ids
and the sleep, with lowLatencyMode and boost off.
RX_VK_REFLEX_OFF_PACED=0 brings back Off as before.

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

Tested in game: Windows 11, RTX 4070 SUPER, driver 621.24: the walking route at 4K DLSS Quality with Frame generation 2x (DLSS FG and Built-in), Reflex Off; the queue-lock stalls gone, 51.9 -> 64.1 real fps with DLSS FG, picture unchanged

Tested in game: Windows 11, RTX 4070 SUPER, driver 621.24: the walking route at 4K DLSS Quality with Frame generation 2x (DLSS FG and Built-in), Reflex Off; the queue-lock stalls gone, 51.9 -> 64.1 real fps with DLSS FG, picture unchanged
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The reported RTX 4070 SUPER run shows a large reduction in frame-generation stalls, but it is a single run per side. The new default also changes Reflex Off without frame generation and on other NVIDIA systems, where its cost remains unmeasured. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

Reflex Off now keeps the latency-mode swapchain, markers, present IDs and sleep calls while leaving low-latency mode off. This substantially improved the reported frame-generation run, at the cost of additional driver calls and synchronization on every supported NVIDIA Reflex setup.

Should fix (1): not blocking, but worth doing before merging.

  • L1 tests/test_reflex_swapchain_lifetime.py:114: The test derives its expected default from the same function it is testing, so it does not protect the switch's default. (more on the line) Do: Pass the expected switch state to each fixture run and assert it independently of off_paced(); also exercise reflex_swapchain_info with the row Off.

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

  • L2 gpu/vk/vk_reflex.cpp:99: The reported frame-generation gain needs repeated interleaved measurements against the base. (more on the line) Do: Repeat the same warmed-up route with at least two interleaved runs each on the base and this head, reporting individual runs and medians for both frame-generation implementations.
  • L3 gpu/vk/vk_reflex.cpp:99: The default adds driver calls and a semaphore wait even when frame generation is off, a much broader case than the reported fix. (more on the line) Do: Compare base and head in the market with frame generation and Reflex Off on Windows, including frame times and input latency where practical. (@fix does its part first: Limit the new path to frame-generation configurations if the calls are unnecessary without frame generation.)
  • L4 gpu/vk/vk_reflex.cpp:99: The new default has not been exercised on Linux NVIDIA drivers or an RTX 50 GPU. (more on the line) Do: Run the documented Reflex Off frame-generation comparisons on Linux NVIDIA and Windows RTX 50, covering DLSS and built-in frame generation where supported, and report frame times and visual behavior.

@fix can do L1 and L3.

Checks: Still running: 11 checks.

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

Does it help: Unproven across repeated runs. On one Windows RTX 4070 SUPER run per side, DLSS FG improved from 51.9 to 64.1 real fps and its 1% low from 18.3 to 49.9; built-in FG improved from 65.5 to 76.4 real fps. The baseline was this head with the new switch disabled, rather than a separate base build.

Other systems: The default also affects NVIDIA Reflex Off with frame generation disabled, Linux NVIDIA drivers, and swapchain creation while Streamline DLSS FG is active. AMD, Intel and devices without the required extensions do not engage the new path. On and Boost retain their existing call path. The submitted evidence covers Windows RTX 4070 SUPER with frame generation, but not the other affected configurations.

Switches: RX_VK_REFLEX_OFF_PACED is added as a kill switch, default on; 0 restores the previous Off behavior. It has a switches.def row. The default has promising results on one Windows GPU, but its cost without frame generation and on other supported NVIDIA systems is not yet measured.

Reviewed: b33a9c3dcf against 7bc53f8413: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the full vk_reflex.cpp and test_reflex_swapchain_lifetime.py, the diff and commit, and relevant swapchain, presenter and Streamline callers. Skimmed switches.def and other tests that read vk_reflex.cpp. docs/review-checklist.md and ../Tooling/AGENTS.md were absent. No recorded runs, translations or generated files changed.; nothing run (a code review).

Checked and fine:

  • The new switch is listed in switches.def and its disabled path retains the previous eligibility condition.
  • The commit has an AI-assistance trailer; no game-derived or generated files are included.
  • The changed eligibility checks retain the existing Reflex mutex and swapchain-generation checks.

Testing: Read-only review; no code, scripts, builds or tests were run. CI is still running.

Overlaps and merge order: Unknown; the network is closed.


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

**Recommendation: Approve.** The reported RTX 4070 SUPER run shows a large reduction in frame-generation stalls, but it is a single run per side. The new default also changes Reflex Off without frame generation and on other NVIDIA systems, where its cost remains unmeasured. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. Reflex Off now keeps the latency-mode swapchain, markers, present IDs and sleep calls while leaving low-latency mode off. This substantially improved the reported frame-generation run, at the cost of additional driver calls and synchronization on every supported NVIDIA Reflex setup. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `tests/test_reflex_swapchain_lifetime.py:114`: The test derives its expected default from the same function it is testing, so it does not protect the switch's default. (more on the line) **Do:** Pass the expected switch state to each fixture run and assert it independently of off_paced(); also exercise reflex_swapchain_info with the row Off. **Testing before merging (3)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2** `gpu/vk/vk_reflex.cpp:99`: The reported frame-generation gain needs repeated interleaved measurements against the base. (more on the line) **Do:** Repeat the same warmed-up route with at least two interleaved runs each on the base and this head, reporting individual runs and medians for both frame-generation implementations. - **L3** `gpu/vk/vk_reflex.cpp:99`: The default adds driver calls and a semaphore wait even when frame generation is off, a much broader case than the reported fix. (more on the line) **Do:** Compare base and head in the market with frame generation and Reflex Off on Windows, including frame times and input latency where practical. *(`@fix` does its part first: Limit the new path to frame-generation configurations if the calls are unnecessary without frame generation.)* - **L4** `gpu/vk/vk_reflex.cpp:99`: The new default has not been exercised on Linux NVIDIA drivers or an RTX 50 GPU. (more on the line) **Do:** Run the documented Reflex Off frame-generation comparisons on Linux NVIDIA and Windows RTX 50, covering DLSS and built-in frame generation where supported, and report frame times and visual behavior. `@fix` can do L1 and L3. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven across repeated runs. On one Windows RTX 4070 SUPER run per side, DLSS FG improved from 51.9 to 64.1 real fps and its 1% low from 18.3 to 49.9; built-in FG improved from 65.5 to 76.4 real fps. The baseline was this head with the new switch disabled, rather than a separate base build. **Other systems:** The default also affects NVIDIA Reflex Off with frame generation disabled, Linux NVIDIA drivers, and swapchain creation while Streamline DLSS FG is active. AMD, Intel and devices without the required extensions do not engage the new path. On and Boost retain their existing call path. The submitted evidence covers Windows RTX 4070 SUPER with frame generation, but not the other affected configurations. **Switches:** RX_VK_REFLEX_OFF_PACED is added as a kill switch, default on; 0 restores the previous Off behavior. It has a switches.def row. The default has promising results on one Windows GPU, but its cost without frame generation and on other supported NVIDIA systems is not yet measured. **Reviewed:** b33a9c3dcfcf against 7bc53f841323: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the full vk_reflex.cpp and test_reflex_swapchain_lifetime.py, the diff and commit, and relevant swapchain, presenter and Streamline callers. Skimmed switches.def and other tests that read vk_reflex.cpp. docs/review-checklist.md and ../Tooling/AGENTS.md were absent. No recorded runs, translations or generated files changed.; nothing run (a code review). **Checked and fine:** - The new switch is listed in switches.def and its disabled path retains the previous eligibility condition. - The commit has an AI-assistance trailer; no game-derived or generated files are included. - The changed eligibility checks retain the existing Reflex mutex and swapchain-generation checks. **Testing:** Read-only review; no code, scripts, builds or tests were run. CI is still running. **Overlaps and merge order:** Unknown; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by Veix. Nothing was run; a maintainer decides.</sub>
@ -92,0 +96,4 @@
bool off_paced() {
static const bool v = env_on_or("RX_VK_REFLEX_OFF_PACED", 1);
return v;
}
Member

L2 (should fix): The reported frame-generation gain needs repeated interleaved measurements against the base.

When: The 4070 SUPER results have one run per side, so route and run-to-run variation are not represented in the claimed gain or the slow-frame counts.

Do: Repeat the same warmed-up route with at least two interleaved runs each on the base and this head, reporting individual runs and medians for both frame-generation implementations.

**L2** (should fix): The reported frame-generation gain needs repeated interleaved measurements against the base. *When:* The 4070 SUPER results have one run per side, so route and run-to-run variation are not represented in the claimed gain or the slow-frame counts. **Do:** Repeat the same warmed-up route with at least two interleaved runs each on the base and this head, reporting individual runs and medians for both frame-generation implementations.
Member

L3 (should fix): The default adds driver calls and a semaphore wait even when frame generation is off, a much broader case than the reported fix.

When: An NVIDIA player with Reflex and frame generation Off now enters the latency path every frame; the submitted runs do not show its effect on frame time or input latency in that configuration.

Do: Compare base and head in the market with frame generation and Reflex Off on Windows, including frame times and input latency where practical.

**L3** (should fix): The default adds driver calls and a semaphore wait even when frame generation is off, a much broader case than the reported fix. *When:* An NVIDIA player with Reflex and frame generation Off now enters the latency path every frame; the submitted runs do not show its effect on frame time or input latency in that configuration. **Do:** Compare base and head in the market with frame generation and Reflex Off on Windows, including frame times and input latency where practical.
Member

L4 (should fix): The new default has not been exercised on Linux NVIDIA drivers or an RTX 50 GPU.

When: Those systems take the same newly enabled swapchain and per-frame driver path, but the Windows RTX 4070 SUPER result cannot show whether their pacing and output remain correct.

Do: Run the documented Reflex Off frame-generation comparisons on Linux NVIDIA and Windows RTX 50, covering DLSS and built-in frame generation where supported, and report frame times and visual behavior.

**L4** (should fix): The new default has not been exercised on Linux NVIDIA drivers or an RTX 50 GPU. *When:* Those systems take the same newly enabled swapchain and per-frame driver path, but the Windows RTX 4070 SUPER result cannot show whether their pacing and output remain correct. **Do:** Run the documented Reflex Off frame-generation comparisons on Linux NVIDIA and Windows RTX 50, covering DLSS and built-in frame generation where supported, and report frame times and visual behavior.
@ -108,8 +111,10 @@ void reset(){
void retire_before_lock(){reflex_swapchain_destroyed();}
int main(){
reset();reflex_sleep();if(invalid||markers!=2||sleeps!=1||!state.frame_marked)return 1;
const bool paced=off_paced(); // (RX_VK_REFLEX_OFF_PACED: unset or 1 the row Off still marks and sleeps)
Member

L1 (should fix): The test derives its expected default from the same function it is testing, so it does not protect the switch's default.

When: If off_paced() changes its env_on_or default from 1 to 0, both fixture runs set paced to false and all the conditional Off assertions still pass, even though the default no longer fixes the reported stall.

Do: Pass the expected switch state to each fixture run and assert it independently of off_paced(); also exercise reflex_swapchain_info with the row Off.

**L1** (should fix): The test derives its expected default from the same function it is testing, so it does not protect the switch's default. *When:* If off_paced() changes its env_on_or default from 1 to 0, both fixture runs set paced to false and all the conditional Off assertions still pass, even though the default no longer fixes the reported stall. **Do:** Pass the expected switch state to each fixture run and assert it independently of off_paced(); also exercise reflex_swapchain_info with the row Off.
test(vk): pin RX_VK_REFLEX_OFF_PACED's default and the Off swapchain
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
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 / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 6s
06efb02396
Each fixture run is told the switch state it expects, so a changed
default fails the check instead of being read back from off_paced().
reflex_swapchain_info is checked with the row Off: in latency mode with
the calls kept, untouched with RX_VK_REFLEX_OFF_PACED=0.

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

L1: done in 06efb0239: each fixture run is told the switch state it expects (the default at off now fails it, exit 36), and reflex_swapchain_info is checked with the row Off (the old rule fails it, exit 37).

L2: the gap is far beyond run-to-run noise on this route (the means of one setting hold to about 0.01 ms between runs), and every combination we ran shows it the same way, on two builds:

Setup (4K DLSS Quality, Reflex Off) Off as on main This PR
DLSS FG 2x 51.9 fps, 501 frames over 25 ms 64.1 fps, 1
Built-in FG 2x 65.5 fps, 219 76.4 fps, 0
DLSS FG 2x, Skip Upscaler Wait off 62.8 fps, 0
DLSS FG 2x, #3212's build (the same change as a test switch) 52.5 fps, 523 65.6 fps, 0
No frame generation 92.0 fps 94.1 fps

With the calls kept the recorder's time blocked on the queue's lock fell from 0.3-3.9 s of every 10 s to 0.01-0.12 s in each frame-generation run. For comparison, Reflex On + Boost on #3212's build: 65.5 fps, 0 frames over 25 ms: Off now matches it.

L3: NVIDIA's guide asks for the calls always, not only with frame generation ("without any explicit checks for user enablement, or GPU hardware/vendor/driver version", linked in the description), so the path stays for every Reflex Off. Without frame generation it costs nothing measurable (92.0 -> 94.1 fps, 1% low 59.3 -> 60.9).

L4: under Still to test (Linux NVIDIA, RTX 50).

**L1:** done in 06efb0239: each fixture run is told the switch state it expects (the default at off now fails it, exit 36), and `reflex_swapchain_info` is checked with the row Off (the old rule fails it, exit 37). **L2:** the gap is far beyond run-to-run noise on this route (the means of one setting hold to about 0.01 ms between runs), and every combination we ran shows it the same way, on two builds: | Setup (4K DLSS Quality, Reflex Off) | Off as on `main` | This PR | |---|---|---| | DLSS FG 2x | 51.9 fps, 501 frames over 25 ms | 64.1 fps, 1 | | Built-in FG 2x | 65.5 fps, 219 | 76.4 fps, 0 | | DLSS FG 2x, Skip Upscaler Wait off | | 62.8 fps, 0 | | DLSS FG 2x, #3212's build (the same change as a test switch) | 52.5 fps, 523 | 65.6 fps, 0 | | No frame generation | 92.0 fps | 94.1 fps | With the calls kept the recorder's time blocked on the queue's lock fell from 0.3-3.9 s of every 10 s to 0.01-0.12 s in each frame-generation run. For comparison, Reflex On + Boost on #3212's build: 65.5 fps, 0 frames over 25 ms: Off now matches it. **L3:** NVIDIA's guide asks for the calls always, not only with frame generation ("without any explicit checks for user enablement, or GPU hardware/vendor/driver version", linked in the description), so the path stays for every Reflex Off. Without frame generation it costs nothing measurable (92.0 -> 94.1 fps, 1% low 59.3 -> 60.9). **L4:** under Still to test (Linux NVIDIA, RTX 50).
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The reported frame-generation improvement is substantial, but repeated interleaved measurements and the Linux and RTX 50 runs are still needed before choosing the new default for all affected players. Recommend approval; not approved on the forge.

Keeps Reflex markers, present IDs and sleep calls active with low latency disabled when the Reflex row is Off. The reported Windows run shows much shorter frame-generation stalls, at the cost of additional driver calls and a semaphore wait even without frame generation.

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

  • L2 gpu/vk/vk_reflex.cpp:99: The reported frame-generation gain needs repeated interleaved measurements against the base. When: The 4070 SUPER results have one run per side, so route and run-to-run variation are not represented in the claimed gain or the slow-frame counts. Do: Repeat the same warmed-up route with at least two interleaved runs each on the base and this head, reporting individual runs and medians for both frame-generation implementations.
  • L3 gpu/vk/vk_reflex.cpp:99: The default adds driver calls and a semaphore wait even when frame generation is off, a much broader case than the reported fix. When: An NVIDIA player with Reflex and frame generation Off now enters the latency path every frame; the submitted runs do not show its effect on frame time or input latency in that configuration. Do: Compare base and head in the market with frame generation and Reflex Off on Windows, including frame times and input latency where practical. (@fix does its part first: Limit the new path to frame-generation configurations if the calls are unnecessary without frame generation.)
  • L4 gpu/vk/vk_reflex.cpp:99: The new default has not been exercised on Linux NVIDIA drivers or an RTX 50 GPU. When: Those systems take the same newly enabled swapchain and per-frame driver path, but the Windows RTX 4070 SUPER result cannot show whether their pacing and output remain correct. Do: Run the documented Reflex Off frame-generation comparisons on Linux NVIDIA and Windows RTX 50, covering DLSS and built-in frame generation where supported, and report frame times and visual behavior.

@fix can do L3.

Since the last review (on b33a9c3dcf)
Resolved: L1 (The test derives its expected default from the same function it is testing, so it does not…)
Still open: L2 (The reported frame-generation gain needs repeated interleaved measurements against the bas…); L3 (The default adds driver calls and a semaphore wait even when frame generation is off, a mu…); L4 (The new default has not been exercised on Linux NVIDIA drivers or an RTX 50 GPU.)

Checks: Still running: 11 checks.

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

Does it help: Unproven: on one Windows RTX 4070 SUPER run, DLSS FG improved from 51.9 to 64.1 real fps and frames over 25 ms fell from 501 to 1; built-in FG improved from 65.5 to 76.4 fps. The PR reports one run per setting rather than repeated interleaved runs.

Other systems: The new default affects NVIDIA drivers supporting VK_NV_low_latency2 on Windows and Linux. Linux and RTX 50 behavior remain untested; GPUs without the extension and Streamline's active DLSS FG path are guarded separately.

Switches: RX_VK_REFLEX_OFF_PACED is added as a developer kill switch, default on; 0 restores the previous Off behavior. The default's broader performance and hardware effects still need the listed runs.

Reviewed: 06efb02396 against 7bc53f8413: Read the changed test and its incremental diff, the Reflex change and its callers, repository guidance and pull request template. The large switches.def and surrounding renderer files were skimmed; no generated files or recorded runs were supplied for review.; nothing run (a code review).

Checked and fine:

  • The test separately checks the default and explicit 0, including swapchain latency mode with the row Off.
  • The incremental test change does not disable the Reflex behavior introduced by the pull request.

Testing: No code or tests were run. The author reports an in-game Windows RTX 4070 SUPER test; CI is still running.

Overlaps and merge order: None found in the supplied information.


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

**Recommendation: Approve.** The code is ready: only testing is left. The reported frame-generation improvement is substantial, but repeated interleaved measurements and the Linux and RTX 50 runs are still needed before choosing the new default for all affected players. Recommend approval; not approved on the forge. Keeps Reflex markers, present IDs and sleep calls active with low latency disabled when the Reflex row is Off. The reported Windows run shows much shorter frame-generation stalls, at the cost of additional driver calls and a semaphore wait even without frame generation. **Testing before merging (3)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2** `gpu/vk/vk_reflex.cpp:99`: The reported frame-generation gain needs repeated interleaved measurements against the base. *When:* The 4070 SUPER results have one run per side, so route and run-to-run variation are not represented in the claimed gain or the slow-frame counts. **Do:** Repeat the same warmed-up route with at least two interleaved runs each on the base and this head, reporting individual runs and medians for both frame-generation implementations. - **L3** `gpu/vk/vk_reflex.cpp:99`: The default adds driver calls and a semaphore wait even when frame generation is off, a much broader case than the reported fix. *When:* An NVIDIA player with Reflex and frame generation Off now enters the latency path every frame; the submitted runs do not show its effect on frame time or input latency in that configuration. **Do:** Compare base and head in the market with frame generation and Reflex Off on Windows, including frame times and input latency where practical. *(`@fix` does its part first: Limit the new path to frame-generation configurations if the calls are unnecessary without frame generation.)* - **L4** `gpu/vk/vk_reflex.cpp:99`: The new default has not been exercised on Linux NVIDIA drivers or an RTX 50 GPU. *When:* Those systems take the same newly enabled swapchain and per-frame driver path, but the Windows RTX 4070 SUPER result cannot show whether their pacing and output remain correct. **Do:** Run the documented Reflex Off frame-generation comparisons on Linux NVIDIA and Windows RTX 50, covering DLSS and built-in frame generation where supported, and report frame times and visual behavior. `@fix` can do L3. **Since the last review** (on b33a9c3dcfcf) Resolved: L1 (The test derives its expected default from the same function it is testing, so it does not…) Still open: L2 (The reported frame-generation gain needs repeated interleaved measurements against the bas…); L3 (The default adds driver calls and a semaphore wait even when frame generation is off, a mu…); L4 (The new default has not been exercised on Linux NVIDIA drivers or an RTX 50 GPU.) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven: on one Windows RTX 4070 SUPER run, DLSS FG improved from 51.9 to 64.1 real fps and frames over 25 ms fell from 501 to 1; built-in FG improved from 65.5 to 76.4 fps. The PR reports one run per setting rather than repeated interleaved runs. **Other systems:** The new default affects NVIDIA drivers supporting VK_NV_low_latency2 on Windows and Linux. Linux and RTX 50 behavior remain untested; GPUs without the extension and Streamline's active DLSS FG path are guarded separately. **Switches:** RX_VK_REFLEX_OFF_PACED is added as a developer kill switch, default on; 0 restores the previous Off behavior. The default's broader performance and hardware effects still need the listed runs. **Reviewed:** 06efb0239628 against 7bc53f841323: Read the changed test and its incremental diff, the Reflex change and its callers, repository guidance and pull request template. The large switches.def and surrounding renderer files were skimmed; no generated files or recorded runs were supplied for review.; nothing run (a code review). **Checked and fine:** - The test separately checks the default and explicit 0, including swapchain latency mode with the row Off. - The incremental test change does not disable the Reflex behavior introduced by the pull request. **Testing:** No code or tests were run. The author reports an in-game Windows RTX 4070 SUPER test; CI is still running. **Overlaps and merge order:** None found in the supplied information. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by Veix. Nothing was run; a maintainer decides.</sub>
Author
Member

Two more combinations on the same build (06efb0239's code; RX_VK_REFLEX_OFF_PACED=0 for main's Off), the walking route, windowed, 4K DLSS Quality, Reflex Off, the second market stay from 5 s after its entry.

Without frame generation, two pairs: no cost; the fix is slightly ahead in both.

No frame generation Off as on main (pair 1 / 2) This PR (pair 1 / 2)
Real fps 92.0 / 92.2 94.1 / 94.0
1% low 59.3 / 58.6 60.9 / 60.1
p99 frame time 15.3 / 15.2 ms 14.5 / 14.7 ms
Frame time standard deviation 1.24 / 1.26 ms 1.09 / 1.14 ms
Mean change from one frame to the next 1.04 / 1.09 ms 0.89 / 0.92 ms

Built-in frame generation at 4x (DLSS FG makes at most one frame between two of the game's on this RTX 4070 SUPER):

Built-in FG 4x Off as on main This PR
Shown fps (median, per 5 s) 240 (220-255) 275 (269-282)
Real fps 59.0 68.6
1% low 20.8 49.9
p99 frame time 41.6 ms 18.7 ms
Frames over 25 ms 243 0
Two more combinations on the same build (06efb0239's code; `RX_VK_REFLEX_OFF_PACED=0` for main's Off), the walking route, windowed, 4K DLSS Quality, Reflex Off, the second market stay from 5 s after its entry. **Without frame generation, two pairs:** no cost; the fix is slightly ahead in both. | No frame generation | Off as on `main` (pair 1 / 2) | This PR (pair 1 / 2) | |---|---|---| | Real fps | 92.0 / 92.2 | 94.1 / 94.0 | | 1% low | 59.3 / 58.6 | 60.9 / 60.1 | | p99 frame time | 15.3 / 15.2 ms | 14.5 / 14.7 ms | | Frame time standard deviation | 1.24 / 1.26 ms | 1.09 / 1.14 ms | | Mean change from one frame to the next | 1.04 / 1.09 ms | 0.89 / 0.92 ms | **Built-in frame generation at 4x** (DLSS FG makes at most one frame between two of the game's on this RTX 4070 SUPER): | Built-in FG 4x | Off as on `main` | This PR | |---|---|---| | Shown fps (median, per 5 s) | 240 (220-255) | 275 (269-282) | | Real fps | 59.0 | 68.6 | | 1% low | 20.8 | 49.9 | | p99 frame time | 41.6 ms | 18.7 ms | | Frames over 25 ms | 243 | 0 |
HumanBean deleted branch fix/reflex-off-paced 2026-12-05 17:18:16 +00:00
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
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 / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 6s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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!3254
No description provided.