perf(vk): the next frame is recorded during OoT's frame limiter's wait and held until its signal (HOS_NVN_FRAME_OVERLAP, off by default) #1811

Closed
GummiNaomi wants to merge 2 commits from GummiNaomi/Longshot:perf/frame-overlap-hold into main
Member

Summary

OoT keeps one frame in flight. Once a frame its main thread waits (nvnSyncWait, no timeout) for the GPU to finish the frame before, then fills the next frame's per-frame data (calcGPU: the views' uniform buffers, readbacks of the GPU's results) and signals the event that frame's command buffers wait for. Until that signal the render thread has nothing it may record, and the GPU then waits for the frame's first recording.

With HOS_NVN_FRAME_OVERLAP=1 the render thread records that frame during the wait, against memory as it stood at the wait, and holds every recording until the CPU's signal that meets the frame's wait: that event, with a value that meets the wait by its mode. Nothing held reaches the GPU before that signal: there is no other way out, not a count, a present or a time. At the signal the captures made since the wait are taken (the window), one recording syncs the mirrors the held work bound, then the held recordings go out in their order, so the GPU reads memory as it is at the signal, as on the console. Off by default.

This is a redesign onto main's new render thread (#1763: the parallel replay gone, presents on the presenter thread, parts ending where the game ends a render pass), and it answers the review of 2691c8aa (head dae496fd, on main 89c3d21e):

  • No early submit. At its bound (40 held recordings; a hold holds 0.8 to 0.9 in the Market) the hold records nothing more until the signal: no part ends, a submit waits in its queue's list with its memory work done, no stopped queue goes on. A present waits behind the hold as behind any CPU wait not met; made after RX_VK_HOLD_MS, its own recording is held with the rest. The old forced paths (the bound, a present, the 1 s gate, a slot coming round) are gone; a held slot coming round is now a fatal error the bound makes impossible (static_assert).
  • Released by the exact signal. At the hold's begin the game thread keeps the hold's number and its wait (event, mode, value); a CPU signal carries the number only when its value meets the wait (frame_overlap::Wait::released_by, the same rule as event_wait_met). A signal of the same event with another value releases nothing.
  • Off is off. The host tells the renderer 0 once when the switch turns off (rx_frame_overlap_tell in gpu/render/rx_nvn.h); the renderer then clears the late-page capture option and any armed wait. The capture option follows late_capture (the switch on and a setup that can hold: render thread, no batched submits, VRAM mirrors, no uniform snapshots), apart from each frame's eligibility.
  • No pointer swap. The guard's (=2) wrappers are put in the host's own table at the renderer's entry, before any of its threads start (frame_overlap_watch_install); the host pointer is never replaced. The guard is chosen at the start. The probe (=3) is removed.

Read first: gpu/vk/frame_overlap.h (the rules), gpu/vk/vk_replay.cpp (frame_overlap_queued, ov_begin_locked, event_signal_queued, frame_overlap_early, ov_hold, ov_release, ov_resume_left, the ov_full() checks in split_part, submit_job, schedule, drain), host/nvn_native.c (frame_overlap_at_wait), tests/frame_overlap_test.cpp.

See #1763, #1121, #1484, #916.

Testing

Tested: Windows 11 Pro 26200, RTX 4070 SUPER (NVIDIA 617.42), Ryzen 9 9950X3D (SMT off), the process held to 4 cores (affinity 0xF00): Castle Town's market (child), standing after a debug teleport from the kokiri-start save, headless, uncapped, one ABBA round against main (below). Every hold in the 4 runs with the switch on was released at the signal that met its wait (10,103 and 11,092 frames held, 0.89 and 0.83 recordings each), the bound never reached, no present made in a hold, no signal of another value, no error in the logs; 2,476 to 2,490 draws a frame in all four runs (the same view). Checks: tests/test_frame_overlap.py passes, with its broken variants caught (the release by the event's address alone, no bound, the switch's off not told, the late pages left whatever the setup, and the earlier ones); the model now checks every read of every part against the console's in every run (past the bound too), a CPU signal of the frame's event with another value first, each present handed over in the next frame's hold, that nothing is sent in a hold, and the switch's transitions 0 -> 1 -> 0 -> 2 -> 0. Those new runs fail with the old behaviour put back in the model (the bound or a present releasing early: the meter's readback no longer finds the frame before's sum). The checks that read the changed files (tests/run_all.py --changed's pick, 385) on Windows and in WSL Ubuntu 24.04 (g++): on Windows (clang) 310 pass and 75 fail, 72 of the failures failing on main too; in WSL 335 pass, 39 fail and 16 skip, 35 failing on main too. The others: test_device_lost_exit, test_crash_record and test_readback_part cut code this PR had changed (a second declaration of replay_fatal, schedule()'s new ov_full()), fixed in dae496fd and passing on both; test_recording_admission (Windows) and test_prepare_stall (WSL, a timing check under 8 jobs) passed when run again alone. After dae496fd only those and test_frame_overlap were run again, on both. Not run here: 16 cores, windowed, the guard (=2), Linux, other GPUs.

Still to test:

  • windows, a fast desktop (16 cores or more): Castle Town's market standing two minutes, HOS_NVN_FRAME_OVERLAP=1 against unset, expecting higher fps than unset (on main before #1763 it was +7.5 % on 16 cores) and no more frames over 16.7 ms (@Beanstalk windows, the Market standing 2 minutes with HOS_NVN_FRAME_OVERLAP=1 against unset, on a 16-core or larger CPU)
  • windows: the same with HOS_NVN_FRAME_OVERLAP=2 set at the start, expecting the log's guard counts at 0 and no flicker, and every vk: HOS_NVN_FRAME_OVERLAP (600 presents) line saying released at the signal for every frame held, the bound reached 0 times (@Beanstalk windows, the Market 2 minutes with HOS_NVN_FRAME_OVERLAP=2, its guard lines)
  • windows, windowed: Kokiri Forest, Hyrule Field and the Market with HOS_NVN_FRAME_OVERLAP=1 against unset, expecting fps at least unset's and no flicker (@Beanstalk windows, the three areas windowed, HOS_NVN_FRAME_OVERLAP=1 against unset)
  • linux+nvidia, linux+amd, windows+amd, windows+intel, steamdeck: the Market with HOS_NVN_FRAME_OVERLAP=1 against unset, expecting no crash, no flicker and fps no lower than unset (@Beanstalk linux+nvidia linux+amd windows+amd windows+intel steamdeck, the Market with HOS_NVN_FRAME_OVERLAP=1 against unset)

Measurements

Verdict: on 4 cores within the spread of main, at most +1 %: 76.6 -> 77.3 fps (four runs, one ABBA round), frames of 16.7 ms or more 0.7 -> 0.9 %. The main thread's wait for the GPU at the limiter is shorter (0.63 -> 0.45 ms a frame) and the takes' wait for late pages gone (0.75 -> 0.00 ms), but on 4 cores only ~60 % of frames reach the wait with the GPU behind. 16 cores, where the old design gained 7.5 %, is not measured on this main (above, Still to test). Off by default until it is.

Setup: Windows 11 Pro 26200, RTX 4070 SUPER 12 GB (NVIDIA 617.42), Ryzen 9 9950X3D with SMT off, 32 GB; the process held to 4 cores (affinity 0xF00; Threaded rendering's Auto: the render thread). Castle Town's market (child), standing after a debug teleport from the kokiri-start save; 1920x1080, no window (HOS_HEADLESS=1), uncapped (HOS_FPS_MAX=1000), RX_VK_LATE_FIX=0, RX_VK_FRAME_TRACE=1. 130 s standing, the trace's last 100 s; the builds alternated main, PR, PR, main; the 95 % interval by a bootstrap over 3 s blocks.

4 cores, the Market standing Before: main @ 89c3d21e After: this PR @ ba5c13b2, HOS_NVN_FRAME_OVERLAP=1
fps, each run 76.7 / 76.4 76.8 / 77.8
fps, pooled (mean frame) 76.6 (13.06 ms) 77.3 (12.94 ms): -0.13 ms, 95 %: -0.17 to -0.08
frames of 16.7 ms or more 0.7 / 0.8 % 1.0 / 0.8 %
99th percentile frame 16.3 / 16.4 ms 16.7 / 16.4 ms
frames of 33 ms or more 0 / 0 0 / 0
the main thread's wait for the GPU, a frame 0.64 / 0.62 ms 0.44 / 0.45 ms
the takes' waits for late pages, a frame 0.77 / 0.73 ms 0.00 / 0.00 ms
GPU idle before a frame's first recording with a draw (+ in uploads) 1.08 + 0.13 / 1.09 + 0.13 ms 1.27 + 0.10 / 1.22 + 0.10 ms
frames held, recordings held each; released at the signal; the bound; presents in a hold 10,103, 0.89; all; 0; 0 / 11,092, 0.83; all; 0; 0
  r2-main4-a  main 7674 frames 76.7 fps late 0.7 % median 12.83 ms
  r2-on4-a    on   7677 frames 76.8 fps late 1.0 % median 12.97 ms
  r2-on4-b    on   7785 frames 77.8 fps late 0.8 % median 12.77 ms
  r2-main4-b  main 7639 frames 76.4 fps late 0.7 % median 12.89 ms
on - main: mean -0.126 ms (fps +0.98 %); 95 % interval -0.172 to -0.077 ms

Measured at ba5c13b2, this PR's code commit. The head, dae496fd, adds this round's docs/tested files, a stand-in in one test's fixture and moves the impossible held-slot check's fatal call into a function of its own: nothing that runs in a frame changes. On main before #1763 (f505340b, the old design): 16 cores 82.9 -> 89.1 fps over three pairs, 4 cores 74.0 -> 72.4 (one pair); this redesign on this main is no longer slower on 4 cores. The switch ships off: its one measured setup here is within the spread, and the setup it is for is not measured yet.

Flags and settings

Flag What it is Before After Recommendation
HOS_NVN_FRAME_OVERLAP the next frame recorded during OoT's limiter's wait, held until the signal that meets the frame's wait (none) unset: off; 1 on; 2 on with its guard (set at the start) off: for testing on fast PCs, until the Test Farm's 16-core runs

HOS_AB is not new and its default is unchanged (unset: no A/B): the renderer now reads it once at its start, to put the guard's watch in when an A/B of this switch asks for 2.

Risks

What could break, with the switch on: a read the replay makes on the CPU while it records (a pointer table, a report) of a page the game rewrites between the wait and the signal gets the page as it was at the wait (the guard, =2, counts these; 0 in the old design's 52 guard blocks); a game thread that waited in the window for work handed over after the wait would wait until the signal (OoT's main thread does not: no submit in the window, every hold here released at its signal). A broken bound would end the game with a fatal line rather than send held work early. Off (the default): one A/B read and a call at most once at the limiter's wait, and flag tests that stay false. Turning it off: leave HOS_NVN_FRAME_OVERLAP unset; a live A/B to 0 is told to the renderer and clears its state. MKWVK_API_VERSION 36: the renderer and the host from the same build, as for every bump. What a player notices: nothing; saves, options and caches unchanged.

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). (Not mise itself: the checks that read the changed files, on Windows and in WSL, as Testing says; the failures there also fail on main.)
  • 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. (The review's points: the model's new runs fail with the old forced releases, and the broken variants fail.)
  • 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.
  • MKWVK_API_VERSION bumped (MkwVkHost or MkwVkRenderer in gpu/vk/vk_api.h changed).
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Built on Windows and run; on Linux only the changed checks in WSL with g++. No Linux build was done.)
  • Docs updated.
  • 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 OoT keeps one frame in flight. Once a frame its main thread waits (`nvnSyncWait`, no timeout) for the GPU to finish the frame before, then fills the next frame's per-frame data (calcGPU: the views' uniform buffers, readbacks of the GPU's results) and signals the event that frame's command buffers wait for. Until that signal the render thread has nothing it may record, and the GPU then waits for the frame's first recording. With `HOS_NVN_FRAME_OVERLAP=1` the render thread records that frame during the wait, against memory as it stood at the wait, and **holds** every recording until the CPU's signal that meets the frame's wait: that event, with a value that meets the wait by its mode. Nothing held reaches the GPU before that signal: there is no other way out, not a count, a present or a time. At the signal the captures made since the wait are taken (the window), one recording syncs the mirrors the held work bound, then the held recordings go out in their order, so the GPU reads memory as it is at the signal, as on the console. Off by default. This is a redesign onto main's new render thread (#1763: the parallel replay gone, presents on the presenter thread, parts ending where the game ends a render pass), and it answers the review of 2691c8aa (head dae496fd, on main 89c3d21e): - **No early submit.** At its bound (40 held recordings; a hold holds 0.8 to 0.9 in the Market) the hold records nothing more until the signal: no part ends, a submit waits in its queue's list with its memory work done, no stopped queue goes on. A present waits behind the hold as behind any CPU wait not met; made after `RX_VK_HOLD_MS`, its own recording is held with the rest. The old forced paths (the bound, a present, the 1 s gate, a slot coming round) are gone; a held slot coming round is now a fatal error the bound makes impossible (static_assert). - **Released by the exact signal.** At the hold's begin the game thread keeps the hold's number and its wait (event, mode, value); a CPU signal carries the number only when its value meets the wait (`frame_overlap::Wait::released_by`, the same rule as `event_wait_met`). A signal of the same event with another value releases nothing. - **Off is off.** The host tells the renderer 0 once when the switch turns off (`rx_frame_overlap_tell` in `gpu/render/rx_nvn.h`); the renderer then clears the late-page capture option and any armed wait. The capture option follows `late_capture` (the switch on and a setup that can hold: render thread, no batched submits, VRAM mirrors, no uniform snapshots), apart from each frame's eligibility. - **No pointer swap.** The guard's (`=2`) wrappers are put in the host's own table at the renderer's entry, before any of its threads start (`frame_overlap_watch_install`); the host pointer is never replaced. The guard is chosen at the start. The probe (`=3`) is removed. Read first: `gpu/vk/frame_overlap.h` (the rules), `gpu/vk/vk_replay.cpp` (`frame_overlap_queued`, `ov_begin_locked`, `event_signal_queued`, `frame_overlap_early`, `ov_hold`, `ov_release`, `ov_resume_left`, the `ov_full()` checks in `split_part`, `submit_job`, `schedule`, `drain`), `host/nvn_native.c` (`frame_overlap_at_wait`), `tests/frame_overlap_test.cpp`. See #1763, #1121, #1484, #916. ## Testing **Tested:** Windows 11 Pro 26200, RTX 4070 SUPER (NVIDIA 617.42), Ryzen 9 9950X3D (SMT off), the process held to 4 cores (affinity 0xF00): Castle Town's market (child), standing after a debug teleport from the `kokiri-start` save, headless, uncapped, one ABBA round against main (below). Every hold in the 4 runs with the switch on was released at the signal that met its wait (10,103 and 11,092 frames held, 0.89 and 0.83 recordings each), the bound never reached, no present made in a hold, no signal of another value, no error in the logs; 2,476 to 2,490 draws a frame in all four runs (the same view). Checks: `tests/test_frame_overlap.py` passes, with its broken variants caught (the release by the event's address alone, no bound, the switch's off not told, the late pages left whatever the setup, and the earlier ones); the model now checks every read of every part against the console's in every run (past the bound too), a CPU signal of the frame's event with another value first, each present handed over in the next frame's hold, that nothing is sent in a hold, and the switch's transitions 0 -> 1 -> 0 -> 2 -> 0. Those new runs fail with the old behaviour put back in the model (the bound or a present releasing early: the meter's readback no longer finds the frame before's sum). The checks that read the changed files (`tests/run_all.py --changed`'s pick, 385) on Windows and in WSL Ubuntu 24.04 (g++): on Windows (clang) 310 pass and 75 fail, 72 of the failures failing on main too; in WSL 335 pass, 39 fail and 16 skip, 35 failing on main too. The others: `test_device_lost_exit`, `test_crash_record` and `test_readback_part` cut code this PR had changed (a second declaration of `replay_fatal`, `schedule()`'s new `ov_full()`), fixed in dae496fd and passing on both; `test_recording_admission` (Windows) and `test_prepare_stall` (WSL, a timing check under 8 jobs) passed when run again alone. After dae496fd only those and `test_frame_overlap` were run again, on both. Not run here: 16 cores, windowed, the guard (`=2`), Linux, other GPUs. **Still to test:** - windows, a fast desktop (16 cores or more): Castle Town's market standing two minutes, `HOS_NVN_FRAME_OVERLAP=1` against unset, expecting higher fps than unset (on main before #1763 it was +7.5 % on 16 cores) and no more frames over 16.7 ms (@Beanstalk windows, the Market standing 2 minutes with HOS_NVN_FRAME_OVERLAP=1 against unset, on a 16-core or larger CPU) - windows: the same with `HOS_NVN_FRAME_OVERLAP=2` set at the start, expecting the log's guard counts at 0 and no flicker, and every `vk: HOS_NVN_FRAME_OVERLAP (600 presents)` line saying released at the signal for every frame held, the bound reached 0 times (@Beanstalk windows, the Market 2 minutes with HOS_NVN_FRAME_OVERLAP=2, its guard lines) - windows, windowed: Kokiri Forest, Hyrule Field and the Market with `HOS_NVN_FRAME_OVERLAP=1` against unset, expecting fps at least unset's and no flicker (@Beanstalk windows, the three areas windowed, HOS_NVN_FRAME_OVERLAP=1 against unset) - linux+nvidia, linux+amd, windows+amd, windows+intel, steamdeck: the Market with `HOS_NVN_FRAME_OVERLAP=1` against unset, expecting no crash, no flicker and fps no lower than unset (@Beanstalk linux+nvidia linux+amd windows+amd windows+intel steamdeck, the Market with HOS_NVN_FRAME_OVERLAP=1 against unset) ## Measurements **Verdict:** on 4 cores within the spread of main, at most +1 %: 76.6 -> 77.3 fps (four runs, one ABBA round), frames of 16.7 ms or more 0.7 -> 0.9 %. The main thread's wait for the GPU at the limiter is shorter (0.63 -> 0.45 ms a frame) and the takes' wait for late pages gone (0.75 -> 0.00 ms), but on 4 cores only ~60 % of frames reach the wait with the GPU behind. 16 cores, where the old design gained 7.5 %, is not measured on this main (above, Still to test). Off by default until it is. Setup: Windows 11 Pro 26200, RTX 4070 SUPER 12 GB (NVIDIA 617.42), Ryzen 9 9950X3D with SMT off, 32 GB; the process held to 4 cores (affinity 0xF00; Threaded rendering's Auto: the render thread). Castle Town's market (child), standing after a debug teleport from the `kokiri-start` save; 1920x1080, no window (`HOS_HEADLESS=1`), uncapped (`HOS_FPS_MAX=1000`), `RX_VK_LATE_FIX=0`, `RX_VK_FRAME_TRACE=1`. 130 s standing, the trace's last 100 s; the builds alternated main, PR, PR, main; the 95 % interval by a bootstrap over 3 s blocks. | 4 cores, the Market standing | Before: main @ 89c3d21e | After: this PR @ ba5c13b2, `HOS_NVN_FRAME_OVERLAP=1` | |---|---|---| | fps, each run | 76.7 / 76.4 | 76.8 / 77.8 | | fps, pooled (mean frame) | 76.6 (13.06 ms) | 77.3 (12.94 ms): -0.13 ms, 95 %: -0.17 to -0.08 | | frames of 16.7 ms or more | 0.7 / 0.8 % | 1.0 / 0.8 % | | 99th percentile frame | 16.3 / 16.4 ms | 16.7 / 16.4 ms | | frames of 33 ms or more | 0 / 0 | 0 / 0 | | the main thread's wait for the GPU, a frame | 0.64 / 0.62 ms | 0.44 / 0.45 ms | | the takes' waits for late pages, a frame | 0.77 / 0.73 ms | 0.00 / 0.00 ms | | GPU idle before a frame's first recording with a draw (+ in uploads) | 1.08 + 0.13 / 1.09 + 0.13 ms | 1.27 + 0.10 / 1.22 + 0.10 ms | | frames held, recordings held each; released at the signal; the bound; presents in a hold | | 10,103, 0.89; all; 0; 0 / 11,092, 0.83; all; 0; 0 | ``` r2-main4-a main 7674 frames 76.7 fps late 0.7 % median 12.83 ms r2-on4-a on 7677 frames 76.8 fps late 1.0 % median 12.97 ms r2-on4-b on 7785 frames 77.8 fps late 0.8 % median 12.77 ms r2-main4-b main 7639 frames 76.4 fps late 0.7 % median 12.89 ms on - main: mean -0.126 ms (fps +0.98 %); 95 % interval -0.172 to -0.077 ms ``` Measured at ba5c13b2, this PR's code commit. The head, dae496fd, adds this round's `docs/tested` files, a stand-in in one test's fixture and moves the impossible held-slot check's fatal call into a function of its own: nothing that runs in a frame changes. On main before #1763 (f505340b, the old design): 16 cores 82.9 -> 89.1 fps over three pairs, 4 cores 74.0 -> 72.4 (one pair); this redesign on this main is no longer slower on 4 cores. The switch ships off: its one measured setup here is within the spread, and the setup it is for is not measured yet. ### Flags and settings | Flag | What it is | Before | After | Recommendation | |---|---|---|---|---| | `HOS_NVN_FRAME_OVERLAP` | the next frame recorded during OoT's limiter's wait, held until the signal that meets the frame's wait | (none) | unset: off; `1` on; `2` on with its guard (set at the start) | off: for testing on fast PCs, until the Test Farm's 16-core runs | `HOS_AB` is not new and its default is unchanged (unset: no A/B): the renderer now reads it once at its start, to put the guard's watch in when an A/B of this switch asks for 2. ## Risks What could break, with the switch on: a read the replay makes on the CPU while it records (a pointer table, a report) of a page the game rewrites between the wait and the signal gets the page as it was at the wait (the guard, `=2`, counts these; 0 in the old design's 52 guard blocks); a game thread that waited in the window for work handed over after the wait would wait until the signal (OoT's main thread does not: no submit in the window, every hold here released at its signal). A broken bound would end the game with a fatal line rather than send held work early. Off (the default): one A/B read and a call at most once at the limiter's wait, and flag tests that stay false. Turning it off: leave `HOS_NVN_FRAME_OVERLAP` unset; a live A/B to 0 is told to the renderer and clears its state. `MKWVK_API_VERSION` 36: the renderer and the host from the same build, as for every bump. What a player notices: nothing; saves, options and caches unchanged. ## 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). (Not `mise` itself: the checks that read the changed files, on Windows and in WSL, as Testing says; the failures there also fail on main.) - [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. (The review's points: the model's new runs fail with the old forced releases, and the broken variants fail.) - [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] `MKWVK_API_VERSION` bumped (`MkwVkHost` or `MkwVkRenderer` in `gpu/vk/vk_api.h` changed). - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Built on Windows and run; on Linux only the changed checks in WSL with g++. No Linux build was done.) - [x] Docs updated. - [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)
perf(vk): the next frame is recorded during OoT's frame limiter's wait and held until its signal (HOS_NVN_FRAME_OVERLAP, off by default)
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
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 14s
PR description / Description follows the template (pull_request_target) Failing after 16s
CI / Workflow lint (actionlint) (pull_request) Successful in 19s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 15s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Third-party parts / As their notes say (pull_request) Successful in 23s
a44c3d3b5f
OoT keeps one frame in flight: once a frame its main thread waits (nvnSyncWait) for the
previous frame's fence, and the frame's command buffer starts with a GPU wait on an event
the CPU sets only after that wait. The render thread replays nothing in that window, and
the GPU idles before the frame's first draw.

With HOS_NVN_FRAME_OVERLAP=1, at the limiter's wait the render thread records the frame
already handed over and holds the recordings until the CPU's signal, then submits them.
=2 adds a guard that checks the guest memory the held work read against what the game
wrote in the window; =3 probes without holding. Off by default: faster on 16 cores,
slower on 4. MkwVkRenderer.nvn_frame_overlap, MKWVK_API_VERSION 36.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
futondestroyer left a comment

Recommendation: Request changes. The overlap path can submit GPU work before the guest wait's signal has been satisfied. It also leaves altered capture behavior behind when it is disabled.

Does it help: Unproven at this head. GummiNaomi's older headless uncapped RTX 4070 SUPER comparison reported 82.9 to 89.1 FPS on sixteen cores across three pairs, but 74.0 to 72.4 FPS on four cores in one pair, with late work rising from 1.8% to 4.6%. The guard caught one rewritten page at Market arrival. This does not establish windowed cadence or correctness at the submitted head.
Other systems: This changes shared host, replay, capture, and present paths. Exact-head windowed, low-core, Linux/Deck and non-NVIDIA coverage are missing.
Switches: HOS_NVN_FRAME_OVERLAP is off by default. The live override needs a complete off transition.
Reviewed: a44c3d3b against 0de25c3e, with exact Graphify maps and source verification. Read the host/replay handoff, held recordings and signal paths, switch plumbing and fixtures. Nothing run.
Fixed in this review: Nothing.
Checked and fine: The fixture exercises the normal held-recording path and attempts to bound queued recordings. That bound must preserve submission order.

Blocking

  1. gpu/vk/vk_replay.cpp:7153–7155,7238,7440–7441: the bound, present and timeout paths can force held recordings onto the GPU before the satisfying signal. That can run against data still being written during the wait. Bound or discard speculative recordings without submitting them early. Keep the byte-equivalence assertion for forced paths; tests/frame_overlap_test.cpp:627–631 currently skips that assertion there.

  2. gpu/vk/vk_replay.cpp:7524–7528: the replay release checks event address, even where the job does not carry the satisfied-wait marker. A non-satisfying write to the same address can release held GPU work. Retain and check the wait's comparison/value or require an exact satisfying-signal token; add a same-address, wrong-value case.

  3. host/nvn_native.c:1190–1193 and gpu/vk/vk_replay.cpp:7928–7931: a live 1→0 switch does not notify the renderer, and opt-in can alter late capture before eligibility rejects batched/parallel/snapshot paths. Clear renderer state on off and separate the capture option from eligibility; test both transitions.

  4. gpu/vk/vk_replay.cpp:6981–6988: guard/probe replaces the ordinary global host pointer from a game thread while renderer threads read it. Keeping the two tables alive does not synchronize pointer publication or readers. Install the wrapper before worker startup or use an immutable table with gated instrumentation.

Testing: Exact head has no gameplay result. Repair the source blockers, then rerun the full suite and measure current-main windowed correctness and frame tails.
Overlaps and merge order: Reconcile the design with #1763 before further evidence. Its parallel replay can make the current overlap path ineligible. Coordinate the shared host/replay edits with #1810 and #1812.

**Recommendation: Request changes.** The overlap path can submit GPU work before the guest wait's signal has been satisfied. It also leaves altered capture behavior behind when it is disabled. **Does it help:** Unproven at this head. GummiNaomi's older headless uncapped RTX 4070 SUPER comparison reported 82.9 to 89.1 FPS on sixteen cores across three pairs, but 74.0 to 72.4 FPS on four cores in one pair, with late work rising from 1.8% to 4.6%. The guard caught one rewritten page at Market arrival. This does not establish windowed cadence or correctness at the submitted head. **Other systems:** This changes shared host, replay, capture, and present paths. Exact-head windowed, low-core, Linux/Deck and non-NVIDIA coverage are missing. **Switches:** HOS_NVN_FRAME_OVERLAP is off by default. The live override needs a complete off transition. **Reviewed:** a44c3d3b against 0de25c3e, with exact Graphify maps and source verification. Read the host/replay handoff, held recordings and signal paths, switch plumbing and fixtures. Nothing run. **Fixed in this review:** Nothing. **Checked and fine:** The fixture exercises the normal held-recording path and attempts to bound queued recordings. That bound must preserve submission order. **Blocking** 1. `gpu/vk/vk_replay.cpp:7153–7155,7238,7440–7441`: the bound, present and timeout paths can force held recordings onto the GPU before the satisfying signal. That can run against data still being written during the wait. Bound or discard speculative recordings without submitting them early. Keep the byte-equivalence assertion for forced paths; `tests/frame_overlap_test.cpp:627–631` currently skips that assertion there. 2. `gpu/vk/vk_replay.cpp:7524–7528`: the replay release checks event address, even where the job does not carry the satisfied-wait marker. A non-satisfying write to the same address can release held GPU work. Retain and check the wait's comparison/value or require an exact satisfying-signal token; add a same-address, wrong-value case. 3. `host/nvn_native.c:1190–1193` and `gpu/vk/vk_replay.cpp:7928–7931`: a live 1→0 switch does not notify the renderer, and opt-in can alter late capture before eligibility rejects batched/parallel/snapshot paths. Clear renderer state on off and separate the capture option from eligibility; test both transitions. 4. `gpu/vk/vk_replay.cpp:6981–6988`: guard/probe replaces the ordinary global host pointer from a game thread while renderer threads read it. Keeping the two tables alive does not synchronize pointer publication or readers. Install the wrapper before worker startup or use an immutable table with gated instrumentation. **Testing:** Exact head has no gameplay result. Repair the source blockers, then rerun the full suite and measure current-main windowed correctness and frame tails. **Overlaps and merge order:** Reconcile the design with https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1763 before further evidence. Its parallel replay can make the current overlap path ineligible. Coordinate the shared host/replay edits with #1810 and #1812.
@ -6854,0 +6984,4 @@
ov_host_table = *host;
ov_real_read = host->gpu_read, ov_real_write = host->gpu_write;
ov_host_table.gpu_read = ov_read, ov_host_table.gpu_write = ov_write;
host = &ov_host_table; // (both tables stay: a thread that read the pointer before goes on with the first)
Member

The ordinary global host pointer is replaced while renderer threads read it. Publish before workers start or keep the table immutable.

The ordinary global host pointer is replaced while renderer threads read it. Publish before workers start or keep the table immutable.
@ -6854,0 +7151,4 @@
return false;
}
if (ovl::must_send_now(ov.held.size())) {
ov_release(false, 0, "the bound of held recordings", true);
Member

Queue limits cannot release GPU work before the verified guest signal. Bound recording by falling back without submitting it early.

Queue limits cannot release GPU work before the verified guest signal. Bound recording by falling back without submitting it early.
@ -7011,3 +7525,3 @@
if (j.id) fa_signal_begin(); // (frame ahead's counters: what this capture brings, before it is taken)
else fa_window.signals++;
if (j.id) { // (its capture: what the game wrote up to the signal, for the work that waited for it)
if (ov.holding && j.ev_gpu == ov.event) { // (longshot, HOS_NVN_FRAME_OVERLAP: the window over: frame_overlap::release)
Member

Address equality alone does not satisfy this wait. Require the actual value predicate or a token proving satisfaction.

Address equality alone does not satisfy this wait. Require the actual value predicate or a token proving satisfaction.
@ -1171,0 +1189,4 @@
}
static void frame_overlap_at_wait(uint64_t lr) {
if (lr != 0x8042cde0 || hos_game_is_mkw()) return; /* (OoT's frame limiter's wait for the frame before's fence) */
const int m = hos_ab_value("HOS_NVN_FRAME_OVERLAP", frame_overlap_mode());
Member

Send the off transition too and clear renderer capture state.

Send the off transition too and clear renderer capture state.
fix(vk): the frame overlap's late pages and write-back hold as the late-defer and late-fix checks cut them
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
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 13s
CI / Workflow lint (actionlint) (pull_request) Successful in 14s
Third-party parts / As their notes say (pull_request) Successful in 15s
PR description / Description follows the template (pull_request_target) Failing after 5s
beanstalk/approval held by the security check: see the farm's comment
2691c8aa29
Six checks that pass on main failed on this branch: four cut take_capture's late-page split or wb_pages_note out of
vk_memory.cpp and compiled them with stand-ins that know nothing of the overlap, and two read their text.

- take_capture: the overlap's late pages are split by late_defer_split as RX_VK_LATE_DEFER's are, in its own branch, so
  the cut that tests/test_late_defer.py compiles keeps its shape.
- wb_pages_note: the hold reads ov_holding_mem itself instead of a namespace call the cut fixtures lack.
- tests/test_frame_overlap.py checks that frame_overlap.h's note_now is still the rule wb_pages_note follows;
  tests/test_late_fix_build.py and tests/test_late_defer.py get stand-ins for the overlap's names in the sections they cut.

test_direct_buffer_writes, test_invalidate_quick, test_late_defer, test_late_fix_build, test_readback_early,
test_readback_part, test_frame_overlap and test_hos_ab pass.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner

@Beanstalk let's test on/off for all

@Beanstalk let's test on/off for all
Member

Beanstalk test farm · 🔄 testing (9 of 6 reports so far, a failure already)

Commit dae496f · approved by GummiNaomi (reviewed) · dashboard

Done (started 14:36 UTC, last report 21:04 UTC). Comment @Beanstalk to run it again.

Target Result Reports Frame time p99 (ms), switch off → switch on VRAM peak (MB) Crashes
windows ⚠️ couldn't be judged 2 1 2 — — none
linux+nvidia ⚠️ couldn't be judged 2 1 2 — — none
linux+amd ⚠️ couldn't be judged 2 1 2 — — none
windows+amd ❌ fail (an outlier) 2 1 2 24.0 → 22.6 (−6%) — none
windows+intel ⏳ queued 0 of 1 — — —
steamdeck ⚠️ couldn't be judged 1 1 — — none

Why it failed

  • windows+amd: child-market · HOS_NVN_FRAME_OVERLAP=1 (PR only) screenshot.max_diff: limit 0.1

Couldn't be judged: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own.

  • windows, report 1: the pull request's pack failed (exit 1): build.py stopped (exit status 1): Y:\jobs\jb_03b8fefc7a6e55a5\pack\game-work\sa\build\obj\code_053.split.c:344546:33: error: use of undeclared identifier 'uin'
  • windows, report 2: no scenario could be judged: a step ran out of time: timeout: not met in time
  • linux+nvidia, report 1: the pull request's pack failed (exit 1): build.py stopped (exit status 1): <data>/jobs/jb_57c253dd02245659/tree/nx2/../gpu/vk/vk_memory.cpp:4077:28: error: no matching function for call to 'min'
  • linux+nvidia, report 2: the pull request's pack failed (exit 1): build.py stopped (exit status 1): <data>/jobs/jb_0b22e11d0bde3b4a/tree/nx2/../gpu/vk/vk_memory.cpp:4077:28: error: no matching function for call to 'min'
  • linux+amd, report 1: the pull request's pack failed (exit 1): build.py stopped (exit status 1): <data>/jobs/jb_9cbdc551ab053b67/tree/nx2/../gpu/vk/vk_memory.cpp:4077:28: error: no matching function for call to 'min'
  • linux+amd, report 2: the pull request's pack failed (exit 1): build.py stopped (exit status 1): <data>/jobs/jb_d62bf28fcffb20bd/tree/nx2/../gpu/vk/vk_memory.cpp:4077:28: error: no matching function for call to 'min'
  • steamdeck, report 1: the pull request's pack failed (exit 1): build.py stopped (exit status 1): <data>/jobs/jb_22e205c4a9c6d19b/tree/nx2/../gpu/vk/vk_memory.cpp:4077:28: error: no matching function for call to 'min'
What was tested

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

The plan compares overlap enabled with the same PR build's default at the child Market, standing for two minutes after teleporting from kokiri-start. It measures FPS and frame times and compares sampled images; a crash, lower FPS or a substantial image difference fails. Windows, Linux NVIDIA, Linux AMD, Windows AMD, Windows Intel and Steam Deck targets are included; Windows Intel may wait for a matching tester. The farm cannot select CPUs by core count or enable the requested frame trace, so the 16-core-specific question and trace are not isolated; the guard-mode log test is also not included. No tester online now matches windows+intel: that target waits for one.

  • Where: windows (1-2 reports), linux+nvidia (1-2 reports), linux+amd (1-2 reports), windows+amd (1-2 reports), windows+intel (1-2 reports), steamdeck (1-2 reports).
  • Against: the PR itself, switch on (HOS_NVN_FRAME_OVERLAP) and off; main is not built or run.
  • Matrix: 1 cell, each with the switch on and off: HOS_NVN_FRAME_OVERLAP 1 (PR only).
  • child-market: from the repository's save kokiri-start (settings frame_rate_cap=6), then teleport to Market, measure market for 2 min (after 0 s warm-up); 1 run on each side.
  • Measured: crashes, frame times, stutters and hitches, draws and frame rate, screenshots against the switch off.
  • The PR fails if: it crashes; or frame rate is more than 0% below main; or a picture differs from main by more than 5%.
  • Time: about 14 min of game runs per tester (2 game starts), plus the two builds.
Measurements on `windows`, for the PR description

Verdict: could not be judged on windows (2 reports).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4080, 621.1.0 AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0 AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM
Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Nothing was measured: no metric came back.

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame rate) Helps / doesn't help / untested
HOS_NVN_FRAME_OVERLAP switch the PR adds (set on the PR side only) 1 off (the switch's default) the PR's default child-market, main without it → the PR with 1: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on windows (2 reports).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4080, 621.1.0` `AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM`  
Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Nothing was measured: no metric came back.

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: not measured | untested |
Measurements on `linux+nvidia`, for the PR description

Verdict: could not be judged on linux+nvidia (2 reports).

Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 5070, 620.70.6 AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce GTX 1070, 580.196.7 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM
Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Nothing was measured: no metric came back.

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame rate) Helps / doesn't help / untested
HOS_NVN_FRAME_OVERLAP switch the PR adds (set on the PR side only) 1 off (the switch's default) the PR's default child-market, main without it → the PR with 1: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on linux+nvidia (2 reports).

Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.70.6` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1070, 580.196.7` `Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM`  
Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Nothing was measured: no metric came back.

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: not measured | untested |
Measurements on `linux+amd`, for the PR description

Verdict: could not be judged on linux+amd (2 reports).

Hardware: 1: linux+amd+radv+dgpu AMD Steam Machine (RADV NAVI33), 26.1.99 AMD Custom CPU 1772, 16 GB RAM; 2: linux+amd+radv+igpu AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99 AMD Ryzen Z2 Extreme, 32 GB RAM
Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Nothing was measured: no metric came back.

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame rate) Helps / doesn't help / untested
HOS_NVN_FRAME_OVERLAP switch the PR adds (set on the PR side only) 1 off (the switch's default) the PR's default child-market, main without it → the PR with 1: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on linux+amd (2 reports).

Hardware: 1: linux+amd+radv+dgpu `AMD Steam Machine (RADV NAVI33), 26.1.99` `AMD Custom CPU 1772, 16 GB RAM`; 2: linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM`  
Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Nothing was measured: no metric came back.

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: not measured | untested |
Measurements on `windows+amd`, for the PR description

Verdict: fail on windows+amd (2 reports): child-market 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; 2: windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 9 5900X 12-Core Processor, 32 GB RAM
Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: this PR @ dae496f, switch off After: this PR @ dae496f, switch on
child-market · HOS_NVN_FRAME_OVERLAP=1 (PR only) · market · frame rate 61.1 63.2 (+3%)
child-market · HOS_NVN_FRAME_OVERLAP=1 (PR only) · market · frame time (p99) (ms) 24.0 22.6 (−6%)

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame rate) Helps / doesn't help / untested
HOS_NVN_FRAME_OVERLAP switch the PR adds (set on the PR side only) 1 off (the switch's default) the PR's default child-market, main without it → the PR with 1: 61.1 → 63.2 (+3%) helps

As Markdown for the PR description:

## Measurements

**Verdict:** fail on windows+amd (2 reports): `child-market 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`; 2: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 5900X 12-Core Processor, 32 GB RAM`  
Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: this PR @ dae496f, switch off | After: this PR @ dae496f, switch on |
|---|---|---|
| child-market · `HOS_NVN_FRAME_OVERLAP=1 (PR only)` · market · frame rate | 61.1 | 63.2 (+3%) |
| child-market · `HOS_NVN_FRAME_OVERLAP=1 (PR only)` · market · frame time (p99) (ms) | 24.0 | 22.6 (−6%) |

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: 61.1 → 63.2 (+3%) | helps |
Measurements on `steamdeck`, for the PR description

Verdict: could not be judged on steamdeck (1 report).

Hardware: 1: linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 12 GB RAM
Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 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)

Nothing was measured: no metric came back.

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame rate) Helps / doesn't help / untested
HOS_NVN_FRAME_OVERLAP switch the PR adds (set on the PR side only) 1 off (the switch's default) the PR's default child-market, main without it → the PR with 1: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on steamdeck (1 report).

Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM`  
Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 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)

Nothing was measured: no metric came back.

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: not measured | untested |
The testers' hardware
Target Report Ran on
windows 1 windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4080, 621.1.0 AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAM
windows 2 windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0 AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM
linux+nvidia 1 linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 5070, 620.70.6 AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM
linux+nvidia 2 linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce GTX 1070, 580.196.7 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM
linux+amd 1 linux+amd+radv+dgpu AMD Steam Machine (RADV NAVI33), 26.1.99 AMD Custom CPU 1772, 16 GB RAM
linux+amd 2 linux+amd+radv+igpu AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99 AMD Ryzen Z2 Extreme, 32 GB RAM
windows+amd 1 windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM
windows+amd 2 windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 9 5900X 12-Core Processor, 32 GB RAM
steamdeck 1 linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 12 GB RAM
<!-- beanstalk:sticky --> ### Beanstalk test farm · 🔄 testing (9 of 6 reports so far, a failure already) Commit `dae496f` · approved by GummiNaomi (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/1811) Done (started 14:36 UTC, last report 21:04 UTC). Comment `@Beanstalk` to run it again. | Target | Result | Reports | Frame time p99 (ms), switch off → switch on | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `windows` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_5f5d60f8bfdee07c) [2](https://beanstalk.magicbean.dev/reports/rp_a9e1c5525dcc4c2e) | — | — | none | | `linux+nvidia` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_9965a50b1a986f9e) [2](https://beanstalk.magicbean.dev/reports/rp_b6052e83255a942a) | — | — | none | | `linux+amd` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_94348ce735ccc5fa) [2](https://beanstalk.magicbean.dev/reports/rp_2e92e8d0132d646f) | — | — | none | | `windows+amd` | ❌ fail (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_471283aedd20d375) [2](https://beanstalk.magicbean.dev/reports/rp_4206b88c1f2b0e74) | 24.0 → 22.6 (−6%) | — | none | | `windows+intel` | ⏳ queued | 0 of 1 | — | — | — | | `steamdeck` | ⚠️ couldn't be judged | 1 [1](https://beanstalk.magicbean.dev/reports/rp_50407ef1e483a118) | — | — | none | **Why it failed** - `windows+amd`: `child-market · HOS_NVN_FRAME_OVERLAP=1 (PR only)` `screenshot.max_diff`: `limit 0.1` **Couldn't be judged**: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own. - `windows`, [report 1](https://beanstalk.magicbean.dev/reports/rp_5f5d60f8bfdee07c): `the pull request's pack failed (exit 1): build.py stopped (exit status 1): Y:\jobs\jb_03b8fefc7a6e55a5\pack\game-work\sa\build\obj\code_053.split.c:344546:33: error: use of undeclared identifier 'uin'` - `windows`, [report 2](https://beanstalk.magicbean.dev/reports/rp_a9e1c5525dcc4c2e): `no scenario could be judged: a step ran out of time: timeout: not met in time` - `linux+nvidia`, [report 1](https://beanstalk.magicbean.dev/reports/rp_9965a50b1a986f9e): `the pull request's pack failed (exit 1): build.py stopped (exit status 1): <data>/jobs/jb_57c253dd02245659/tree/nx2/../gpu/vk/vk_memory.cpp:4077:28: error: no matching function for call to 'min'` - `linux+nvidia`, [report 2](https://beanstalk.magicbean.dev/reports/rp_b6052e83255a942a): `the pull request's pack failed (exit 1): build.py stopped (exit status 1): <data>/jobs/jb_0b22e11d0bde3b4a/tree/nx2/../gpu/vk/vk_memory.cpp:4077:28: error: no matching function for call to 'min'` - `linux+amd`, [report 1](https://beanstalk.magicbean.dev/reports/rp_94348ce735ccc5fa): `the pull request's pack failed (exit 1): build.py stopped (exit status 1): <data>/jobs/jb_9cbdc551ab053b67/tree/nx2/../gpu/vk/vk_memory.cpp:4077:28: error: no matching function for call to 'min'` - `linux+amd`, [report 2](https://beanstalk.magicbean.dev/reports/rp_2e92e8d0132d646f): `the pull request's pack failed (exit 1): build.py stopped (exit status 1): <data>/jobs/jb_d62bf28fcffb20bd/tree/nx2/../gpu/vk/vk_memory.cpp:4077:28: error: no matching function for call to 'min'` - `steamdeck`, [report 1](https://beanstalk.magicbean.dev/reports/rp_50407ef1e483a118): `the pull request's pack failed (exit 1): build.py stopped (exit status 1): <data>/jobs/jb_22e205c4a9c6d19b/tree/nx2/../gpu/vk/vk_memory.cpp:4077:28: error: no matching function for call to 'min'` <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) The plan compares overlap enabled with the same PR build's default at the child Market, standing for two minutes after teleporting from kokiri-start. It measures FPS and frame times and compares sampled images; a crash, lower FPS or a substantial image difference fails. Windows, Linux NVIDIA, Linux AMD, Windows AMD, Windows Intel and Steam Deck targets are included; Windows Intel may wait for a matching tester. The farm cannot select CPUs by core count or enable the requested frame trace, so the 16-core-specific question and trace are not isolated; the guard-mode log test is also not included. No tester online now matches windows+intel: that target waits for one. - **Where:** windows (1-2 reports), linux+nvidia (1-2 reports), linux+amd (1-2 reports), windows+amd (1-2 reports), windows+intel (1-2 reports), steamdeck (1-2 reports). - **Against:** the PR itself, switch on (`HOS_NVN_FRAME_OVERLAP`) and off; main is not built or run. - **Matrix:** 1 cell, each with the switch on and off: HOS_NVN_FRAME_OVERLAP `1` (PR only). - **child-market:** from the repository's save `kokiri-start` (settings frame_rate_cap=6), then teleport to Market, measure market for 2 min (after 0 s warm-up); 1 run on each side. - **Measured:** crashes, frame times, stutters and hitches, draws and frame rate, screenshots against the switch off. - **The PR fails if:** it crashes; or frame rate is more than 0% below main; or a picture differs from main by more than 5%. - **Time:** about 14 min of game runs per tester (2 game starts), plus the two builds. </details> <details><summary>Measurements on `windows`, for the PR description</summary> **Verdict:** could not be judged on windows (2 reports). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4080, 621.1.0` `AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on windows (2 reports). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4080, 621.1.0` `AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: not measured | untested | ``` </details> <details><summary>Measurements on `linux+nvidia`, for the PR description</summary> **Verdict:** could not be judged on linux+nvidia (2 reports). Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.70.6` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1070, 580.196.7` `Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM` Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on linux+nvidia (2 reports). Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.70.6` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1070, 580.196.7` `Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM` Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: not measured | untested | ``` </details> <details><summary>Measurements on `linux+amd`, for the PR description</summary> **Verdict:** could not be judged on linux+amd (2 reports). Hardware: 1: linux+amd+radv+dgpu `AMD Steam Machine (RADV NAVI33), 26.1.99` `AMD Custom CPU 1772, 16 GB RAM`; 2: linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM` Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on linux+amd (2 reports). Hardware: 1: linux+amd+radv+dgpu `AMD Steam Machine (RADV NAVI33), 26.1.99` `AMD Custom CPU 1772, 16 GB RAM`; 2: linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM` Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: not measured | untested | ``` </details> <details><summary>Measurements on `windows+amd`, for the PR description</summary> **Verdict:** fail on windows+amd (2 reports): `child-market 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`; 2: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 5900X 12-Core Processor, 32 GB RAM` Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: this PR @ dae496f, switch off | After: this PR @ dae496f, switch on | |---|---|---| | child-market · `HOS_NVN_FRAME_OVERLAP=1 (PR only)` · market · frame rate | 61.1 | 63.2 (+3%) | | child-market · `HOS_NVN_FRAME_OVERLAP=1 (PR only)` · market · frame time (p99) (ms) | 24.0 | 22.6 (−6%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: 61.1 → 63.2 (+3%) | helps | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** fail on windows+amd (2 reports): `child-market 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`; 2: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 5900X 12-Core Processor, 32 GB RAM` Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: this PR @ dae496f, switch off | After: this PR @ dae496f, switch on | |---|---|---| | child-market · `HOS_NVN_FRAME_OVERLAP=1 (PR only)` · market · frame rate | 61.1 | 63.2 (+3%) | | child-market · `HOS_NVN_FRAME_OVERLAP=1 (PR only)` · market · frame time (p99) (ms) | 24.0 | 22.6 (−6%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: 61.1 → 63.2 (+3%) | helps | ``` </details> <details><summary>Measurements on `steamdeck`, for the PR description</summary> **Verdict:** could not be judged on steamdeck (1 report). Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM` Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 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) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on steamdeck (1 report). Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM` Scene: child-market, from the repository's save kokiri-start (frame_rate_cap=6); each cell's settings and switches as the table names them Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); child-market: 1 game start a side, market 120 s after 0 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) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame rate) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `HOS_NVN_FRAME_OVERLAP` | switch the PR adds (set on the PR side only) | `1` | off (the switch's default) | the PR's default | child-market, main without it → the PR with 1: not measured | untested | ``` </details> <details><summary>The testers' hardware</summary> | Target | Report | Ran on | | --- | --- | --- | | `windows` | [1](https://beanstalk.magicbean.dev/reports/rp_5f5d60f8bfdee07c) | windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4080, 621.1.0` `AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAM` | | `windows` | [2](https://beanstalk.magicbean.dev/reports/rp_a9e1c5525dcc4c2e) | windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` | | `linux+nvidia` | [1](https://beanstalk.magicbean.dev/reports/rp_9965a50b1a986f9e) | linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.70.6` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM` | | `linux+nvidia` | [2](https://beanstalk.magicbean.dev/reports/rp_b6052e83255a942a) | linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1070, 580.196.7` `Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM` | | `linux+amd` | [1](https://beanstalk.magicbean.dev/reports/rp_94348ce735ccc5fa) | linux+amd+radv+dgpu `AMD Steam Machine (RADV NAVI33), 26.1.99` `AMD Custom CPU 1772, 16 GB RAM` | | `linux+amd` | [2](https://beanstalk.magicbean.dev/reports/rp_2e92e8d0132d646f) | linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM` | | `windows+amd` | [1](https://beanstalk.magicbean.dev/reports/rp_471283aedd20d375) | windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM` | | `windows+amd` | [2](https://beanstalk.magicbean.dev/reports/rp_4206b88c1f2b0e74) | windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 5900X 12-Core Processor, 32 GB RAM` | | `steamdeck` | [1](https://beanstalk.magicbean.dev/reports/rp_50407ef1e483a118) | linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM` | </details>
GummiNaomi force-pushed perf/frame-overlap-hold from 2691c8aa29
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
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 13s
CI / Workflow lint (actionlint) (pull_request) Successful in 14s
Third-party parts / As their notes say (pull_request) Successful in 15s
PR description / Description follows the template (pull_request_target) Failing after 5s
beanstalk/approval held by the security check: see the farm's comment
to dae496fd7d
Some checks reported errors
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
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 14s
CI / Workflow lint (actionlint) (pull_request) Successful in 14s
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Failing after 7s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by GummiNaomi (reviewed)
beanstalk/windows 0/1 pass, 2 error
beanstalk/linux+nvidia 0/1 pass, 2 error
beanstalk/linux+amd 0/1 pass, 2 error
beanstalk/windows+amd 2/1 fail
beanstalk/windows+intel 0/1 pass, 0 running, 0 queued
beanstalk/steamdeck 0/1 pass, 1 error
CI / Website build and checks (pull_request) Failing after 8m53s
2026-11-20 14:34:38 +00:00
Compare
Author
Member

Thanks, @futondestroyer. Redesigned onto main after #1763 (on main 89c3d21e; head dae496fd: the code commit ba5c13b2, which the numbers below come from, then a test fixture's stand-in, the held-slot check's fatal call in a function of its own and this round's docs/tested). Each blocking point:

  1. Held work before the signal (bound, present, timeout). Every forced release is gone: ov_release is called only from the signal's job and from a recording's end once that signal is handed over. At the bound (frame_overlap::hold_full, 40) the hold records nothing more until the signal: split_part ends no part, submit_job puts a submit in its queue's list with its memory work done, schedule and drain let nothing on; the release lets them on after the held work (ov_resume_left). A present waits behind the hold as behind any unmet CPU wait (cpu_wait_unmet); if it is made after RX_VK_HOLD_MS, its own recording is held with the rest. The 1 s gate release is removed, and a held slot coming round is a fatal error that a static_assert on the bound makes impossible. Test: tests/frame_overlap_test.cpp now checks every read against the console's in every run, past the bound included (the old test skipped it there), plus a run with each present handed over in the next frame's hold, and that no recording is sent in a hold. With the old behaviour put back in the model (the bound or a present releasing), those runs fail ("the meter's readback did not find the frame before's sum"); a header with no bound fails ("more than kMaxHeld recordings held").
  2. Release by address. The hold keeps its whole wait (event, mode, value) and a number. event_signal_queued marks the signal's job with that number only when its value meets the wait (frame_overlap::Wait::released_by, the same rule event_wait_met now uses), and only that number releases, at the job or between recordings. Test: a run where the CPU signals the frame's event with another value before calcGPU's writes; with release by address (a broken variant) it fails, and the ledger's unit check covers a wrong value, a reset to 0 and another event.
  3. Live 1→0 and capture before eligibility. The host tells the renderer 0 once when the switch turns off, at any limiter's wait (rx_frame_overlap_tell in gpu/render/rx_nvn.h, used by frame_overlap_at_wait). The renderer then turns the late-page option off and clears an armed wait; a hold under way still ends at its own signal. The late-page option follows frame_overlap::late_capture: the switch on and a setup that can hold (render thread, no batched submits, VRAM mirrors, no uniform snapshots), apart from each frame's facts. Test: switch_transitions runs 0 → 1 → 0 → 2 → 0 through the host's rule and the renderer's, and the refused setups. Broken variants (off never told, capture whatever the setup) fail.
  4. Host pointer swap. The guard's wrappers now go into the host's own table at the renderer's entry, right after it is copied and before any renderer thread starts (frame_overlap_watch_install, from vk_main.cpp). Nothing ever assigns host again, and the source check says so. The guard is chosen at the start (=2, or an A/B to 2); asked for later, it runs as =1 and the log says so. The probe (=3) is removed.

#1763's parallel replay is gone, so nothing refuses on that any more.

Measured on main 89c3d21e: one ABBA round on 4 cores in Castle Town's market, standing (RTX 4070 SUPER, 9950X3D, headless, uncapped). main 76.7 / 76.4 fps, this PR with the switch on 76.8 / 77.8 fps: +1.0 %, within the spread. Frames over 16.7 ms 0.7 → 0.9 %, none over 33 ms. Every frame held was released at its signal, with 0.83 to 0.89 recordings held each, the bound never reached, no present in a hold, and no error. That is no longer the 2 % loss on 4 cores of the old design. 16 cores, the guard, windowed play and other platforms are left to the Test Farm (Still to test); the switch stays off until they report.

Thanks, @futondestroyer. Redesigned onto main after #1763 (on main 89c3d21e; head dae496fd: the code commit ba5c13b2, which the numbers below come from, then a test fixture's stand-in, the held-slot check's fatal call in a function of its own and this round's docs/tested). Each blocking point: 1. **Held work before the signal (bound, present, timeout).** Every forced release is gone: `ov_release` is called only from the signal's job and from a recording's end once that signal is handed over. At the bound (`frame_overlap::hold_full`, 40) the hold records nothing more until the signal: `split_part` ends no part, `submit_job` puts a submit in its queue's list with its memory work done, `schedule` and `drain` let nothing on; the release lets them on after the held work (`ov_resume_left`). A present waits behind the hold as behind any unmet CPU wait (`cpu_wait_unmet`); if it is made after `RX_VK_HOLD_MS`, its own recording is held with the rest. The 1 s gate release is removed, and a held slot coming round is a fatal error that a static_assert on the bound makes impossible. Test: `tests/frame_overlap_test.cpp` now checks every read against the console's in every run, past the bound included (the old test skipped it there), plus a run with each present handed over in the next frame's hold, and that no recording is sent in a hold. With the old behaviour put back in the model (the bound or a present releasing), those runs fail ("the meter's readback did not find the frame before's sum"); a header with no bound fails ("more than kMaxHeld recordings held"). 2. **Release by address.** The hold keeps its whole wait (event, mode, value) and a number. `event_signal_queued` marks the signal's job with that number only when its value meets the wait (`frame_overlap::Wait::released_by`, the same rule `event_wait_met` now uses), and only that number releases, at the job or between recordings. Test: a run where the CPU signals the frame's event with another value before calcGPU's writes; with release by address (a broken variant) it fails, and the ledger's unit check covers a wrong value, a reset to 0 and another event. 3. **Live 1→0 and capture before eligibility.** The host tells the renderer 0 once when the switch turns off, at any limiter's wait (`rx_frame_overlap_tell` in `gpu/render/rx_nvn.h`, used by `frame_overlap_at_wait`). The renderer then turns the late-page option off and clears an armed wait; a hold under way still ends at its own signal. The late-page option follows `frame_overlap::late_capture`: the switch on and a setup that can hold (render thread, no batched submits, VRAM mirrors, no uniform snapshots), apart from each frame's facts. Test: `switch_transitions` runs 0 → 1 → 0 → 2 → 0 through the host's rule and the renderer's, and the refused setups. Broken variants (off never told, capture whatever the setup) fail. 4. **Host pointer swap.** The guard's wrappers now go into the host's own table at the renderer's entry, right after it is copied and before any renderer thread starts (`frame_overlap_watch_install`, from `vk_main.cpp`). Nothing ever assigns `host` again, and the source check says so. The guard is chosen at the start (`=2`, or an A/B to 2); asked for later, it runs as `=1` and the log says so. The probe (`=3`) is removed. #1763's parallel replay is gone, so nothing refuses on that any more. Measured on main 89c3d21e: one ABBA round on 4 cores in Castle Town's market, standing (RTX 4070 SUPER, 9950X3D, headless, uncapped). main 76.7 / 76.4 fps, this PR with the switch on 76.8 / 77.8 fps: +1.0 %, within the spread. Frames over 16.7 ms 0.7 → 0.9 %, none over 33 ms. Every frame held was released at its signal, with 0.83 to 0.89 recordings held each, the bound never reached, no present in a hold, and no error. That is no longer the 2 % loss on 4 cores of the old design. 16 cores, the guard, windowed play and other platforms are left to the Test Farm (Still to test); the switch stays off until they report.
Author
Member

@Beanstalk windows (a 16-core or larger CPU), linux+nvidia, linux+amd, windows+amd, windows+intel and steamdeck: Castle Town's market (child), standing 2 minutes after a teleport from kokiri-start, RX_VK_FRAME_TRACE=1, HOS_NVN_FRAME_OVERLAP=1 against unset. Expecting no crash, no flicker and fps no lower than unset; on the 16-core PC whether =1 is faster (it was +7.5 % there before main's render-thread rewrite, and within the spread on 4 cores here). On one Windows PC also HOS_NVN_FRAME_OVERLAP=2 set at the start, expecting the log's guard counts at 0 and every vk: HOS_NVN_FRAME_OVERLAP (600 presents) line saying released at the signal, the bound reached 0 times.

(The farm's runs on #1846 and #1847 today ended in error before building: its checkout of main failed git rev-parse --verify HEAD^{commit} in packs.py's cmd_base.)

@Beanstalk windows (a 16-core or larger CPU), linux+nvidia, linux+amd, windows+amd, windows+intel and steamdeck: Castle Town's market (child), standing 2 minutes after a teleport from kokiri-start, `RX_VK_FRAME_TRACE=1`, `HOS_NVN_FRAME_OVERLAP=1` against unset. Expecting no crash, no flicker and fps no lower than unset; on the 16-core PC whether `=1` is faster (it was +7.5 % there before main's render-thread rewrite, and within the spread on 4 cores here). On one Windows PC also `HOS_NVN_FRAME_OVERLAP=2` set at the start, expecting the log's guard counts at 0 and every `vk: HOS_NVN_FRAME_OVERLAP (600 presents)` line saying released at the signal, the bound reached 0 times. (The farm's runs on #1846 and #1847 today ended in `error` before building: its checkout of main failed `git rev-parse --verify HEAD^{commit}` in packs.py's cmd_base.)
Author
Member

Closing. #1866 (the recorder takes a whole part and submits it) changed the submit path this hold sits on, so a rebase means redesigning the hold on top of it, and the frame overlap showed no gain on 4 cores on current main (+1 % at most, within the spread). #1866 also takes away much of the render thread's waiting that the overlap was after. Thanks @futondestroyer for the reviews.

Closing. #1866 (the recorder takes a whole part and submits it) changed the submit path this hold sits on, so a rebase means redesigning the hold on top of it, and the frame overlap showed no gain on 4 cores on current main (+1 % at most, within the spread). #1866 also takes away much of the render thread's waiting that the overlap was after. Thanks @futondestroyer for the reviews.
GummiNaomi closed this pull request 2026-11-20 21:10:59 +00:00
Some checks reported errors
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
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 14s
CI / Workflow lint (actionlint) (pull_request) Successful in 14s
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Failing after 7s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by GummiNaomi (reviewed)
beanstalk/windows 0/1 pass, 2 error
beanstalk/linux+nvidia 0/1 pass, 2 error
beanstalk/linux+amd 0/1 pass, 2 error
beanstalk/windows+amd 2/1 fail
beanstalk/windows+intel 0/1 pass, 0 running, 0 queued
beanstalk/steamdeck 0/1 pass, 1 error
CI / Website build and checks (pull_request) Failing after 8m53s

Pull request closed

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!1811
No description provided.