fix(vk): the swapchain's image is waited for on the CPU, so a window behind another one no longer stops the GPU's work #1458

Merged
HumanBean merged 2 commits from HumanBean/Longshot:fix/present-acquire-fence into main 2026-11-17 20:18:29 +00:00
Owner

Type: fix · Risk: medium · Tested on: Linux, RTX 3090 (no regression; the bug itself is AMD on Windows) · Needs: Windows, AMD RDNA 4 / RDNA 3 / Radeon 8060S (Test Farm)

Why

On AMD's Windows driver the game ends with "the GPU hung: no submission finished in 30 s, and the driver never reported the device lost" a few seconds after the fullscreen game window goes behind another window: Alt+Tab to a browser (#1376, #316), OBS in front while streaming (#1355), or the game started from the launcher with another window in front (#1391, #1429). No TDR, the driver does not restart: the GPU is not running anything, its queue is waiting.

The cause is in present_image: the copy into the swapchain image waited on the GPU for the acquire's semaphore, on the same queue every submission of the game's work goes to. AMD's Windows driver returns from vkAcquireNextImageKHR at once and leaves the whole wait to that semaphore. While the window is hidden the system gives the image back late or never, so every later submission of the game waits behind the copy, and the hang watch ends the game 30 s later. The watch's own comment already named the case ("A window the system stops presenting can hold the queue that long as well"). NVIDIA's driver waits inside the acquire on the CPU instead, which is why only AMD hits it.

Fixes #1376
Fixes #316
See #1355, #1391, #1429 (same signature: AMD Windows driver, fullscreen, window behind another one, timeline stopped a few submissions short, empty device fault)

How to reproduce

Seen on: Windows 11, AMD Radeon RX 9070 XT, AMD driver 26.10.1 / 26.11.1 (LLPC) (reporters); RX 7600 XT and Radeon 8060S at startup (#1391, #1429)
Settings and switches: Fullscreen on, V-Sync Auto (immediate), frame generation 2x-4x in the logs; #1355 reports it with frame generation and Anti-Lag 2 off too
Steps: play (any area), Alt+Tab to a browser so it covers the game, wait 30 s
Expected: the game keeps running behind the browser and shows again when you come back
Actual (main): 1 to 20 s after Alt+Tab vk: a capture's wait for write-back ... timed out, then the GPU has finished nothing for 10 s, then at 30 s FATAL: the GPU hung

From #1376's log, after hid: game window not in front (foreground window: ... "Chrome_WidgetWin_1"), 15 s of normal 60 fps, then:

vk: a capture's wait for write-back 652054 timed out (done 652048)
vk: the GPU has finished nothing for 10 s: the timeline at 652048, 652062 sent (RX_VK_GPU_HANG_SEC=30)
vk: the GPU has finished nothing for 30 s: the timeline at 652048, 652062 sent (RX_VK_GPU_HANG_SEC=30)
vk: device fault:
vk: FATAL: the GPU hung: no submission finished in 30 s, and the driver never reported the device lost

What changed

The swapchain image is now waited for on the CPU, never on the replay's queue. No submission waits for the presentation engine any more, so a hidden window can no longer stop the game's GPU work.

  • gpu/vk/vk_replay.cpp, present_image: the acquire signals a fence (acquire_fence) instead of a semaphore, and image_free waits for it on the CPU (excluded from the GPU wait counts as pacing) before any work for the image is recorded. The copy's vkQueueSubmit2 has no wait semaphore. An image not free within 250 ms is held: the frame is not shown, the game goes on, and each later present checks the same image again without waiting (no second acquire while one is held) and copies into it once it is back. It logs vk: the window's image was not given back in 250 ms (the window hidden?) and ... was given back: frames are shown again (the first 16 times).
  • A swapchain made again while an image is held lets that image go. Its fence may never be signaled, so it is left alone and a new one is made (held_image_drop, acquire_fence_ready); no acquire runs without an unsignaled fence.
  • Frame::acquired (the per-slot acquire semaphores) is gone.
  • The frame slots for present-ahead at 3x/4x (the "4th acquire waits for the set's own first copy" case raised on #1391) were changed on main by present_slots_for. With this PR, that slot wait is also bounded by the GPU's own work: the first copy no longer waits for the presentation engine.

Measurements

Verdict: nothing to measure for the fix itself on this PC; the bug does not occur here (NVIDIA waits on the CPU in its acquire). The game-free test shows the bug on main and its absence here. Frame pacing on AMD with the CPU-side wait is the open question for the Test Farm (below).

Game-free test, tests/test_present_image_free.py (cuts present_image's acquire and its copy's submit info and runs them against a presentation engine that hands an image back before letting it go, as AMD's does), expected output (not run on this PC: see Testing):

Before: main @ c14641a6 After: this PR
test_present_image_free (Windows and Linux sides) fails: "the copy waits on the GPU, on the replay's queue, for an image the system has not given back" passes

Flags and settings

None.

Testing

Tested:

  • In the game, Linux, RTX 3090, NVIDIA 620.70.06, private headless sway at 1920x1080 144 Hz, fullscreen, frame generation 2x: built as a renderer pack over the shared base at 8e9cfc3a with this fix applied (the same diff as this branch before its rebase onto main; the rebase only resolved a neighbouring present_slots_for addition). Played into the save's area, moved the game's workspace away for 40 s (window not shown), back for 15 s, away 5 s, back 15 s. Mailbox: 60 fps game / frame interpolation on time throughout, frames shown again after each return, no hang-watch lines, no held-image lines (sway kept giving images back). V-Sync On (FIFO): the same, except the game pauses while hidden and resumes on return; main at 8e9cfc3a pauses the same way (nvn: GPU waits in 5 s: ... (20128 ms) on main, 20101 ms with the fix), so that is the existing Wayland FIFO behaviour, not this change.
  • Code read cold by a second agent (Vulkan fence rules, every early return, threading under present_image_mu, the test's cuts on main and here); its findings are folded in (250 ms rather than 100 ms for slow FIFO displays, the wait kept out of the GPU wait counts, no acquire without a fresh fence).

Not tested:

  • No checks were run on this PC (tests/run_all.py or any single test; a standing rule here). Forgejo CI runs them. test_present_semaphores and test_present_device_loss were updated to the acquire's new arguments.
  • The bug's own hardware (AMD on Windows): I have none.

Must be tested:

  • Windows, AMD RDNA 4 (RX 9070 XT class) or any AMD on the proprietary driver: fullscreen, frame generation 2x, play, Alt+Tab to a browser that covers the game for 30 s and back, several times. Expected: no FATAL: the GPU hung; the log may say the window's image was not given back in 250 ms then was given back; the picture comes back. (Test Farm)
  • Windows, AMD: started from the launcher, frame generation 4x, another window in front at the start, through the intro (#1391, #1429). Expected: no hang. (Test Farm)
  • Windows, AMD: frame pacing against main with the window in front, frame generation 2x and 4x, V-Sync Auto and On (PresentMon or the frame-interpolation lines): the copy now waits for its image on the CPU, which may shift present-ahead's timing. Expected: no worse than main. (Test Farm)

Risks

What could break: frame pacing where the acquire returns before the image is free (AMD Windows): the copy is submitted once the image is free rather than queued at once. A display slower than about 24 Hz in FIFO could see occasional held frames. On every GPU, a hidden window now drops frames instead of blocking (as Linux already did on Wayland).

Turning it off: revert the commit.

Compatibility: nothing changes for a player's saves, options or caches; no MKWVK_API_VERSION change.

Issues

Fixes #1376
Fixes #316
See #1355
See #1391
See #1429

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named). (not run on this PC; Forgejo CI runs it)
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A game-free test added for the fix, failing on main and passing here. (written and reasoned through; not run on this PC, CI runs it)
  • A check under tests/ that reads changed source updated in this PR, not weakened.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** medium · **Tested on:** Linux, RTX 3090 (no regression; the bug itself is AMD on Windows) · **Needs:** Windows, AMD RDNA 4 / RDNA 3 / Radeon 8060S (Test Farm) ## Why On AMD's Windows driver the game ends with "the GPU hung: no submission finished in 30 s, and the driver never reported the device lost" a few seconds after the fullscreen game window goes behind another window: Alt+Tab to a browser (#1376, #316), OBS in front while streaming (#1355), or the game started from the launcher with another window in front (#1391, #1429). No TDR, the driver does not restart: the GPU is not running anything, its queue is waiting. The cause is in `present_image`: the copy into the swapchain image waited **on the GPU** for the acquire's semaphore, on the same queue every submission of the game's work goes to. AMD's Windows driver returns from `vkAcquireNextImageKHR` at once and leaves the whole wait to that semaphore. While the window is hidden the system gives the image back late or never, so every later submission of the game waits behind the copy, and the hang watch ends the game 30 s later. The watch's own comment already named the case ("A window the system stops presenting can hold the queue that long as well"). NVIDIA's driver waits inside the acquire on the CPU instead, which is why only AMD hits it. Fixes #1376 Fixes #316 See #1355, #1391, #1429 (same signature: AMD Windows driver, fullscreen, window behind another one, timeline stopped a few submissions short, empty device fault) ## How to reproduce **Seen on:** Windows 11, AMD Radeon RX 9070 XT, AMD driver 26.10.1 / 26.11.1 (LLPC) (reporters); RX 7600 XT and Radeon 8060S at startup (#1391, #1429) **Settings and switches:** Fullscreen on, V-Sync Auto (immediate), frame generation 2x-4x in the logs; #1355 reports it with frame generation and Anti-Lag 2 off too **Steps:** play (any area), Alt+Tab to a browser so it covers the game, wait 30 s **Expected:** the game keeps running behind the browser and shows again when you come back **Actual (main):** 1 to 20 s after Alt+Tab `vk: a capture's wait for write-back ... timed out`, then `the GPU has finished nothing for 10 s`, then at 30 s `FATAL: the GPU hung` From #1376's log, after `hid: game window not in front (foreground window: ... "Chrome_WidgetWin_1")`, 15 s of normal 60 fps, then: ``` vk: a capture's wait for write-back 652054 timed out (done 652048) vk: the GPU has finished nothing for 10 s: the timeline at 652048, 652062 sent (RX_VK_GPU_HANG_SEC=30) vk: the GPU has finished nothing for 30 s: the timeline at 652048, 652062 sent (RX_VK_GPU_HANG_SEC=30) vk: device fault: vk: FATAL: the GPU hung: no submission finished in 30 s, and the driver never reported the device lost ``` ## What changed The swapchain image is now waited for on the CPU, never on the replay's queue. No submission waits for the presentation engine any more, so a hidden window can no longer stop the game's GPU work. - `gpu/vk/vk_replay.cpp`, `present_image`: the acquire signals a fence (`acquire_fence`) instead of a semaphore, and `image_free` waits for it on the CPU (excluded from the GPU wait counts as pacing) before any work for the image is recorded. The copy's `vkQueueSubmit2` has no wait semaphore. An image not free within 250 ms is **held**: the frame is not shown, the game goes on, and each later present checks the same image again without waiting (no second acquire while one is held) and copies into it once it is back. It logs `vk: the window's image was not given back in 250 ms (the window hidden?)` and `... was given back: frames are shown again` (the first 16 times). - A swapchain made again while an image is held lets that image go. Its fence may never be signaled, so it is left alone and a new one is made (`held_image_drop`, `acquire_fence_ready`); no acquire runs without an unsignaled fence. - `Frame::acquired` (the per-slot acquire semaphores) is gone. - The frame slots for present-ahead at 3x/4x (the "4th acquire waits for the set's own first copy" case raised on #1391) were changed on main by `present_slots_for`. With this PR, that slot wait is also bounded by the GPU's own work: the first copy no longer waits for the presentation engine. ## Measurements **Verdict:** nothing to measure for the fix itself on this PC; the bug does not occur here (NVIDIA waits on the CPU in its acquire). The game-free test shows the bug on main and its absence here. Frame pacing on AMD with the CPU-side wait is the open question for the Test Farm (below). Game-free test, `tests/test_present_image_free.py` (cuts present_image's acquire and its copy's submit info and runs them against a presentation engine that hands an image back before letting it go, as AMD's does), expected output (**not run on this PC**: see Testing): | | Before: main @ c14641a6 | After: this PR | |---|---|---| | test_present_image_free (Windows and Linux sides) | fails: "the copy waits on the GPU, on the replay's queue, for an image the system has not given back" | passes | ### Flags and settings None. ## Testing **Tested:** - In the game, Linux, RTX 3090, NVIDIA 620.70.06, private headless sway at 1920x1080 144 Hz, fullscreen, frame generation 2x: built as a renderer pack over the shared base at 8e9cfc3a with this fix applied (the same diff as this branch before its rebase onto main; the rebase only resolved a neighbouring `present_slots_for` addition). Played into the save's area, moved the game's workspace away for 40 s (window not shown), back for 15 s, away 5 s, back 15 s. Mailbox: 60 fps game / frame interpolation on time throughout, frames shown again after each return, no hang-watch lines, no held-image lines (sway kept giving images back). V-Sync On (FIFO): the same, except the game pauses while hidden and resumes on return; **main at 8e9cfc3a pauses the same way** (`nvn: GPU waits in 5 s: ... (20128 ms)` on main, 20101 ms with the fix), so that is the existing Wayland FIFO behaviour, not this change. - Code read cold by a second agent (Vulkan fence rules, every early return, threading under `present_image_mu`, the test's cuts on main and here); its findings are folded in (250 ms rather than 100 ms for slow FIFO displays, the wait kept out of the GPU wait counts, no acquire without a fresh fence). **Not tested:** - **No checks were run on this PC** (`tests/run_all.py` or any single test; a standing rule here). Forgejo CI runs them. `test_present_semaphores` and `test_present_device_loss` were updated to the acquire's new arguments. - The bug's own hardware (AMD on Windows): I have none. **Must be tested:** - Windows, AMD RDNA 4 (RX 9070 XT class) or any AMD on the proprietary driver: fullscreen, frame generation 2x, play, Alt+Tab to a browser that covers the game for 30 s and back, several times. Expected: no `FATAL: the GPU hung`; the log may say `the window's image was not given back in 250 ms` then `was given back`; the picture comes back. (Test Farm) - Windows, AMD: started from the launcher, frame generation 4x, another window in front at the start, through the intro (#1391, #1429). Expected: no hang. (Test Farm) - Windows, AMD: frame pacing against main with the window in front, frame generation 2x and 4x, V-Sync Auto and On (PresentMon or the frame-interpolation lines): the copy now waits for its image on the CPU, which may shift present-ahead's timing. Expected: no worse than main. (Test Farm) ## Risks **What could break:** frame pacing where the acquire returns before the image is free (AMD Windows): the copy is submitted once the image is free rather than queued at once. A display slower than about 24 Hz in FIFO could see occasional held frames. On every GPU, a hidden window now drops frames instead of blocking (as Linux already did on Wayland). **Turning it off:** revert the commit. **Compatibility:** nothing changes for a player's saves, options or caches; no `MKWVK_API_VERSION` change. ## Issues Fixes #1376 Fixes #316 See #1355 See #1391 See #1429 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [ ] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). (not run on this PC; Forgejo CI runs it) - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [ ] A game-free test added for the fix, failing on `main` and passing here. (written and reasoned through; not run on this PC, CI runs it) - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tests/test_present_image_free.py cuts present_image's acquire and its copy's submit info out of
gpu/vk/vk_replay.cpp and runs them against a presentation engine that hands an image back before
it lets it go, as AMD's driver on Windows does. On main the copy's submission waits on the GPU for
the acquire's semaphore of an image the engine keeps: the replay's queue stops behind it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(vk): the swapchain's image is waited for on the CPU, so a window behind another one no longer stops the GPU's work (#1376)
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 11s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 21s
CI / Workflow lint (actionlint) (pull_request) Successful in 22s
Third-party parts / As their notes say (pull_request) Successful in 35s
PR description / Description follows the template (pull_request_target) Failing after 4s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/windows+amd-proprietary+gpu-rx-9* 1/1 fail
da29a64a4e
The copy into the swapchain image waited on the GPU for the acquire's semaphore, on the queue
every submission of the game's work goes to. AMD's driver on Windows hands an image back from
vkAcquireNextImageKHR at once and leaves the wait to that semaphore; with the fullscreen window
behind a browser or OBS the system gave the image back late or never, the replay's queue
finished nothing, and the GPU hang watch ended the game 30 s later ("no submission finished in
30 s, and the driver never reported the device lost"; RX 9070 XT, #1376, #316, #1355).

Now the acquire signals a fence, waited for on the CPU before the copy is recorded: no
submission waits for the presentation engine. An image not free in 250 ms is held, frames are
not shown meanwhile and the game goes on; each later present looks at it again without waiting
and copies into it once it is given back. A swapchain made again while one is held lets it go.

test_present_semaphores and test_present_device_loss read the acquire's new arguments.

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

Tested in game: Linux, RTX 3090, NVIDIA 620.70.06, headless sway 1920x1080 144 Hz, fullscreen, frame generation 2x, renderer pack of this fix over the shared base 8e9cfc3a: in play, the game's workspace left for 40 s and 5 s and come back, mailbox and V-Sync On; frames shown again each time, no hang-watch or device-lost lines; FIFO pauses while hidden exactly as main does. Not run on the bug's hardware (AMD on Windows): Test Farm asked.

Tested in game: Linux, RTX 3090, NVIDIA 620.70.06, headless sway 1920x1080 144 Hz, fullscreen, frame generation 2x, renderer pack of this fix over the shared base 8e9cfc3a: in play, the game's workspace left for 40 s and 5 s and come back, mailbox and V-Sync On; frames shown again each time, no hang-watch or device-lost lines; FIFO pauses while hidden exactly as main does. Not run on the bug's hardware (AMD on Windows): Test Farm asked.
Author
Owner

@Beanstalk on Windows with an AMD GPU on AMD's own driver (RDNA 4 like an RX 9070 XT if there is one, else RDNA 3), this branch against main, fullscreen, V-Sync Auto:

  1. Frame generation 2x, play in Hyrule Field, then put a browser window over the game for 30 s and bring the game back; do it 4 times. Expected on this branch: no "FATAL: the GPU hung", the picture comes back each time (the log may say "the window's image was not given back in 250 ms" then "was given back"). On main it is expected to end with the GPU hang within about 30 s.
  2. Start the game from the launcher with frame generation 4x and another window in front of it at the start, and let it run through the intro. Expected: no GPU hang on this branch.
  3. With the game in front, frame generation 2x and 4x, V-Sync Auto and V-Sync On: compare frame pacing with main (the frame interpolation lines, or PresentMon). Expected: no worse than main.
@Beanstalk on Windows with an AMD GPU on AMD's own driver (RDNA 4 like an RX 9070 XT if there is one, else RDNA 3), this branch against main, fullscreen, V-Sync Auto: 1. Frame generation 2x, play in Hyrule Field, then put a browser window over the game for 30 s and bring the game back; do it 4 times. Expected on this branch: no "FATAL: the GPU hung", the picture comes back each time (the log may say "the window's image was not given back in 250 ms" then "was given back"). On main it is expected to end with the GPU hang within about 30 s. 2. Start the game from the launcher with frame generation 4x and another window in front of it at the start, and let it run through the intro. Expected: no GPU hang on this branch. 3. With the game in front, frame generation 2x and 4x, V-Sync Auto and V-Sync On: compare frame pacing with main (the frame interpolation lines, or PresentMon). Expected: no worse than main.
Member

Beanstalk test farm

Commit da29a64 · tier reviewed · approved by HumanBean · dashboard

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

On Windows with an AMD proprietary driver and an RDNA 4-class GPU, this plan compares main and the branch in Hyrule Field for about 15 minutes. It tests fullscreen frame generation at 2x and 4x with V-Sync Auto and On, using frametime as a pacing proxy and comparing pictures. A crash, GPU-hang log, significant p99 frametime regression, or picture mismatch fails the plan. The farm cannot put a browser over the game or start it behind another window, so the requested hidden-window reproduction, recovery, and launcher-start checks remain untested.

  • Where: windows+amd-proprietary+gpu-rx-9* (GPU "rx 9*", 1-2 reports).
  • Matrix: 4 cells, each on main and the PR: vsync 0 or 1; frame_generation 2 or 4.
  • field-pacing: from a new save (settings fullscreen=1), then teleport to Hyrule Field, move the stick, measure field for 30 s (after 10 s warm-up), take the picture field to compare with main; 2 runs on each side for each of 4 cells (1 game start a run).
  • Measured: crashes, frame times, stutters and hitches, the game's log.
  • The PR fails if: it crashes; or a picture differs from main by more than 5%; or frame time (p99) is more than 15% above main; or forbidden log lines is above 0.
  • Time: about 35 min of game runs per tester (4 game starts), plus the two builds.

Done (started 19:09 UTC, last report 19:53 UTC). Comment @Beanstalk to run it again.

Target Reports Crash Frame p99 (ms) vs main VRAM peak (MB) vs main Result
windows+amd-proprietary+gpu-rx-9* · 1: windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 1/1 1 none 19.6 vs 19.4 (+1%) — fail
Scenario · matrix cell Target Frame p99 (ms) vs main Result
field-pacing · vsync=0, frame_generation=2 windows+amd-proprietary+gpu-rx-9* 19.6 vs 19.4 (+1%) fail
field-pacing · vsync=0, frame_generation=4 windows+amd-proprietary+gpu-rx-9* 19.6 vs 19.5 (+1%) pass
field-pacing · vsync=1, frame_generation=2 windows+amd-proprietary+gpu-rx-9* 19.4 vs 19.6 (−1%) pass
field-pacing · vsync=1, frame_generation=4 windows+amd-proprietary+gpu-rx-9* 19.5 vs 20.5 (−5%) fail

Measurements · windows+amd-proprietary+gpu-rx-9*

Verdict: fail on windows+amd-proprietary+gpu-rx-9* (1/1 report): field-pacing screenshot.max_diff failed.

Hardware: 1: windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM
Scene: field-pacing, from a new save (fullscreen=1); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-pacing: 2 game starts a side, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ c14641a After: this PR @ da29a64
field-pacing · vsync=0, frame_generation=2 · field · frame time (p99) (ms) 19.4 19.6 (+1%)
field-pacing · vsync=0, frame_generation=2 · forbidden log lines 0.0 0.0
field-pacing · vsync=0, frame_generation=4 · field · frame time (p99) (ms) 19.5 19.6 (+1%)
field-pacing · vsync=0, frame_generation=4 · forbidden log lines 0.0 0.0
field-pacing · vsync=1, frame_generation=2 · field · frame time (p99) (ms) 19.6 19.4 (−1%)
field-pacing · vsync=1, frame_generation=2 · forbidden log lines 0.0 0.0
field-pacing · vsync=1, frame_generation=4 · field · frame time (p99) (ms) 20.5 19.5 (−5%)
field-pacing · vsync=1, frame_generation=4 · forbidden log lines 0.0 0.0

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
vsync menu setting 0, 1 main's default the PR's default field-pacing, the PR at 0 → at 1: 19.6 → 19.4 (−1%) no clear effect
frame_generation menu setting 2, 4 main's default the PR's default field-pacing, the PR at 2 → at 4: 19.6 → 19.6 (−0%) no clear effect
Markdown for the PR description
## Measurements

**Verdict:** fail on windows+amd-proprietary+gpu-rx-9* (1/1 report): `field-pacing screenshot.max_diff` failed.

Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM`  
Scene: field-pacing, from a new save (fullscreen=1); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-pacing: 2 game starts a side, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ c14641a | After: this PR @ da29a64 |
|---|---|---|
| field-pacing · `vsync=0, frame_generation=2` · field · frame time (p99) (ms) | 19.4 | 19.6 (+1%) |
| field-pacing · `vsync=0, frame_generation=2` · forbidden log lines | 0.0 | 0.0 |
| field-pacing · `vsync=0, frame_generation=4` · field · frame time (p99) (ms) | 19.5 | 19.6 (+1%) |
| field-pacing · `vsync=0, frame_generation=4` · forbidden log lines | 0.0 | 0.0 |
| field-pacing · `vsync=1, frame_generation=2` · field · frame time (p99) (ms) | 19.6 | 19.4 (−1%) |
| field-pacing · `vsync=1, frame_generation=2` · forbidden log lines | 0.0 | 0.0 |
| field-pacing · `vsync=1, frame_generation=4` · field · frame time (p99) (ms) | 20.5 | 19.5 (−5%) |
| field-pacing · `vsync=1, frame_generation=4` · forbidden log lines | 0.0 | 0.0 |

### Flags and settings

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `vsync` | menu setting | `0`, `1` | main's default | the PR's default | field-pacing, the PR at 0 → at 1: 19.6 → 19.4 (−1%) | no clear effect |
| `frame_generation` | menu setting | `2`, `4` | main's default | the PR's default | field-pacing, the PR at 2 → at 4: 19.6 → 19.6 (−0%) | no clear effect |
<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `da29a64` · tier **reviewed** · approved by HumanBean · [dashboard](https://beanstalk.magicbean.dev/prs/1458) **What will be tested** · AI plan (`gpt-6.1-terra`) On Windows with an AMD proprietary driver and an RDNA 4-class GPU, this plan compares main and the branch in Hyrule Field for about 15 minutes. It tests fullscreen frame generation at 2x and 4x with V-Sync Auto and On, using frametime as a pacing proxy and comparing pictures. A crash, GPU-hang log, significant p99 frametime regression, or picture mismatch fails the plan. The farm cannot put a browser over the game or start it behind another window, so the requested hidden-window reproduction, recovery, and launcher-start checks remain untested. - **Where:** windows+amd-proprietary+gpu-rx-9* (GPU "rx 9*", 1-2 reports). - **Matrix:** 4 cells, each on main and the PR: vsync `0` or `1`; frame_generation `2` or `4`. - **field-pacing:** from a new save (settings fullscreen=1), then teleport to Hyrule Field, move the stick, measure field for 30 s (after 10 s warm-up), take the picture field to compare with main; 2 runs on each side for each of 4 cells (1 game start a run). - **Measured:** crashes, frame times, stutters and hitches, the game's log. - **The PR fails if:** it crashes; or a picture differs from main by more than 5%; or frame time (p99) is more than 15% above main; or forbidden log lines is above 0. - **Time:** about 35 min of game runs per tester (4 game starts), plus the two builds. Done (started 19:09 UTC, last report 19:53 UTC). Comment `@Beanstalk` to run it again. | Target | Reports | Crash | Frame p99 (ms) vs main | VRAM peak (MB) vs main | Result | | --- | --- | --- | --- | --- | --- | | windows+amd-proprietary+gpu-rx-9* · 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` | 1/1 [1](https://beanstalk.magicbean.dev/reports/rp_c64831cd35a6deae) | none | 19.6 vs 19.4 (+1%) | — | fail | | Scenario · matrix cell | Target | Frame p99 (ms) vs main | Result | | --- | --- | --- | --- | | field-pacing · `vsync=0, frame_generation=2` | windows+amd-proprietary+gpu-rx-9* | 19.6 vs 19.4 (+1%) | fail | | field-pacing · `vsync=0, frame_generation=4` | windows+amd-proprietary+gpu-rx-9* | 19.6 vs 19.5 (+1%) | pass | | field-pacing · `vsync=1, frame_generation=2` | windows+amd-proprietary+gpu-rx-9* | 19.4 vs 19.6 (−1%) | pass | | field-pacing · `vsync=1, frame_generation=4` | windows+amd-proprietary+gpu-rx-9* | 19.5 vs 20.5 (−5%) | fail | #### Measurements · windows+amd-proprietary+gpu-rx-9* **Verdict:** fail on windows+amd-proprietary+gpu-rx-9* (1/1 report): `field-pacing screenshot.max_diff` failed. Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM` Scene: field-pacing, from a new save (fullscreen=1); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-pacing: 2 game starts a side, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ c14641a | After: this PR @ da29a64 | |---|---|---| | field-pacing · `vsync=0, frame_generation=2` · field · frame time (p99) (ms) | 19.4 | 19.6 (+1%) | | field-pacing · `vsync=0, frame_generation=2` · forbidden log lines | 0.0 | 0.0 | | field-pacing · `vsync=0, frame_generation=4` · field · frame time (p99) (ms) | 19.5 | 19.6 (+1%) | | field-pacing · `vsync=0, frame_generation=4` · forbidden log lines | 0.0 | 0.0 | | field-pacing · `vsync=1, frame_generation=2` · field · frame time (p99) (ms) | 19.6 | 19.4 (−1%) | | field-pacing · `vsync=1, frame_generation=2` · forbidden log lines | 0.0 | 0.0 | | field-pacing · `vsync=1, frame_generation=4` · field · frame time (p99) (ms) | 20.5 | 19.5 (−5%) | | field-pacing · `vsync=1, frame_generation=4` · forbidden log lines | 0.0 | 0.0 | ### Flags and settings | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `vsync` | menu setting | `0`, `1` | main's default | the PR's default | field-pacing, the PR at 0 → at 1: 19.6 → 19.4 (−1%) | no clear effect | | `frame_generation` | menu setting | `2`, `4` | main's default | the PR's default | field-pacing, the PR at 2 → at 4: 19.6 → 19.6 (−0%) | no clear effect | <details><summary>Markdown for the PR description</summary> ```markdown ## Measurements **Verdict:** fail on windows+amd-proprietary+gpu-rx-9* (1/1 report): `field-pacing screenshot.max_diff` failed. Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM` Scene: field-pacing, from a new save (fullscreen=1); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-pacing: 2 game starts a side, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ c14641a | After: this PR @ da29a64 | |---|---|---| | field-pacing · `vsync=0, frame_generation=2` · field · frame time (p99) (ms) | 19.4 | 19.6 (+1%) | | field-pacing · `vsync=0, frame_generation=2` · forbidden log lines | 0.0 | 0.0 | | field-pacing · `vsync=0, frame_generation=4` · field · frame time (p99) (ms) | 19.5 | 19.6 (+1%) | | field-pacing · `vsync=0, frame_generation=4` · forbidden log lines | 0.0 | 0.0 | | field-pacing · `vsync=1, frame_generation=2` · field · frame time (p99) (ms) | 19.6 | 19.4 (−1%) | | field-pacing · `vsync=1, frame_generation=2` · forbidden log lines | 0.0 | 0.0 | | field-pacing · `vsync=1, frame_generation=4` · field · frame time (p99) (ms) | 20.5 | 19.5 (−5%) | | field-pacing · `vsync=1, frame_generation=4` · forbidden log lines | 0.0 | 0.0 | ### Flags and settings | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `vsync` | menu setting | `0`, `1` | main's default | the PR's default | field-pacing, the PR at 0 → at 1: 19.6 → 19.4 (−1%) | no clear effect | | `frame_generation` | menu setting | `2`, `4` | main's default | the PR's default | field-pacing, the PR at 2 → at 4: 19.6 → 19.6 (−0%) | no clear effect | ``` </details>
Collaborator

Possibly related, for context:

  • PR #1043 fix(vk): the presenter thread keeps the swapchain's external sync, and a drain that gives up is safe — Overlapping swapchain synchronization changes in vk_replay.cpp
Possibly related, for context: - PR #1043 fix(vk): the presenter thread keeps the swapchain's external sync, and a drain that gives up is safe — Overlapping swapchain synchronization changes in vk_replay.cpp
HumanBean changed title from WIP: fix(vk): the swapchain's image is waited for on the CPU, so a window behind another one no longer stops the GPU's work to fix(vk): the swapchain's image is waited for on the CPU, so a window behind another one no longer stops the GPU's work 2026-11-17 20:18:22 +00:00
HumanBean deleted branch fix/present-acquire-fence 2026-11-17 20:18:30 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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!1458
No description provided.