fix(vk): with NVIDIA's driver on Linux each frame is presented before the next frame's work runs (RX_VK_PRESENT_GATE=0 to disable) #3298

Merged
HumanBean merged 4 commits from HumanBean/Longshot:fix/present-gate into main 2026-12-06 02:46:39 +00:00
Owner

Summary

With NVIDIA's driver on Linux each game frame is now presented before the next frame's work runs on the GPU: the 1 %
low goes from 80 to 100 fps in Kokiri at 4K DLSS (from 1080p), with the same fps, and every frame reaches the screen on an
even rhythm.
This is the proper fix for the DLSS 1 % low drop that #3287 tries to fix by turning Skip Upscaler Wait off.

What was wrong: NVIDIA's Linux driver does a present's own GPU work on the queue it is given and waits for it on the CPU.
With Skip Upscaler Wait (#3135) the game is a frame ahead, so by the time the presenter presented frame N, 0–9 ms of frame
N+1's work was already queued on the replay's queue in front of it. Frame N went out late by a different amount every
frame (real present intervals: 33–37 % over 1.25x the median, p99 18 ms at a 9 ms median), and the render thread waited
for the presenter as long. Not V-Sync, not Reflex: the same with V-Sync off (immediate) and with Reflex Off.

What this changes (device_policy.h present_gate, on with NVIDIA's driver on Linux; RX_VK_PRESENT_GATE=0 turns it
off, =1 on elsewhere):

  • The game frames are presented on a second queue of the replay's family (vk_main.cpp create_device). The Present
    queue row's compute queue could not present to the Wayland window here, so every earlier "own queue" try silently
    presented on the replay's queue.
  • The first replay submit after each present's hand-over waits on the GPU for a timeline semaphore (submit_or_retry),
    which the presenter signals on its queue right after vkQueuePresentKHR returns, before any wait for the frame to be
    shown (presenter_loop). No CPU thread waits: the next frame's work is submitted as before and starts on the GPU about
    0.15 ms after the copy. The copy is submitted before the hand-over, so it is never behind the gate, and every hand-over's
    value is signalled whatever its present did.
  • Frame generation's presents stay on the replay's queue (or the Present queue row's compute queue) as before.

Read first: the present gate's comment above submit_or_retry in gpu/vk/vk_replay.cpp, then gate_signal in
presenter_loop and the gate block in present_hand_off.

How it was found (for #3287): the frame trace's ms is the render thread's present-to-present time, not the game's
frame time. A probe (not in this PR) timed the presenter's copy wait, present call and shown wait, the render thread's
drain, fence, acquire and Reflex sleep, and the game's limiter and room waits. Under FIFO at 240 Hz the skip showed no
alternation on this PC; the 1 % low drop came from the present call blocking 8–11 ms (p95) with the skip on, against 1 ms
off. Presenting right after the copy's submit on the replay's queue made presents even but cost 10 % fps (the call held
the queue's lock ~6.5 ms, stalling the recorder's submits and with them the game's captures); a high-priority present
queue is not offered (the family lists medium only). The gate keeps the order without holding any CPU thread.

Testing

Tested: Linux (CachyOS, sway 1.13, Wayland), RTX 3090, NVIDIA 620.70.06, windowed on a 240 Hz display, the game's
4K output with DLSS from 1080p, Reflex On, V-Sync Off, uncapped (the settings of the v3.2.0 against nightly 1179 benchmark
that showed the drop). Kokiri Forest, Hyrule Field and the Market standing still, 45 s each, gate on (default) against
RX_VK_PRESENT_GATE=0, interleaved: the log says vk: presents on a queue of their own, the second of the replay's family 0 (the present gate) and vk: the present gate: on, ...; with the gate the present call takes 0.15 ms (median) and
under 2 % of real present intervals are over 1.25x the median, against 8–40 % off. A run of the first test version
showed the same in Kokiri twice more (1 % low 99.7 and 100.6 against 80.0 and 79.4).

tests/test_device_policy.py covers the rule and the switch (not run yet here: the PC's queue was busy with the runs
below).

Also on this PC, one run a side, gate on against off (Kokiri, the same settings unless said): V-Sync On (FIFO) 127.1
against 128.6 fps, 1 % low 83.3 against 86.4; a 60 fps cap 60.0 against 60.0, 1 % low 56.6 against 53.2; Skip Upscaler
Wait off 94.5 against 94.6, 1 % low 64.0 (a pipeline built mid-run) against 68.2; frame generation 2x 72.0 against 70.6,
1 % low 50.9 against 45.2. No loss past the noise.

A cold review by a second agent found a deadlock, fixed in the third commit: device_wait_idle_locked holds the presents'
queue's lock the presenter signals under, so a submit held for a present not yet made never ran and the idle-wait never
ended (a resize, an effect or frame generation toggled). The values handed over are now signalled from the CPU first.
Rebased on main 0b284cc7 (#3299): it compiles on Linux, and a windowed smoke run passed with the gate on (in play from
kokiri-start, 900 frames, the menu opened; the log names the gate's queue).

Still to test:

  • Windows: an llvm-mingw compile of this head (the gate is Linux-only by default, but the code builds everywhere), expecting it to build (by hand, or the CI's Windows build)
  • Windows, NVIDIA: RX_VK_PRESENT_GATE=1 against unset at 4K DLSS from 1080p, V-Sync off, Kokiri, expecting a better
    1 % low with the same fps (the #3287 numbers suggest the same block there) (@Beanstalk)
  • AMD and Intel, Linux and Windows: RX_VK_PRESENT_GATE=1 against unset, to decide whether to turn it on there
    (@Beanstalk)

Measurements

Verdict: the same fps or better, and a much better 1 % low, in all three areas.

Setup: Linux, RTX 3090, NVIDIA 620.70.06, Ryzen (24 threads); 4K output, DLSS from 1080p, Reflex On, V-Sync Off,
uncapped, windowed (kept visible), standing 45 s after a warm-up; dev.py ab --env RX_VK_PRESENT_GATE=0, two
interleaved pairs, one build. "1 % low" is dev.py ab's (the frame trace).

Before: main @ de091ae2 (this PR's build with RX_VK_PRESENT_GATE=0, main's path) After: this PR @ 04c298ce (the gate on, the default)
Kokiri Forest: fps 109.8 / 109.2 108.8 / 109.4
Kokiri Forest: 1 % low 80.1 / 79.1 91.8 / 97.6
Hyrule Field: fps 103.4 / 101.3 101.9 / 100.4
Hyrule Field: 1 % low 70.0 / 64.4 91.4 / 69.8 (a pipeline built mid-run)
Market: fps 97.3 / 93.3 97.7 / 97.9
Market: 1 % low 62.3 / 64.6 71.6 / 74.4

Real present intervals (a probe around vkQueuePresentKHR, Kokiri): p99 18.1 ms off, 9.7 ms on; over 1.25x the median
33–37 % off, 0.0 % on.

Risks

  • The second commit moves Skip Upscaler Wait to the Debug tab's developer page (after Present queue), still on by
    default and changing at once: with the gate it has no downside here, so it is best left on. Its key and saved value are
    unchanged.

  • A second queue of the graphics family on NVIDIA Linux only. A driver that misbehaves with it: RX_VK_PRESENT_GATE=0
    restores main's path exactly. A revert is enough.

  • A gated submit that is never signalled would stall the GPU: every hand-over's value is signalled on every path of the
    presenter's iteration (made, failed, not made), and the copy is always ahead of the gate.

  • The Present queue row (Debug tab, compute queue) is not made while the gate is on with NVIDIA on Linux: the gate's own
    queue takes its place (logged).

  • Nothing changes in saves or 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): dev.py test-changed and, on the rebased head, test_device_policy, test_menu_ini_keys, test_upscaler_rows, test_recorder_parts, test_vk_recorder_fast pass; test_i18n_complete fails on main too ("Fill title screen" untranslated).
  • 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: test_device_policy (the rule and RX_VK_PRESENT_GATE); the gate's GPU ordering itself needs a GPU (the windowed smoke run below).
  • 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.
  • Docs updated (docs/dev/reference/threads.md; the player guide's row moved with the second commit).
  • 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's driver on Linux each game frame is now presented before the next frame's work runs on the GPU: the 1 % low goes from 80 to 100 fps in Kokiri at 4K DLSS (from 1080p), with the same fps, and every frame reaches the screen on an even rhythm.** This is the proper fix for the DLSS 1 % low drop that #3287 tries to fix by turning Skip Upscaler Wait off. What was wrong: NVIDIA's Linux driver does a present's own GPU work on the queue it is given and waits for it on the CPU. With Skip Upscaler Wait (#3135) the game is a frame ahead, so by the time the presenter presented frame N, 0–9 ms of frame N+1's work was already queued on the replay's queue in front of it. Frame N went out late by a different amount every frame (real present intervals: 33–37 % over 1.25x the median, p99 18 ms at a 9 ms median), and the render thread waited for the presenter as long. Not V-Sync, not Reflex: the same with V-Sync off (immediate) and with Reflex Off. What this changes (`device_policy.h` `present_gate`, on with NVIDIA's driver on Linux; `RX_VK_PRESENT_GATE=0` turns it off, `=1` on elsewhere): - The game frames are presented on a second queue of the replay's family (`vk_main.cpp` `create_device`). The Present queue row's compute queue could not present to the Wayland window here, so every earlier "own queue" try silently presented on the replay's queue. - The first replay submit after each present's hand-over waits **on the GPU** for a timeline semaphore (`submit_or_retry`), which the presenter signals on its queue right after `vkQueuePresentKHR` returns, before any wait for the frame to be shown (`presenter_loop`). No CPU thread waits: the next frame's work is submitted as before and starts on the GPU about 0.15 ms after the copy. The copy is submitted before the hand-over, so it is never behind the gate, and every hand-over's value is signalled whatever its present did. - Frame generation's presents stay on the replay's queue (or the Present queue row's compute queue) as before. Read first: the present gate's comment above `submit_or_retry` in `gpu/vk/vk_replay.cpp`, then `gate_signal` in `presenter_loop` and the gate block in `present_hand_off`. How it was found (for #3287): the frame trace's `ms` is the render thread's present-to-present time, not the game's frame time. A probe (not in this PR) timed the presenter's copy wait, present call and shown wait, the render thread's drain, fence, acquire and Reflex sleep, and the game's limiter and room waits. Under FIFO at 240 Hz the skip showed no alternation on this PC; the 1 % low drop came from the present call blocking 8–11 ms (p95) with the skip on, against 1 ms off. Presenting right after the copy's submit on the replay's queue made presents even but cost 10 % fps (the call held the queue's lock ~6.5 ms, stalling the recorder's submits and with them the game's captures); a high-priority present queue is not offered (the family lists medium only). The gate keeps the order without holding any CPU thread. ## Testing **Tested:** Linux (CachyOS, sway 1.13, Wayland), RTX 3090, NVIDIA 620.70.06, windowed on a 240 Hz display, the game's 4K output with DLSS from 1080p, Reflex On, V-Sync Off, uncapped (the settings of the v3.2.0 against nightly 1179 benchmark that showed the drop). Kokiri Forest, Hyrule Field and the Market standing still, 45 s each, gate on (default) against `RX_VK_PRESENT_GATE=0`, interleaved: the log says `vk: presents on a queue of their own, the second of the replay's family 0 (the present gate)` and `vk: the present gate: on, ...`; with the gate the present call takes 0.15 ms (median) and under 2 % of real present intervals are over 1.25x the median, against 8–40 % off. A run of the first test version showed the same in Kokiri twice more (1 % low 99.7 and 100.6 against 80.0 and 79.4). `tests/test_device_policy.py` covers the rule and the switch (not run yet here: the PC's queue was busy with the runs below). Also on this PC, one run a side, gate on against off (Kokiri, the same settings unless said): V-Sync On (FIFO) 127.1 against 128.6 fps, 1 % low 83.3 against 86.4; a 60 fps cap 60.0 against 60.0, 1 % low 56.6 against 53.2; Skip Upscaler Wait off 94.5 against 94.6, 1 % low 64.0 (a pipeline built mid-run) against 68.2; frame generation 2x 72.0 against 70.6, 1 % low 50.9 against 45.2. No loss past the noise. A cold review by a second agent found a deadlock, fixed in the third commit: `device_wait_idle_locked` holds the presents' queue's lock the presenter signals under, so a submit held for a present not yet made never ran and the idle-wait never ended (a resize, an effect or frame generation toggled). The values handed over are now signalled from the CPU first. Rebased on `main` 0b284cc7 (#3299): it compiles on Linux, and a windowed smoke run passed with the gate on (in play from kokiri-start, 900 frames, the menu opened; the log names the gate's queue). **Still to test:** - Windows: an llvm-mingw compile of this head (the gate is Linux-only by default, but the code builds everywhere), expecting it to build (by hand, or the CI's Windows build) - Windows, NVIDIA: `RX_VK_PRESENT_GATE=1` against unset at 4K DLSS from 1080p, V-Sync off, Kokiri, expecting a better 1 % low with the same fps (the #3287 numbers suggest the same block there) (@Beanstalk) - AMD and Intel, Linux and Windows: `RX_VK_PRESENT_GATE=1` against unset, to decide whether to turn it on there (@Beanstalk) ## Measurements **Verdict:** the same fps or better, and a much better 1 % low, in all three areas. Setup: Linux, RTX 3090, NVIDIA 620.70.06, Ryzen (24 threads); 4K output, DLSS from 1080p, Reflex On, V-Sync Off, uncapped, windowed (kept visible), standing 45 s after a warm-up; `dev.py ab --env RX_VK_PRESENT_GATE=0`, two interleaved pairs, one build. "1 % low" is `dev.py ab`'s (the frame trace). | | Before: main @ de091ae2 (this PR's build with `RX_VK_PRESENT_GATE=0`, main's path) | After: this PR @ 04c298ce (the gate on, the default) | |---|---|---| | Kokiri Forest: fps | 109.8 / 109.2 | 108.8 / 109.4 | | Kokiri Forest: 1 % low | 80.1 / 79.1 | 91.8 / 97.6 | | Hyrule Field: fps | 103.4 / 101.3 | 101.9 / 100.4 | | Hyrule Field: 1 % low | 70.0 / 64.4 | 91.4 / 69.8 (a pipeline built mid-run) | | Market: fps | 97.3 / 93.3 | 97.7 / 97.9 | | Market: 1 % low | 62.3 / 64.6 | 71.6 / 74.4 | Real present intervals (a probe around `vkQueuePresentKHR`, Kokiri): p99 18.1 ms off, 9.7 ms on; over 1.25x the median 33–37 % off, 0.0 % on. ## Risks - The second commit moves Skip Upscaler Wait to the Debug tab's developer page (after Present queue), still on by default and changing at once: with the gate it has no downside here, so it is best left on. Its key and saved value are unchanged. - A second queue of the graphics family on NVIDIA Linux only. A driver that misbehaves with it: `RX_VK_PRESENT_GATE=0` restores main's path exactly. A revert is enough. - A gated submit that is never signalled would stall the GPU: every hand-over's value is signalled on every path of the presenter's iteration (made, failed, not made), and the copy is always ahead of the gate. - The Present queue row (Debug tab, compute queue) is not made while the gate is on with NVIDIA on Linux: the gate's own queue takes its place (logged). - Nothing changes in saves or 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): `dev.py test-changed` and, on the rebased head, `test_device_policy`, `test_menu_ini_keys`, `test_upscaler_rows`, `test_recorder_parts`, `test_vk_recorder_fast` pass; `test_i18n_complete` fails on `main` too ("Fill title screen" untranslated). - [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: `test_device_policy` (the rule and `RX_VK_PRESENT_GATE`); the gate's GPU ordering itself needs a GPU (the windowed smoke run below). - [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] Docs updated (docs/dev/reference/threads.md; the player guide's row moved with the second commit). - [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): the present gate: with NVIDIA's driver on Linux each frame is presented before the next frame's work runs (RX_VK_PRESENT_GATE=0 to disable)
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
04c298ce7d
NVIDIA's Linux driver does a present's own GPU work on the queue it is given and
waits for it on the CPU. With Skip Upscaler Wait the game is a frame ahead, so
part of the next frame's work was always queued ahead of each present: frames
went out 0-9 ms late, a different amount each time, and the 1% low fell.

The game frames are now presented on a second queue of the replay's family, and
the first replay submit after each hand-over waits on the GPU (a timeline
semaphore) until the presenter has made that present. No CPU thread waits.

Kokiri Forest, 4K DLSS from 1080p, RTX 3090, Linux: fps the same, 1% low
80 -> 100 fps, real present interval p99 18.1 -> 9.7 ms.

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

Tested in game: Linux (CachyOS, sway, Wayland), RTX 3090, NVIDIA 620.70.06, 4K DLSS from 1080p, Reflex On, V-Sync Off, uncapped: Kokiri Forest, Hyrule Field and the Market, gate on against RX_VK_PRESENT_GATE=0, two interleaved pairs each. Log shows the gate on its own queue; present call 0.15 ms; 1% low up in all three areas (Kokiri 80 -> 92-98), same fps.

Tested in game: Linux (CachyOS, sway, Wayland), RTX 3090, NVIDIA 620.70.06, 4K DLSS from 1080p, Reflex On, V-Sync Off, uncapped: Kokiri Forest, Hyrule Field and the Market, gate on against RX_VK_PRESENT_GATE=0, two interleaved pairs each. Log shows the gate on its own queue; present call 0.15 ms; 1% low up in all three areas (Kokiri 80 -> 92-98), same fps.
Member

Possibly related, for context:

  • PR #2053 WIP: perf(vk): the present lets the replay's order lock go once the frame's copy is on the queue (RX_VK_PRESENT_UNLOCKED=0 to disable) — Open Vulkan present-path change may overlap replay/present synchronization
Possibly related, for context: - PR #2053 WIP: perf(vk): the present lets the replay's order lock go once the frame's copy is on the queue (RX_VK_PRESENT_UNLOCKED=0 to disable) — Open Vulkan present-path change may overlap replay/present synchronization
ui(graphics): Skip Upscaler Wait moves to the Debug tab's developer page, still on by default
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
3aeebf50ee
With the present gate the skip has no downside on NVIDIA's Linux driver: best
left on, so the row leaves the Graphics tab. It keeps its key, its default and
its behaviour (changes at once).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(vk): the present gate is let go before a whole-device idle-wait, and its log lines name it
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
324933d274
device_wait_idle_locked holds the presents' queue's lock the presenter signals the
gate under: a submit held for a present not yet made never ran, and the idle-wait
never ended (a resize, an effect or frame generation toggled). The values handed
over are now signalled from the CPU first, and the presenter skips one already
signalled. The device-lost note, the present probe's line and the queues' priority
line name the gate's queue (from a cold review).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean force-pushed fix/present-gate from 324933d274
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 9ea318cccd
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
2026-12-06 02:09:27 +00:00
Compare
HumanBean force-pushed fix/present-gate from 9ea318cccd
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 48476edc40
Some checks failed
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/windows+nvidia+window+dlss+gpu-rtx-40xx_rtx-50xx 0/1 pass, 0 running, 2 queued
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
2026-12-06 02:10:02 +00:00
Compare
Author
Owner
@review
BeanBot requested changes 2026-12-06 02:12:15 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The gate can miss next-frame submissions and can leave the GPU waiting forever when its signal submission fails. Its idle-wait release also permits timeline signals to execute out of order.

The change presents game frames on a second queue and holds subsequent replay work until presentation, improving reported frame pacing on the tested NVIDIA Linux system. It also moves Skip Upscaler Wait to the developer page; the synchronization and other supported configurations need further work.

Blocking (4): must change before merging.

  1. L1 gpu/vk/vk_replay.cpp:7747: The replay queue is unlocked before the gate value is published, so another submitting thread can enqueue next-frame work without the gate. When: After the frame copy is submitted, present_out unlocks present_mu before present_hand_off stores present_gate_pending. A recorder or replay submit that acquires the lock in that interval sees no pending value and runs ahead of the present, restoring the variable presentation delay this change is intended to prevent. Do: Publish the hand-off's gate value while holding the replay queue lock, after the copy submit and before any later submit can acquire that lock.
  2. L2 gpu/vk/vk_replay.cpp:175: The gate records a signal as completed before checking whether Vulkan accepted it, and a refused signal leaves its waiting replay submission blocked. (more on the line) Do: Handle signal submission failure with a safe retry or release/fatal path, and advance the bookkeeping only after a signal is successfully arranged.
  3. L3 gpu/vk/vk_replay.cpp:179: A CPU release can overtake an earlier signal already queued on the presenter queue, violating timeline semaphore signal ordering. (more on the line) Do: Coordinate CPU release with outstanding queue signals so every timeline signal executes in increasing order, without waiting while holding a lock needed by the presenter.
  4. L4 gpu/vk/vk_replay.cpp:8137: The semaphore handle is initialized without the lock used by the idle-wait path that reads it. (more on the line) Do: Create and publish the semaphore under the same synchronization used by readers, or initialize it before concurrent idle waits and submissions can begin.

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

  • L5 gpu/vk/device_policy.h:839: The default covers all NVIDIA proprietary Linux systems, while the repeated measurements cover one GPU, driver and Wayland configuration. (more on the line) Do: Run interleaved gate-on and gate-off comparisons on representative NVIDIA Linux tier-1 systems and window/present modes, including frame times and 1% lows.

@fix can do L1, L2, L3 and L4.

Questions (3) (not confirmed from the code; they don't hold the recommendation)

  • Does the second queue remain beneficial when Skip Upscaler Wait is off across the NVIDIA Linux systems that receive it by default?
  • Is the loss of the developer Present queue for frame generation on NVIDIA Linux intended for users who explicitly enabled that setting?
  • tests/test_device_policy.py:439: Is there a game-free behavioral test elsewhere that exercises the gate’s ordering and idle release?

Checks: Still running: 11 checks.

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

Does it help: Yes, on the reported RTX 3090 Linux setup: two interleaved runs show Kokiri 1% lows of 80.1/79.1 fps with the gate off and 91.8/97.6 with it on, with average fps roughly unchanged. The reported present-interval p99 falls from 18.1 to 9.7 ms. The comparison uses the same head with the switch off, rather than a separate base build, and does not establish the effect across the default's other NVIDIA Linux configurations.

Other systems: The default affects NVIDIA proprietary drivers on Linux, including different GPUs, window systems, present modes, caps and upscalers. The override can enable it on Windows, AMD and Intel. Frame generation's synchronous presents use the replay queue when the gate queue replaces the developer Present queue. The reported frame-generation, FIFO and capped runs are single runs on one system; other tier-1 coverage remains outstanding.

Switches: RX_VK_PRESENT_GATE is added, defaulting on for NVIDIA proprietary drivers on Linux and off elsewhere; 0 disables it and 1 forces it on. Its table row is present, but broader default-on coverage is outstanding. HOS_FRAME_SKIP_TAIL retains its default of on and its saved key; its menu row moves to the developer page.

Reviewed: 48476edc40 against a2b7abf9ee: Read AGENTS.md, CONTRIBUTING.md, the pull request template, relevant standards, commit messages, the complete diff and the queue, hand-off, signal, idle-wait and device-creation code around the changes. Skimmed the changed policy test and related setting and frame-generation callers. The large changed source files and menu test were not read in full; no recorded runs or generated files were included in the diff. docs/review-checklist.md and the adjacent Tooling checkout were absent.; nothing run (a code review).

Checked and fine:

  • The new switch has a switches.def row, and the policy test covers its default and explicit values.
  • The changed setting retains its saved key and default.
  • The commits carry AI-assistance trailers, and the diff contains no game-derived files or generated outputs.
  • The reported runs provide repeated evidence of improved presentation pacing on the tested system.

Testing: No commands that build, execute project code or run tests were used. The author reports Linux game runs; CI is still running.

Overlaps and merge order: The description identifies #3287 as another approach to the same DLSS 1% low problem; its current status and merge order could not be checked offline.


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

**Recommendation: Request changes.** The gate can miss next-frame submissions and can leave the GPU waiting forever when its signal submission fails. Its idle-wait release also permits timeline signals to execute out of order. The change presents game frames on a second queue and holds subsequent replay work until presentation, improving reported frame pacing on the tested NVIDIA Linux system. It also moves Skip Upscaler Wait to the developer page; the synchronization and other supported configurations need further work. **Blocking (4)**: must change before merging. 1. **L1** `gpu/vk/vk_replay.cpp:7747`: The replay queue is unlocked before the gate value is published, so another submitting thread can enqueue next-frame work without the gate. *When:* After the frame copy is submitted, present_out unlocks present_mu before present_hand_off stores present_gate_pending. A recorder or replay submit that acquires the lock in that interval sees no pending value and runs ahead of the present, restoring the variable presentation delay this change is intended to prevent. **Do:** Publish the hand-off's gate value while holding the replay queue lock, after the copy submit and before any later submit can acquire that lock. 2. **L2** `gpu/vk/vk_replay.cpp:175`: The gate records a signal as completed before checking whether Vulkan accepted it, and a refused signal leaves its waiting replay submission blocked. (more on the line) **Do:** Handle signal submission failure with a safe retry or release/fatal path, and advance the bookkeeping only after a signal is successfully arranged. 3. **L3** `gpu/vk/vk_replay.cpp:179`: A CPU release can overtake an earlier signal already queued on the presenter queue, violating timeline semaphore signal ordering. (more on the line) **Do:** Coordinate CPU release with outstanding queue signals so every timeline signal executes in increasing order, without waiting while holding a lock needed by the presenter. 4. **L4** `gpu/vk/vk_replay.cpp:8137`: The semaphore handle is initialized without the lock used by the idle-wait path that reads it. (more on the line) **Do:** Create and publish the semaphore under the same synchronization used by readers, or initialize it before concurrent idle waits and submissions can begin. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L5** `gpu/vk/device_policy.h:839`: The default covers all NVIDIA proprietary Linux systems, while the repeated measurements cover one GPU, driver and Wayland configuration. (more on the line) **Do:** Run interleaved gate-on and gate-off comparisons on representative NVIDIA Linux tier-1 systems and window/present modes, including frame times and 1% lows. `@fix` can do L1, L2, L3 and L4. **Questions (3)** (not confirmed from the code; they don't hold the recommendation) - Does the second queue remain beneficial when Skip Upscaler Wait is off across the NVIDIA Linux systems that receive it by default? - Is the loss of the developer Present queue for frame generation on NVIDIA Linux intended for users who explicitly enabled that setting? - `tests/test_device_policy.py:439`: Is there a game-free behavioral test elsewhere that exercises the gate’s ordering and idle release? **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes, on the reported RTX 3090 Linux setup: two interleaved runs show Kokiri 1% lows of 80.1/79.1 fps with the gate off and 91.8/97.6 with it on, with average fps roughly unchanged. The reported present-interval p99 falls from 18.1 to 9.7 ms. The comparison uses the same head with the switch off, rather than a separate base build, and does not establish the effect across the default's other NVIDIA Linux configurations. **Other systems:** The default affects NVIDIA proprietary drivers on Linux, including different GPUs, window systems, present modes, caps and upscalers. The override can enable it on Windows, AMD and Intel. Frame generation's synchronous presents use the replay queue when the gate queue replaces the developer Present queue. The reported frame-generation, FIFO and capped runs are single runs on one system; other tier-1 coverage remains outstanding. **Switches:** RX_VK_PRESENT_GATE is added, defaulting on for NVIDIA proprietary drivers on Linux and off elsewhere; 0 disables it and 1 forces it on. Its table row is present, but broader default-on coverage is outstanding. HOS_FRAME_SKIP_TAIL retains its default of on and its saved key; its menu row moves to the developer page. **Reviewed:** 48476edc40a8 against a2b7abf9ee15: Read AGENTS.md, CONTRIBUTING.md, the pull request template, relevant standards, commit messages, the complete diff and the queue, hand-off, signal, idle-wait and device-creation code around the changes. Skimmed the changed policy test and related setting and frame-generation callers. The large changed source files and menu test were not read in full; no recorded runs or generated files were included in the diff. docs/review-checklist.md and the adjacent Tooling checkout were absent.; nothing run (a code review). **Checked and fine:** - The new switch has a switches.def row, and the policy test covers its default and explicit values. - The changed setting retains its saved key and default. - The commits carry AI-assistance trailers, and the diff contains no game-derived files or generated outputs. - The reported runs provide repeated evidence of improved presentation pacing on the tested system. **Testing:** No commands that build, execute project code or run tests were used. The author reports Linux game runs; CI is still running. **Overlaps and merge order:** The description identifies #3287 as another approach to the same DLSS 1% low problem; its current status and merge order could not be checked offline. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -828,6 +836,7 @@ inline DevicePolicy device_policy(const DeviceFacts& f) {
p.gpu_clock_peak = f.amd() && f.deck_apu();
p.readback_late_newest = f.handheld();
p.acquire_ahead = true; // (every driver; not under frame generation or FIFO: vk_replay.cpp acquire_ahead_wanted)
p.present_gate = !f.windows && f.driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY;
Member

L5 (should fix): The default covers all NVIDIA proprietary Linux systems, while the repeated measurements cover one GPU, driver and Wayland configuration.

When: A player using another supported NVIDIA generation, driver, window system or pacing mode receives the gate by default, but the reported runs do not show its frame pacing or cost there.

Do: Run interleaved gate-on and gate-off comparisons on representative NVIDIA Linux tier-1 systems and window/present modes, including frame times and 1% lows.

**L5** (should fix): The default covers all NVIDIA proprietary Linux systems, while the repeated measurements cover one GPU, driver and Wayland configuration. *When:* A player using another supported NVIDIA generation, driver, window system or pacing mode receives the gate by default, but the reported runs do not show its frame pacing or cost there. **Do:** Run interleaved gate-on and gate-off comparisons on representative NVIDIA Linux tier-1 systems and window/present modes, including frame times and 1% lows.
@ -155,0 +172,4 @@
/// an idle-wait for every value handed over (present_gate_release_locked). A timeline's values only go up
void present_gate_signal_locked(uint64_t v, bool from_cpu) {
if (!present_gate || v <= present_gate_upto) return;
present_gate_upto = v;
Member

L2 (blocking): The gate records a signal as completed before checking whether Vulkan accepted it, and a refused signal leaves its waiting replay submission blocked.

When: If vkQueueSubmit2 for the presenter's signal returns an out-of-memory error, the code logs the error but leaves present_gate_upto at that value. The replay queue waits for a value that was never signalled, and the idle-wait release skips that value, so the game can freeze permanently.

Do: Handle signal submission failure with a safe retry or release/fatal path, and advance the bookkeeping only after a signal is successfully arranged.

**L2** (blocking): The gate records a signal as completed before checking whether Vulkan accepted it, and a refused signal leaves its waiting replay submission blocked. *When:* If vkQueueSubmit2 for the presenter's signal returns an out-of-memory error, the code logs the error but leaves present_gate_upto at that value. The replay queue waits for a value that was never signalled, and the idle-wait release skips that value, so the game can freeze permanently. **Do:** Handle signal submission failure with a safe retry or release/fatal path, and advance the bookkeeping only after a signal is successfully arranged.
@ -155,0 +176,4 @@
VkResult r;
if (from_cpu) {
VkSemaphoreSignalInfo si{VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO};
si.semaphore = present_gate, si.value = v;
Member

L3 (blocking): A CPU release can overtake an earlier signal already queued on the presenter queue, violating timeline semaphore signal ordering.

When: The presenter submits a signal for frame N, then frame N+1 is handed over before that signal executes. An effect or frame-generation change enters device_wait_idle_locked and signals N+1 from the CPU; the still-pending GPU signal for N can then execute against a semaphore already at N+1.

Do: Coordinate CPU release with outstanding queue signals so every timeline signal executes in increasing order, without waiting while holding a lock needed by the presenter.

**L3** (blocking): A CPU release can overtake an earlier signal already queued on the presenter queue, violating timeline semaphore signal ordering. *When:* The presenter submits a signal for frame N, then frame N+1 is handed over before that signal executes. An effect or frame-generation change enters device_wait_idle_locked and signals N+1 from the CPU; the still-pending GPU signal for N can then execute against a semaphore already at N+1. **Do:** Coordinate CPU release with outstanding queue signals so every timeline signal executes in increasing order, without waiting while holding a lock needed by the presenter.
@ -8053,0 +8134,4 @@
ti.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE;
VkSemaphoreCreateInfo ci{VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO};
ci.pNext = &ti;
if (vkCreateSemaphore(dev.device, &ci, nullptr, &present_gate) != VK_SUCCESS) present_gate = VK_NULL_HANDLE;
Member

L4 (blocking): The semaphore handle is initialized without the lock used by the idle-wait path that reads it.

When: On the first hand-off, vkCreateSemaphore writes present_gate while another thread enters device_wait_idle_locked and present_gate_release_locked reads that plain handle under present_queue_mu. The writer does not hold that mutex, so these accesses race even when no value has yet been handed over.

Do: Create and publish the semaphore under the same synchronization used by readers, or initialize it before concurrent idle waits and submissions can begin.

**L4** (blocking): The semaphore handle is initialized without the lock used by the idle-wait path that reads it. *When:* On the first hand-off, vkCreateSemaphore writes present_gate while another thread enters device_wait_idle_locked and present_gate_release_locked reads that plain handle under present_queue_mu. The writer does not hold that mutex, so these accesses race even when no value has yet been handed over. **Do:** Create and publish the semaphore under the same synchronization used by readers, or initialize it before concurrent idle waits and submissions can begin.
HumanBean changed title from WIP: fix(vk): with NVIDIA's driver on Linux each frame is presented before the next frame's work runs (RX_VK_PRESENT_GATE=0 to disable) to fix(vk): with NVIDIA's driver on Linux each frame is presented before the next frame's work runs (RX_VK_PRESENT_GATE=0 to disable) 2026-12-06 02:12:25 +00:00
Author
Owner

Rebased from main de091ae2 onto 0b284cc7: the numbers still hold. The commits in between (#3299, #3297, #3289, #3294, #3280, #3288) change the website, input, the menu, UI, content and the fog rows: none touches gpu/vk's present path, the presenter or the queues. The rebased head compiles on Linux, test_device_policy, test_menu_ini_keys and test_upscaler_rows pass, and a windowed smoke run passed with the gate on.

Rebased from main de091ae2 onto 0b284cc7: the numbers still hold. The commits in between (#3299, #3297, #3289, #3294, #3280, #3288) change the website, input, the menu, UI, content and the fog rows: none touches gpu/vk's present path, the presenter or the queues. The rebased head compiles on Linux, test_device_policy, test_menu_ini_keys and test_upscaler_rows pass, and a windowed smoke run passed with the gate on.
BeanBot left a comment

Recommendation: Request changes. The gate can miss a replay submission, leave a submission blocked after a refused signal, and violate timeline semaphore ordering. Its handle also has an unsynchronized initialization and read.

The change aims to smooth NVIDIA Linux presentation by gating the next frame’s GPU work until the current present is made. It adds a second queue and cross-thread semaphore coordination, whose correctness issues currently outweigh the measured gain.

Blocking (4): must change before merging.

  1. L1 gpu/vk/vk_replay.cpp:7747: The replay queue is unlocked before the gate value is published, so another submitting thread can enqueue next-frame work without the gate. When: After the frame copy is submitted, present_out unlocks present_mu before present_hand_off stores present_gate_pending. A recorder or replay submit that acquires the lock in that interval sees no pending value and runs ahead of the present, restoring the variable presentation delay this change is intended to prevent. Do: Publish the hand-off's gate value while holding the replay queue lock, after the copy submit and before any later submit can acquire that lock.
  2. L2 gpu/vk/vk_replay.cpp:175: The gate records a signal as completed before checking whether Vulkan accepted it, and a refused signal leaves its waiting replay submission blocked. When: If vkQueueSubmit2 for the presenter's signal returns an out-of-memory error, the code logs the error but leaves present_gate_upto at that value. The replay queue waits for a value that was never signalled, and the idle-wait release skips that value, so the game can freeze permanently. Do: Handle signal submission failure with a safe retry or release/fatal path, and advance the bookkeeping only after a signal is successfully arranged.
  3. L3 gpu/vk/vk_replay.cpp:179: A CPU release can overtake an earlier signal already queued on the presenter queue, violating timeline semaphore signal ordering. When: The presenter submits a signal for frame N, then frame N+1 is handed over before that signal executes. An effect or frame-generation change enters device_wait_idle_locked and signals N+1 from the CPU; the still-pending GPU signal for N can then execute against a semaphore already at N+1. Do: Coordinate CPU release with outstanding queue signals so every timeline signal executes in increasing order, without waiting while holding a lock needed by the presenter.
  4. L4 gpu/vk/vk_replay.cpp:8137: The semaphore handle is initialized without the lock used by the idle-wait path that reads it. When: On the first hand-off, vkCreateSemaphore writes present_gate while another thread enters device_wait_idle_locked and present_gate_release_locked reads that plain handle under present_queue_mu. The writer does not hold that mutex, so these accesses race even when no value has yet been handed over. Do: Create and publish the semaphore under the same synchronization used by readers, or initialize it before concurrent idle waits and submissions can begin.

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

  • L5 gpu/vk/device_policy.h:839: The default covers all NVIDIA proprietary Linux systems, while the repeated measurements cover one GPU, driver and Wayland configuration. When: A player using another supported NVIDIA generation, driver, window system or pacing mode receives the gate by default, but the reported runs do not show its frame pacing or cost there. Do: Run interleaved gate-on and gate-off comparisons on representative NVIDIA Linux tier-1 systems and window/present modes, including frame times and 1% lows.

@fix can do L1, L2, L3 and L4.

Since the last review (on 48476edc40)
Still open: L1 (The replay queue is unlocked before the gate value is published, so another submitting thr…); L2 (The gate records a signal as completed before checking whether Vulkan accepted it, and a r…); L3 (A CPU release can overtake an earlier signal already queued on the presenter queue, violat…); L4 (The semaphore handle is initialized without the lock used by the idle-wait path that reads…); L5 (The default covers all NVIDIA proprietary Linux systems, while the repeated measurements c…)

Checks: Still running: 11 checks.

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

Does it help: Yes, on the tested RTX 3090 Linux Wayland setup: two interleaved pairs report Kokiri 1% lows of 79.1–80.1 fps off versus 91.8–97.6 fps on, with average fps approximately unchanged; measured present-interval p99 fell from 18.1 to 9.7 ms. Other NVIDIA Linux configurations remain unmeasured.

Other systems: The gate defaults on for NVIDIA Linux and can be forced on elsewhere; queue availability, drivers, window systems, frame generation and idle waits can affect its behavior. The reported smoke run covers one Linux NVIDIA configuration; Windows and other hardware runs remain outstanding.

Switches: RX_VK_PRESENT_GATE is added: it defaults on for NVIDIA Linux and off elsewhere, with 0 disabling and 1 enabling it. The tested default helps on one configuration, but its effect across the default-on population remains unproven. Skip Upscaler Wait moves to the developer page; its default remains on and its saved key is unchanged.

Reviewed: 48476edc40 against a2b7abf9ee: Read the repository rules, PR template, standards, replay gate diff and surrounding hand-off and signal paths; skimmed the remaining diff and reported measurements. Did not read every changed code file in full. Tooling’s AGENTS.md was unavailable locally; docs/review-checklist.md is absent.; nothing run (a code review).

Checked and fine:

  • The gate switch has a switches.def row.
  • The reported Linux smoke run exercised the gate on its own queue.
  • The moved menu setting retains its saved key and default.

Testing: No commands that build, run tests or execute project code were run. The supplied CI checks are still running; the PR reports a Linux build, game-free checks and an in-game smoke run.

Overlaps and merge order: Not determined from the supplied information.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as HumanBean took it out of WIP. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The gate can miss a replay submission, leave a submission blocked after a refused signal, and violate timeline semaphore ordering. Its handle also has an unsynchronized initialization and read. The change aims to smooth NVIDIA Linux presentation by gating the next frame’s GPU work until the current present is made. It adds a second queue and cross-thread semaphore coordination, whose correctness issues currently outweigh the measured gain. **Blocking (4)**: must change before merging. 1. **L1** `gpu/vk/vk_replay.cpp:7747`: The replay queue is unlocked before the gate value is published, so another submitting thread can enqueue next-frame work without the gate. *When:* After the frame copy is submitted, present_out unlocks present_mu before present_hand_off stores present_gate_pending. A recorder or replay submit that acquires the lock in that interval sees no pending value and runs ahead of the present, restoring the variable presentation delay this change is intended to prevent. **Do:** Publish the hand-off's gate value while holding the replay queue lock, after the copy submit and before any later submit can acquire that lock. 2. **L2** `gpu/vk/vk_replay.cpp:175`: The gate records a signal as completed before checking whether Vulkan accepted it, and a refused signal leaves its waiting replay submission blocked. *When:* If vkQueueSubmit2 for the presenter's signal returns an out-of-memory error, the code logs the error but leaves present_gate_upto at that value. The replay queue waits for a value that was never signalled, and the idle-wait release skips that value, so the game can freeze permanently. **Do:** Handle signal submission failure with a safe retry or release/fatal path, and advance the bookkeeping only after a signal is successfully arranged. 3. **L3** `gpu/vk/vk_replay.cpp:179`: A CPU release can overtake an earlier signal already queued on the presenter queue, violating timeline semaphore signal ordering. *When:* The presenter submits a signal for frame N, then frame N+1 is handed over before that signal executes. An effect or frame-generation change enters device_wait_idle_locked and signals N+1 from the CPU; the still-pending GPU signal for N can then execute against a semaphore already at N+1. **Do:** Coordinate CPU release with outstanding queue signals so every timeline signal executes in increasing order, without waiting while holding a lock needed by the presenter. 4. **L4** `gpu/vk/vk_replay.cpp:8137`: The semaphore handle is initialized without the lock used by the idle-wait path that reads it. *When:* On the first hand-off, vkCreateSemaphore writes present_gate while another thread enters device_wait_idle_locked and present_gate_release_locked reads that plain handle under present_queue_mu. The writer does not hold that mutex, so these accesses race even when no value has yet been handed over. **Do:** Create and publish the semaphore under the same synchronization used by readers, or initialize it before concurrent idle waits and submissions can begin. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L5** `gpu/vk/device_policy.h:839`: The default covers all NVIDIA proprietary Linux systems, while the repeated measurements cover one GPU, driver and Wayland configuration. *When:* A player using another supported NVIDIA generation, driver, window system or pacing mode receives the gate by default, but the reported runs do not show its frame pacing or cost there. **Do:** Run interleaved gate-on and gate-off comparisons on representative NVIDIA Linux tier-1 systems and window/present modes, including frame times and 1% lows. `@fix` can do L1, L2, L3 and L4. **Since the last review** (on 48476edc40a8) Still open: L1 (The replay queue is unlocked before the gate value is published, so another submitting thr…); L2 (The gate records a signal as completed before checking whether Vulkan accepted it, and a r…); L3 (A CPU release can overtake an earlier signal already queued on the presenter queue, violat…); L4 (The semaphore handle is initialized without the lock used by the idle-wait path that reads…); L5 (The default covers all NVIDIA proprietary Linux systems, while the repeated measurements c…) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes, on the tested RTX 3090 Linux Wayland setup: two interleaved pairs report Kokiri 1% lows of 79.1–80.1 fps off versus 91.8–97.6 fps on, with average fps approximately unchanged; measured present-interval p99 fell from 18.1 to 9.7 ms. Other NVIDIA Linux configurations remain unmeasured. **Other systems:** The gate defaults on for NVIDIA Linux and can be forced on elsewhere; queue availability, drivers, window systems, frame generation and idle waits can affect its behavior. The reported smoke run covers one Linux NVIDIA configuration; Windows and other hardware runs remain outstanding. **Switches:** RX_VK_PRESENT_GATE is added: it defaults on for NVIDIA Linux and off elsewhere, with 0 disabling and 1 enabling it. The tested default helps on one configuration, but its effect across the default-on population remains unproven. Skip Upscaler Wait moves to the developer page; its default remains on and its saved key is unchanged. **Reviewed:** 48476edc40a8 against a2b7abf9ee15: Read the repository rules, PR template, standards, replay gate diff and surrounding hand-off and signal paths; skimmed the remaining diff and reported measurements. Did not read every changed code file in full. Tooling’s AGENTS.md was unavailable locally; docs/review-checklist.md is absent.; nothing run (a code review). **Checked and fine:** - The gate switch has a switches.def row. - The reported Linux smoke run exercised the gate on its own queue. - The moved menu setting retains its saved key and default. **Testing:** No commands that build, run tests or execute project code were run. The supplied CI checks are still running; the PR reports a Linux build, game-free checks and an in-game smoke run. **Overlaps and merge order:** Not determined from the supplied information. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as HumanBean took it out of WIP. Nothing was run; a maintainer decides.</sub>
Author
Owner

@Beanstalk Measure RX_VK_PRESENT_GATE=1 against it unset on Windows NVIDIA (an RTX 40 or 50 card), AMD on Windows and on Linux, and Intel Arc on Windows: Kokiri Forest and the Market standing still, 4K output with DLSS (or FSR 4 / XeSS on AMD and Intel) from 1080p, V-Sync off, uncapped, two interleaved pairs each. Report fps, 1% low and p99, and the log's 'vk: the present gate: on' line on the =1 side. We want to know where it raises the 1% low without lowering fps, to choose where it is on by default.

@Beanstalk Measure RX_VK_PRESENT_GATE=1 against it unset on Windows NVIDIA (an RTX 40 or 50 card), AMD on Windows and on Linux, and Intel Arc on Windows: Kokiri Forest and the Market standing still, 4K output with DLSS (or FSR 4 / XeSS on AMD and Intel) from 1080p, V-Sync off, uncapped, two interleaved pairs each. Report fps, 1% low and p99, and the log's 'vk: the present gate: on' line on the =1 side. We want to know where it raises the 1% low without lowering fps, to choose where it is on by default.
Member
Beanstalk test farm · an earlier run: commit 48476ed (the newer results are in a comment below)

Commit 48476ed · approved by HumanBean (reviewed) · dashboard

⚠️ Note: The requested AMD and Intel upscaler runs cannot share the NVIDIA SDK build in this plan; FSR 4 and XeSS each require their own build configuration.
⚠️ Note: Linux presentation cannot be measured because window scenarios are Windows-only; the plan also cannot measure actual present intervals or prove the synchronization race and signal-failure paths safe.

Started.

Estimate: done in about 1 h, from the queue and the testers online now; some jobs can't start yet.

Target Result Reports Frame time p99 (ms), switch off → switch on VRAM peak (MB) Crashes
windows+nvidia+window+dlss+gpu-rtx-40xx_rtx-50xx (GPU "rtx 40xx" or "rtx 50xx") ⏳ queued 0 of 1 — — —
What was tested

What will be tested · AI plan (gpt-6.1-terra)

On Windows RTX 40- and 50-series PCs, compare the present gate enabled against its default-off state in Kokiri Forest and the Market, standing still for 45 seconds per place. Two interleaved pairs use 4K DLSS from 1080p, V-Sync off and an uncapped frame rate, reporting FPS, 1% low and p99 frame time. The test fails for a crash, a missing gate-on log line, or a frame-time or FPS regression beyond 15%.

  • Where: windows+nvidia+window+dlss+gpu-rtx-40xx_rtx-50xx (GPU "rtx 40xx" or "rtx 50xx", 1-2 reports).
  • Against: the PR itself, switch on (RX_VK_PRESENT_GATE) and off; main is not built or run.
  • Upscaler: the PR built with NVIDIA DLSS's SDK, on testers who accepted its license.
  • Matrix: 1 cell, each with the switch on and off: RX_VK_PRESENT_GATE 1 (PR only).
  • gate-present: from the repository's save kokiri-start (settings dlss=1, vsync=2, resolution=4, frame_rate_cap=6, quality_preset=0; switches HOS_OUTPUT_RES=3840x2160, RX_VK_AUTO_TUNE=0; in a hidden window (the present path runs)), then teleport to Kokiri Forest, measure kokiri for 45 s (after 10 s warm-up), teleport to Market, measure market for 45 s (after 10 s warm-up); 2 runs on each side.
  • Measured: crashes, frame times, stutters and hitches, draws and frame rate, the game's log.
  • The PR fails if: it crashes; or frame rate is more than 15% below main; or frame time (p99) is more than 15% above main; or expected log lines missing is above 0; or frame time (worst 1%) is more than 15% above main.
  • Time: about 28 min of game runs per tester (4 game starts), plus the two builds.
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>48476ed</code> (the newer results are in a comment below)</summary> Commit `48476ed` · approved by HumanBean (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/3298) ⚠️ **Note:** The requested AMD and Intel upscaler runs cannot share the NVIDIA SDK build in this plan; FSR 4 and XeSS each require their own build configuration. ⚠️ **Note:** Linux presentation cannot be measured because window scenarios are Windows-only; the plan also cannot measure actual present intervals or prove the synchronization race and signal-failure paths safe. Started. **Estimate:** done in about 1 h, from the queue and the testers online now; some jobs can't start yet. | Target | Result | Reports | Frame time p99 (ms), switch off → switch on | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `windows+nvidia+window+dlss+gpu-rtx-40xx_rtx-50xx` (GPU "rtx 40xx" or "rtx 50xx") | ⏳ queued | 0 of 1 | — | — | — | <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) On Windows RTX 40- and 50-series PCs, compare the present gate enabled against its default-off state in Kokiri Forest and the Market, standing still for 45 seconds per place. Two interleaved pairs use 4K DLSS from 1080p, V-Sync off and an uncapped frame rate, reporting FPS, 1% low and p99 frame time. The test fails for a crash, a missing gate-on log line, or a frame-time or FPS regression beyond 15%. - **Where:** windows+nvidia+window+dlss+gpu-rtx-40xx_rtx-50xx (GPU "rtx 40xx" or "rtx 50xx", 1-2 reports). - **Against:** the PR itself, switch on (`RX_VK_PRESENT_GATE`) and off; main is not built or run. - **Upscaler:** the PR built with NVIDIA DLSS's SDK, on testers who accepted its license. - **Matrix:** 1 cell, each with the switch on and off: RX_VK_PRESENT_GATE `1` (PR only). - **gate-present:** from the repository's save `kokiri-start` (settings dlss=1, vsync=2, resolution=4, frame_rate_cap=6, quality_preset=0; switches `HOS_OUTPUT_RES=3840x2160`, `RX_VK_AUTO_TUNE=0`; in a hidden window (the present path runs)), then teleport to Kokiri Forest, measure kokiri for 45 s (after 10 s warm-up), teleport to Market, measure market for 45 s (after 10 s warm-up); 2 runs on each side. - **Measured:** crashes, frame times, stutters and hitches, draws and frame rate, the game's log. - **The PR fails if:** it crashes; or frame rate is more than 15% below main; or frame time (p99) is more than 15% above main; or expected log lines missing is above 0; or frame time (worst 1%) is more than 15% above main. - **Time:** about 28 min of game runs per tester (4 game starts), plus the two builds. </details> </details>
fix(vk): the present gate is armed under the replay queue's lock, and its signals run in order and never go missing
Some checks are pending
PR description / Title and description (pull_request_target) Waiting to run
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 / 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
beanstalk/approval not approved yet
b80606776c
From the review of #3298: the gate's value was published after the replay queue's
lock was let go, so a submit from another thread could slip in ungated; a refused
signal was counted as made; an idle-wait's CPU signal could overtake a signal
still queued; and the semaphore was made without the lock its readers hold.
present_gate_arm now publishes the value before the lock is let go and makes the
semaphore under the presents' queue lock; every signal goes on the presents' queue
in increasing order, and one refused is signalled from the CPU once that queue is
idle (refused again: the device is taken as lost).

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

Beanstalk test farm

Commit b806067 · approved by nobody yet · dashboard

A member of BigBeans can review this commit and comment @Beanstalk to test it.

<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `b806067` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/3298) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
Author
Owner

Thanks: L1 to L4 were real, all fixed in b8060677 (compiled on Linux, test_device_policy passes, a windowed smoke run passed with the gate on).

  • L1: present_gate_arm publishes the gate's value while dev.present_mu is still held after the copy's submit, before qk.unlock(); present_hand_off takes the value as an argument. No submit can come between the copy and the gate.
  • L2: present_gate_upto moves only once the signal is queued or made. A refused queue signal waits for the presents' queue to go idle (its earlier signals done) and signals from the CPU; refused again, device_lost with the reason.
  • L3: every signal of the gate, the idle-wait's release included, now goes on the presents' queue under its lock, so they run in increasing order. The release still ends the idle-wait: nothing on that queue is gated.
  • L4: the semaphore is made in present_gate_arm under dev.present_queue_mu, the lock present_gate_release_locked reads it under; the replay's submits read it only after the seq_cst store of a pending value made after it.

L5: agreed it needs more NVIDIA Linux systems. This PC is the only one here, and the Test Farm's window scenarios are Windows-only, so it stays in Still to test; RX_VK_PRESENT_GATE=0 is the way back.

Questions:

  • Skip Upscaler Wait off: measured here once, the same within noise (94.5 against 94.6 fps). Without the skip the next frame's work is rarely ahead of the present, so the gate holds nothing then.
  • The Present queue row with the gate on: intended. The row's compute queue could not present to a Wayland window with NVIDIA's driver here (the log said so and fell back to the replay's queue), so on these PCs it did nothing; frame generation's presents stay on the replay's queue as they did.
  • A game-free test of the ordering: none; it needs a GPU. The windowed smoke run and the A/B runs exercise it.
Thanks: L1 to L4 were real, all fixed in b8060677 (compiled on Linux, `test_device_policy` passes, a windowed smoke run passed with the gate on). - **L1:** `present_gate_arm` publishes the gate's value while `dev.present_mu` is still held after the copy's submit, before `qk.unlock()`; `present_hand_off` takes the value as an argument. No submit can come between the copy and the gate. - **L2:** `present_gate_upto` moves only once the signal is queued or made. A refused queue signal waits for the presents' queue to go idle (its earlier signals done) and signals from the CPU; refused again, `device_lost` with the reason. - **L3:** every signal of the gate, the idle-wait's release included, now goes on the presents' queue under its lock, so they run in increasing order. The release still ends the idle-wait: nothing on that queue is gated. - **L4:** the semaphore is made in `present_gate_arm` under `dev.present_queue_mu`, the lock `present_gate_release_locked` reads it under; the replay's submits read it only after the seq_cst store of a pending value made after it. **L5:** agreed it needs more NVIDIA Linux systems. This PC is the only one here, and the Test Farm's window scenarios are Windows-only, so it stays in Still to test; `RX_VK_PRESENT_GATE=0` is the way back. Questions: - Skip Upscaler Wait off: measured here once, the same within noise (94.5 against 94.6 fps). Without the skip the next frame's work is rarely ahead of the present, so the gate holds nothing then. - The Present queue row with the gate on: intended. The row's compute queue could not present to a Wayland window with NVIDIA's driver here (the log said so and fell back to the replay's queue), so on these PCs it did nothing; frame generation's presents stay on the replay's queue as they did. - A game-free test of the ordering: none; it needs a GPU. The windowed smoke run and the A/B runs exercise it.
Author
Owner
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The gate improves frame pacing on the tested NVIDIA Linux system, and the four code fixes address their ledger cases. Broader testing is still needed for a default that covers NVIDIA Linux systems generally. Recommend approval; not approved on the forge.

The change presents game frames on a separate queue and gates subsequent GPU work to reduce uneven present intervals. It adds queue and semaphore synchronization, plus a developer override.

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

  • L5 gpu/vk/device_policy.h:839: The default covers all NVIDIA proprietary Linux systems, while the repeated measurements cover one GPU, driver and Wayland configuration. When: A player using another supported NVIDIA generation, driver, window system or pacing mode receives the gate by default, but the reported runs do not show its frame pacing or cost there. Do: Run interleaved gate-on and gate-off comparisons on representative NVIDIA Linux tier-1 systems and window/present modes, including frame times and 1% lows.

Since the last review (on 48476edc40)
Resolved: L1 (The replay queue is unlocked before the gate value is published, so another submitting thr…); L2 (The gate records a signal as completed before checking whether Vulkan accepted it, and a r…); L3 (A CPU release can overtake an earlier signal already queued on the presenter queue, violat…); L4 (The semaphore handle is initialized without the lock used by the idle-wait path that reads…)
Still open: L5 (The default covers all NVIDIA proprietary Linux systems, while the repeated measurements c…)

Checks: Still running: 11 checks.

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

Does it help: Yes, on the tested RTX 3090 Linux Wayland setup: two interleaved pairs showed Kokiri 1% lows rising from 79.1–80.1 to 91.8–97.6 fps, with similar average fps. The comparison used the PR build with the gate disabled as the baseline; broader default-on results are missing.

Other systems: The gate defaults off on Windows and non-NVIDIA drivers, but can be forced on there. Frame generation, FIFO, a frame cap and Skip Upscaler Wait off each have one run per side on the tested Linux PC; broader coverage remains outstanding.

Switches: RX_VK_PRESENT_GATE is added: on by default with NVIDIA's proprietary Linux driver and off elsewhere; 0 disables it and 1 enables it. The default helped on the tested system, but its broader NVIDIA Linux coverage remains unverified. Skip Upscaler Wait moves to the developer page and keeps its existing default and saved key.

Reviewed: b80606776c against a2b7abf9ee: Read AGENTS.md, CONTRIBUTING.md, the fix diff, the gate and presenter paths, the idle-wait and submission references, and the supplied runs and comments. Skimmed the overall diff; the large changed code files and all repository review rules were not read in full.; nothing run (a code review).

Checked and fine:

  • The fix preserves the gate and its separate present queue.
  • The presenter signals the handed-over value after a present and also on paths where the present is not made.

Testing: The author reports a Linux compile, policy test and windowed smoke run on the fixed head. CI is still running; no commands from the project were executed for this review.

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


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

**Recommendation: Approve.** The code is ready: only testing is left. The gate improves frame pacing on the tested NVIDIA Linux system, and the four code fixes address their ledger cases. Broader testing is still needed for a default that covers NVIDIA Linux systems generally. Recommend approval; not approved on the forge. The change presents game frames on a separate queue and gates subsequent GPU work to reduce uneven present intervals. It adds queue and semaphore synchronization, plus a developer override. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L5** `gpu/vk/device_policy.h:839`: The default covers all NVIDIA proprietary Linux systems, while the repeated measurements cover one GPU, driver and Wayland configuration. *When:* A player using another supported NVIDIA generation, driver, window system or pacing mode receives the gate by default, but the reported runs do not show its frame pacing or cost there. **Do:** Run interleaved gate-on and gate-off comparisons on representative NVIDIA Linux tier-1 systems and window/present modes, including frame times and 1% lows. **Since the last review** (on 48476edc40a8) Resolved: L1 (The replay queue is unlocked before the gate value is published, so another submitting thr…); L2 (The gate records a signal as completed before checking whether Vulkan accepted it, and a r…); L3 (A CPU release can overtake an earlier signal already queued on the presenter queue, violat…); L4 (The semaphore handle is initialized without the lock used by the idle-wait path that reads…) Still open: L5 (The default covers all NVIDIA proprietary Linux systems, while the repeated measurements c…) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes, on the tested RTX 3090 Linux Wayland setup: two interleaved pairs showed Kokiri 1% lows rising from 79.1–80.1 to 91.8–97.6 fps, with similar average fps. The comparison used the PR build with the gate disabled as the baseline; broader default-on results are missing. **Other systems:** The gate defaults off on Windows and non-NVIDIA drivers, but can be forced on there. Frame generation, FIFO, a frame cap and Skip Upscaler Wait off each have one run per side on the tested Linux PC; broader coverage remains outstanding. **Switches:** RX_VK_PRESENT_GATE is added: on by default with NVIDIA's proprietary Linux driver and off elsewhere; 0 disables it and 1 enables it. The default helped on the tested system, but its broader NVIDIA Linux coverage remains unverified. Skip Upscaler Wait moves to the developer page and keeps its existing default and saved key. **Reviewed:** b80606776ca1 against a2b7abf9ee15: Read AGENTS.md, CONTRIBUTING.md, the fix diff, the gate and presenter paths, the idle-wait and submission references, and the supplied runs and comments. Skimmed the overall diff; the large changed code files and all repository review rules were not read in full.; nothing run (a code review). **Checked and fine:** - The fix preserves the gate and its separate present queue. - The presenter signals the handed-over value after a present and also on paths where the present is not made. **Testing:** The author reports a Linux compile, policy test and windowed smoke run on the fixed head. CI is still running; no commands from the project were executed for this review. **Overlaps and merge order:** Not checked; network access is unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch fix/present-gate 2026-12-06 02:46:39 +00:00
Member

Tested on Windows 11, RTX 5080, NVIDIA 621.47: this PR's head 48476edc, one build, RX_VK_PRESENT_GATE=1 against unset, dev.py ab interleaved, 45 s each after warm-up. 4K output, DLSS from 1080p, Reflex On, V-Sync Off, uncapped, windowed. Every =1 run logged vk: the present gate: on and the second-queue line. No errors, no device lost.

1% low, unset → =1 (median, range) fps, unset → =1 (median)
Kokiri Forest, 6 pairs 120.9 (94.6–133.4) → 115.9 (104.8–117.4) 160.7 → 154.9
Market, 3 pairs 76.9 (76.5–77.4) → 78.6 (75.9–81.6) 113.7 → 110.8
Kokiri, V-Sync On (FIFO), 2 pairs 105.0 → 104.7 163.1 → 156.7

p99: Kokiri 8.27 → 8.63 ms, Market 13.01 → 12.72 ms.

For Windows + NVIDIA: no 1% low gain, and 3–4% fewer fps in Kokiri (=1 lower in 5 of 6 pairs and in both V-Sync pairs). The Market difference is within the spread. With =1 the Kokiri 1% low varied less between runs but stayed below unset's. From this PC, I'd keep it off on Windows NVIDIA.

Tested on Windows 11, RTX 5080, NVIDIA 621.47: this PR's head 48476edc, one build, `RX_VK_PRESENT_GATE=1` against unset, `dev.py ab` interleaved, 45 s each after warm-up. 4K output, DLSS from 1080p, Reflex On, V-Sync Off, uncapped, windowed. Every `=1` run logged `vk: the present gate: on` and the second-queue line. No errors, no device lost. | | 1% low, unset → =1 (median, range) | fps, unset → =1 (median) | |---|---|---| | Kokiri Forest, 6 pairs | 120.9 (94.6–133.4) → 115.9 (104.8–117.4) | 160.7 → 154.9 | | Market, 3 pairs | 76.9 (76.5–77.4) → 78.6 (75.9–81.6) | 113.7 → 110.8 | | Kokiri, V-Sync On (FIFO), 2 pairs | 105.0 → 104.7 | 163.1 → 156.7 | p99: Kokiri 8.27 → 8.63 ms, Market 13.01 → 12.72 ms. For Windows + NVIDIA: no 1% low gain, and 3–4% fewer fps in Kokiri (`=1` lower in 5 of 6 pairs and in both V-Sync pairs). The Market difference is within the spread. With `=1` the Kokiri 1% low varied less between runs but stayed below unset's. From this PC, I'd keep it off on Windows NVIDIA.
Member

A note on the runs above: another task's builds and one game run on this PC went through the job queue between my timed runs (9 times, never during one). The queue's load check (CPU, memory, disk) only works on Linux, so these runs have no record of how busy the PC was, and anything outside the queue would not show. The widest swing was on the unset side in Kokiri (1% low 94.6 to 133.4); its lowest run started 5 s after one of those builds ended. Nothing else ran between the two V-Sync pairs. I'd read the 1% low result (no gain) as solid and the 3–4% fps drop as less certain.

A note on the runs above: another task's builds and one game run on this PC went through the job queue between my timed runs (9 times, never during one). The queue's load check (CPU, memory, disk) only works on Linux, so these runs have no record of how busy the PC was, and anything outside the queue would not show. The widest swing was on the unset side in Kokiri (1% low 94.6 to 133.4); its lowest run started 5 s after one of those builds ended. Nothing else ran between the two V-Sync pairs. I'd read the 1% low result (no gain) as solid and the 3–4% fps drop as less certain.
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!3298
No description provided.