WIP: perf(vk): RX_VK_CHECKPOINTS is off by default, the NVIDIA draw markers only where asked #2836
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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!2836
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:perf/checkpoints-off-by-default"
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
RX_VK_CHECKPOINTSis off by default. On NVIDIA the renderer wrote a marker before every draw and dispatch (a store into a 65k ring and avkCmdSetCheckpointNV), so that after a lost device the log names the draw. That costs recording time on every draw. Now the markers are written only when asked:RX_VK_CHECKPOINTS=1turns them on (and the AMD buffer markers where NVIDIA's are missing),extenables the NVIDIA extension alone,0is off. The switch's row moves fromkilltodiag.On AMD and Intel nothing changes: their markers were already off unless
RX_VK_CHECKPOINTS=1was set, and the NVIDIA extension isn't there.Read first:
gpu/vk/vk_main.cpp(the extension request, ~line 493) and the row ingpu/vk/switches.def.Why they were on: the code comment says that on NVIDIA Windows (nvlddmkm event 153) the device was lost every run, shortly after OoT's first gameplay frames, without the markers, and not with them (five runs); the extension alone (
ext) did not keep it. The race they hide was never found. This PR does not fix it.Testing
Tested: Linux (CachyOS 7.3), RTX 3090, Hyrule Field and Market, via the Debug-tab teleport. 9 timed runs with the markers off (18 runs with the on side) (
RX_VK_CHECKPOINTS=0on a build from before this change, the same behaviour this PR makes the default): no device lost, no hang. This PR's own build has not run. Game-free checks (mise run test) not run.Still to test:
@Beanstalk, Windows NVIDIA). This is the platform the markers were put in for; the PR stays WIP until it runs clean.@Beanstalk).vkGetDeviceFaultInfoEXT"has not come back after a fault" on NVIDIA, so the report may be empty; check what a crash report then holds (by hand, orHOS_CRASH_TEST).Measurements
Verdict: a gain of about 8 % fps on Hyrule Field at 1080p, but within the runs' spread (a different batch at 67 % and the Market showed no gain). By the standards, not yet a measured gain.
Setup: Linux 7.3.3-1-cachyos, RTX 3090 (driver not logged by
dev.py ab), window 3840x2049, output 1920x1080, render resolution 100 %, no upscaler, frame generation off, V-Sync off, uncapped; 60 s after a warm-up, interleaved A/B, the median. Both sides one runtime (v3.2.0-136-g4f9785931-dirty), the switch unset against=0.B was faster in all four pairs (+2.9, +9.0, +2.0, +14.5 %), but the ranges overlap (A 115.4 to 135.8, B 125.8 to 139.8).
Other runs, same PC:
Not profiled: that the frame is CPU-bound in these scenes is not shown. The pipe timestamps (
vk_replay.cpp) are not measured. A 5070 (Rekarina measured the equivalent draw mark at 4-8 %) has not run.Risks
RX_VK_CHECKPOINTS=1). The PR stays WIP until a Windows NVIDIA run is clean.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses. (Not run.)main, or Measurements says why there is nothing to measure. (Within the spread.)third_party/untouched; nothing GPL-incompatible.When it applies
gpu/vk/switches.def. (The measurements do not yet choose it.)docs/dev/reference/switches.md).Assisted-by:/Co-Authored-By:trailers.🤖 Generated with Claude Code
Tested in game: Linux CachyOS 7.3, RTX 3090, Hyrule Field and Market: about 22 timed runs with RX_VK_CHECKPOINTS=0 on a build from before this change (the behaviour this PR makes the default); no device lost. This PR's own build has not run; Windows NVIDIA not run.
Correction to the first comment: 9 timed runs with RX_VK_CHECKPOINTS=0 (18 runs counting the markers-on side), not about 22. No device lost in any of them.
Possibly related, for context:
@beanstalk
Beanstalk test farm · 🔄 testing (5 of 4 reports so far, a failure already)
Commit
041600c· approved by HumanBean (reviewed) · dashboard⚠️ Note: The starts use a post-opening checkpoint rather than playing through a new game; the headless run cannot check Windows event 153 or reproduce window presentation behavior.
⚠️ Note: The plan does not force a device loss or assess the resulting crash report, and does not test the explicit 1 or ext switch modes.
⚠️ Note: The claimed roughly 8% FPS gain is within the reported spread; these short headless samples can expose larger regressions but cannot establish that gain reliably.
Started at 2026-11-29 23:13 UTC.
Estimate: done in about 55 min, from the queue and the testers online now; some jobs can't start yet.
windows+nvidialinux+nvidiaamdintelWhy it failed
windows+nvidia:early-field-marketscreenshot.max_diff:0.1 → 0.8; limit 0.2windows+nvidia:early-field-marketfield.frametime_p99_ms.max_delta_pct:32.0 → 43.7 (+36.7%); limit 15.0windows+nvidia:early-field-marketfield.frametime_1pct_low_ms.max_delta_pct:32.7 → 45.5 (+39.3%); limit 15.0amd:early-field-marketscreenshot.max_diff:0.6 → 0.8; limit 0.2amd:early-field-marketfield.frametime_p99_ms.max_delta_pct:22.9 → 31.8 (+38.8%); limit 15.0amd:early-field-marketfield.frametime_1pct_low_ms.max_delta_pct:26.4 → 36.3 (+37.4%); limit 15.0Couldn'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.
amd, report 2:Insufficient frame-time evidence for 4 required comparison(s). See rule results. a step ran out of time at step 3 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)What was tested
What will be tested · AI plan (
gpt-6.1-terra)Five alternating starts per build exercise early gameplay, Hyrule Field and Market on Windows and Linux NVIDIA, plus AMD and Intel PCs. The approximately 59-minute run measures frame times and compares still images against main. A crash, device-lost log, substantial frame-time regression or excessive picture difference fails the plan; a clean result does not prove the historical Windows race is fixed.
kokiri-start, then teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 5 s warm-up), teleport to Market, take the picture market to compare with main, measure market for 20 s (after 5 s warm-up); 5 runs on each side.Measurements on `windows+nvidia`, for the PR description
Verdict: fail on windows+nvidia (2 reports):
early-field-market screenshot.max_diff;early-field-market field.frametime_p99_ms.max_delta_pct (+36.7%);early-field-market field.frametime_1pct_low_ms.max_delta_pct (+39.3%)failed.Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu
NVIDIA GeForce RTX 4070, 621.24.0AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu+xessNVIDIA GeForce GTX 980, 582.78.0Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz, 32 GB RAMScene: early-field-market, from the repository's save kokiri-start; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); early-field-market: 5 game starts a side, field 20 s after 5 s warm-up, market 20 s after 5 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)6f5f99f041600cFlags and settings
None: the plan varied no setting, switch or build option.
As Markdown for the PR description:
Measurements on `linux+nvidia`, for the PR description
Verdict: pass on linux+nvidia (1 report): no rule failed and no PR run crashed.
Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu
NVIDIA GeForce RTX 5070, 620.73.4AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMScene: early-field-market, from the repository's save kokiri-start; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); early-field-market: 5 game starts a side, field 20 s after 5 s warm-up, market 20 s after 5 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)6f5f99f041600cFlags and settings
None: the plan varied no setting, switch or build option.
As Markdown for the PR description:
Measurements on `amd`, for the PR description
Verdict: fail on amd (2 reports):
early-field-market screenshot.max_diff;early-field-market field.frametime_p99_ms.max_delta_pct (+38.8%);early-field-market field.frametime_1pct_low_ms.max_delta_pct (+37.4%)failed.Hardware: 1: linux+amd+radv+dgpu
AMD Radeon RX 580 Series (RADV POLARIS10), 26.3.1AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAM; 2: windows+amd+amd-proprietary+igpu+xessAMD Radeon(TM) Graphics, 2.0.279AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAMScene: early-field-market, from the repository's save kokiri-start; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); early-field-market: 5 game starts a side, field 20 s after 5 s warm-up, market 20 s after 5 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)6f5f99f041600cFlags and settings
None: the plan varied no setting, switch or build option.
As Markdown for the PR description:
The testers' hardware
windows+nvidiaNVIDIA GeForce RTX 4070, 621.24.0AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAMwindows+nvidiaNVIDIA GeForce GTX 980, 582.78.0Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz, 32 GB RAMlinux+nvidiaNVIDIA GeForce RTX 5070, 620.73.4AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMamdAMD Radeon RX 580 Series (RADV POLARIS10), 26.3.1AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAMamdAMD Radeon(TM) Graphics, 2.0.279AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAMTested on Windows 11, RTX 4070 SUPER 12 GB, driver 621.24, Ryzen 9 9900X: main
cb0a27630(v3.2.0-153-gcb0a27630),RX_VK_CHECKPOINTSunset (the markers on) against=0(this PR's default), one build. 8 runs, 2 a side, interleaved (4K on / off, 1080p on / off, twice), automated walking route Market - Castle - Market from a save, headless, DLAA, uncapped, V-Sync off, shaders loaded at start (RX_VK_LOAD=start), frame gate off. Measured on the second Market stay from 5 s after its entry (about 54 s).No device lost in the 8 runs: no "device lost" in the logs, no nvlddmkm event in Windows' System log over that time. The runs start from a save after the opening; the from-the-start runs in Testing are still to do.
Performance: no clear difference. The fps differences are about the size of the run-to-run spread with two runs a side:
=0)At 4K the frame waits for the GPU, and that wait was a little shorter with the markers off in both pairs (frame trace
wait_gpu_ms, run mean from a third into the route: 3.33 / 3.42 ms on, 3.16 / 3.16 ms off), a hint of a small GPU-side cost, not a measured gain. The render thread's draw recording (draw_ms) changed by under 0.1 ms at both sizes.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.