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
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1811
Loading…
Reference in a new issue
No description provided.
Delete branch "GummiNaomi/Longshot:perf/frame-overlap-hold"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
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=1the 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(headdae496fd, on main89c3d21e):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).frame_overlap::Wait::released_by, the same rule asevent_wait_met). A signal of the same event with another value releases nothing.rx_frame_overlap_tellingpu/render/rx_nvn.h); the renderer then clears the late-page capture option and any armed wait. The capture option followslate_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.=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, theov_full()checks insplit_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-startsave, 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.pypasses, 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_recordandtest_readback_partcut code this PR had changed (a second declaration ofreplay_fatal,schedule()'s newov_full()), fixed indae496fdand passing on both;test_recording_admission(Windows) andtest_prepare_stall(WSL, a timing check under 8 jobs) passed when run again alone. Afterdae496fdonly those andtest_frame_overlapwere run again, on both. Not run here: 16 cores, windowed, the guard (=2), Linux, other GPUs.Still to test:
HOS_NVN_FRAME_OVERLAP=1against 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)HOS_NVN_FRAME_OVERLAP=2set at the start, expecting the log's guard counts at 0 and no flicker, and everyvk: 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)HOS_NVN_FRAME_OVERLAP=1against unset, expecting fps at least unset's and no flicker (@Beanstalk windows, the three areas windowed, HOS_NVN_FRAME_OVERLAP=1 against unset)HOS_NVN_FRAME_OVERLAP=1against 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-startsave; 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.89c3d21eba5c13b2,HOS_NVN_FRAME_OVERLAP=1Measured at
ba5c13b2, this PR's code commit. The head,dae496fd, adds this round'sdocs/testedfiles, 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
HOS_NVN_FRAME_OVERLAP1on;2on with its guard (set at the start)HOS_ABis 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: leaveHOS_NVN_FRAME_OVERLAPunset; a live A/B to 0 is told to the renderer and clears its state.MKWVK_API_VERSION36: 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
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (Notmiseitself: the checks that read the changed files, on Windows and in WSL, as Testing says; the failures there also fail on main.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (The review's points: the model's new runs fail with the old forced releases, and the broken variants fail.)gpu/vk/switches.def.tests/that reads changed source is updated, not weakened.MKWVK_API_VERSIONbumped (MkwVkHostorMkwVkRendereringpu/vk/vk_api.hchanged).Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
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:
a44c3d3bagainst0de25c3e, 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
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–631currently skips that assertion there.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.host/nvn_native.c:1190–1193andgpu/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.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.
@ -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)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);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)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());Send the off transition too and clear renderer capture state.
@Beanstalk let's test on/off for all
Beanstalk test farm · 🔄 testing (9 of 6 reports so far, a failure already)
Commit
dae496f· approved by GummiNaomi (reviewed) · dashboardDone (started 14:36 UTC, last report 21:04 UTC). Comment
@Beanstalkto run it again.windowslinux+nvidialinux+amdwindows+amdwindows+intelsteamdeckWhy it failed
windows+amd:child-market · HOS_NVN_FRAME_OVERLAP=1 (PR only)screenshot.max_diff:limit 0.1Couldn'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 timelinux+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.
HOS_NVN_FRAME_OVERLAP) and off; main is not built or run.1(PR only).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.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.0AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpuNVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAMScene: 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 (
@Beanstalkon this PR runs it again)Nothing was measured: no metric came back.
Flags and settings
HOS_NVN_FRAME_OVERLAP1As Markdown for the PR description:
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.6AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpuNVIDIA GeForce GTX 1070, 580.196.7Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAMScene: 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 (
@Beanstalkon this PR runs it again)Nothing was measured: no metric came back.
Flags and settings
HOS_NVN_FRAME_OVERLAP1As Markdown for the PR description:
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.99AMD Custom CPU 1772, 16 GB RAM; 2: linux+amd+radv+igpuAMD Radeon 890M Graphics (RADV STRIX1), 26.1.99AMD Ryzen Z2 Extreme, 32 GB RAMScene: 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 (
@Beanstalkon this PR runs it again)Nothing was measured: no metric came back.
Flags and settings
HOS_NVN_FRAME_OVERLAP1As Markdown for the PR description:
Measurements on `windows+amd`, for the PR description
Verdict: fail on windows+amd (2 reports):
child-market screenshot.max_difffailed.Hardware: 1: windows+amd+amd-proprietary+dgpu
AMD Radeon RX 9070 XT, 2.0.416AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM; 2: windows+amd+amd-proprietary+dgpuAMD Radeon RX 9070 XT, 2.0.416AMD Ryzen 9 5900X 12-Core Processor, 32 GB RAMScene: 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 (
@Beanstalkon this PR runs it again)dae496f, switch offdae496f, switch onHOS_NVN_FRAME_OVERLAP=1 (PR only)· market · frame rateHOS_NVN_FRAME_OVERLAP=1 (PR only)· market · frame time (p99) (ms)Flags and settings
HOS_NVN_FRAME_OVERLAP1As Markdown for the PR description:
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.99AMD Custom APU 0405, 12 GB RAMScene: 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 (
@Beanstalkon this PR runs it again)Nothing was measured: no metric came back.
Flags and settings
HOS_NVN_FRAME_OVERLAP1As Markdown for the PR description:
The testers' hardware
windowsNVIDIA GeForce RTX 4080, 621.1.0AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAMwindowsNVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAMlinux+nvidiaNVIDIA GeForce RTX 5070, 620.70.6AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMlinux+nvidiaNVIDIA GeForce GTX 1070, 580.196.7Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAMlinux+amdAMD Steam Machine (RADV NAVI33), 26.1.99AMD Custom CPU 1772, 16 GB RAMlinux+amdAMD Radeon 890M Graphics (RADV STRIX1), 26.1.99AMD Ryzen Z2 Extreme, 32 GB RAMwindows+amdAMD Radeon RX 9070 XT, 2.0.416AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAMwindows+amdAMD Radeon RX 9070 XT, 2.0.416AMD Ryzen 9 5900X 12-Core Processor, 32 GB RAMsteamdeckAMD Custom GPU 0405 (RADV VANGOGH), 26.1.99AMD Custom APU 0405, 12 GB RAM2691c8aa29dae496fd7dThanks, @futondestroyer. Redesigned onto main after #1763 (on main
89c3d21e; headdae496fd: the code commitba5c13b2, 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:ov_releaseis 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_partends no part,submit_jobputs a submit in its queue's list with its memory work done,scheduleanddrainlet 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 afterRX_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.cppnow 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").event_signal_queuedmarks the signal's job with that number only when its value meets the wait (frame_overlap::Wait::released_by, the same ruleevent_wait_metnow 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.rx_frame_overlap_tellingpu/render/rx_nvn.h, used byframe_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 followsframe_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_transitionsruns 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.frame_overlap_watch_install, fromvk_main.cpp). Nothing ever assignshostagain, 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=1and 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.@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=1against unset. Expecting no crash, no flicker and fps no lower than unset; on the 16-core PC whether=1is faster (it was +7.5 % there before main's render-thread rewrite, and within the spread on 4 cores here). On one Windows PC alsoHOS_NVN_FRAME_OVERLAP=2set at the start, expecting the log's guard counts at 0 and everyvk: 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
errorbefore building: its checkout of main failedgit rev-parse --verify HEAD^{commit}in packs.py's cmd_base.)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.
Pull request closed