perf(vk): Threaded rendering's Auto runs the recorder thread at any core count #3159
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3159
Loadingβ¦
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:perf/recorder-thread-any-cores"
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
Threaded rendering's Auto left both threads off on PCs with fewer than 4 physical cores. With this change Auto runs the recorder thread there too, so it runs at every core count, with or without buffer-pool mirrors. The render thread keeps its rules (4 or more cores, mirrored pools). Unsafe runs (
RX_VK_CAPTURE=0,RX_VK_LOW_SPEC, a frame dump, a benchmark replay) and the row set to Off still get no thread.What changes by PC: only 2- and 3-core (and 1-core) systems behave differently from
main. PCs and handhelds with 4 or more cores already run the recorder thread since #3157.Files to read first:
gpu/vk/threaded_rendering.h(auto_picks,without_mirrors;kAutoRecorderOnlyCoresis gone),tests/test_threaded_rendering.py.Testing
Tested: game-free checks only, on Linux:
test_threaded_rendering.py(42 broken copies caught),test_device_policy.py,test_switch_table.py,test_settings_table.py,test_menu_ini_keys.py,test_doc_anchors.py,test_menu_i18n.py,test_vk_braces.pypass. Not run in the game, not built, and the full suite was not run: opened that way at the maintainer's request.Still to test:
mainagainst this PR on Auto; the start line changes fromAuto: off (...)toAuto: the recorder thread only (...)(@Beanstalk)RX_VK_RECORDER=off, to see where the recorder thread helps or hurts (@Beanstalk)Measurements
Verdict: not measured. Nothing shows yet that the recorder thread helps below 4 cores.
Setup: none; the Test Farm runs above are the measurement.
2b3c2f07c5ccebbcRisks
On 2- and 3-core systems an extra thread, which spins briefly and wakes often, now competes with the game's own threads: it could lower fps or worsen frame pacing there. Those systems also newly run the recorder's code paths. Turn it off with
RX_VK_RECORDER=off, or the Debug tab's Threaded rendering row set to Off; a revert restores the old behaviour. Nothing moves for saves, settings or caches.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (Only the checks named in Testing were run.)main, or Measurements says why there is nothing to measure. (Waiting on the Test Farm.)third_party/untouched; nothing GPL-incompatible.When it applies
gpu/vk/switches.def. (Row updated; no measurement below 4 cores yet.)tests/that reads changed source is updated, not weakened.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
@Beanstalk Test the recorder thread across as wide a range of devices as you can: integrated GPUs (AMD, Intel, Steam Deck) and discrete (NVIDIA, AMD, Intel), Windows and Linux, with as many CPU core counts as are available, 2- and 3-core PCs especially. Compare three things in Hyrule Field and the Market, Threaded rendering on Auto: main, this PR, and this PR with RX_VK_RECORDER=off. Report fps, frame time p50 and p99, 1% low, crashes, screenshot differences and the 'vk: Threaded rendering:' start line. With 4 or more physical cores main and this PR should behave the same, so there the RX_VK_RECORDER=off arm is the comparison that matters; below 4 cores main logs 'Auto: off' and this PR 'Auto: the recorder thread only'.
Beanstalk test farm Β· an earlier run: commit
c5ccebb(the newer results are in a comment below)Commit
c5ccebbΒ· approved by HumanBean (reviewed) Β· dashboardβ οΈ Note: The farm cannot select or constrain physical core counts, so coverage of 2- and 3-core systems depends on available testers; the start line reports the count and Auto choice, but the plan cannot enforce the branch-specific wording.
β οΈ Note: On systems with at least four usable physical cores, main and the PR normally use the same Auto policy; the PR's recorder-off arm supplies the meaningful recorder comparison there.
β οΈ Note: Two starts per arm fit the time limit but give less noise resistance than three; the plan does not exercise unsafe-mode gates or the Threaded rendering Off menu row.
Started at 2026-12-04 06:44 UTC.
amd+igpuintel+igpuamd+dgpuintel+dgpuwindows+nvidia+dgpulinux+nvidia+dgpulinux+radvsteamdeckfield-marketΒ· frame time p99 (ms)RX_VK_RECORDER=RX_VK_RECORDER=off(reference)amd+igpuintel+igpuamd+dgpuintel+dgpuwindows+nvidia+dgpulinux+nvidia+dgpulinux+radvsteamdeckCouldn'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+igpu, report 1:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'samd+igpu, report 2:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'sintel+igpu, report 1:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'sintel+igpu, report 2:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'samd+dgpu, report 1:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'samd+dgpu, report 2:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'swindows+nvidia+dgpu, report 1:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'swindows+nvidia+dgpu, report 2:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'sWhat was tested
What will be tested Β· AI plan (
gpt-6.1-terra)On integrated and discrete GPUs, this plan compares main, the PR on Auto, and the PR with the recorder disabled in Hyrule Field and the Market. Each arm gets two starts with 20-second measurements per place, reporting fps, frame-time percentiles and 1% lows, crashes, screenshots, and the Threaded rendering start line. Crashes, missing start lines, excessive picture differences, or frame-time regressions beyond 15% fail the plan. Targets without a matching online device, including Steam Deck, will wait for a tester. No tester online now matches intel+dgpu, steamdeck: those targets wait for one.
off(PR only).castle-gate(settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0; switchesHOS_OUTPUT_RES=1280x720,RX_VK_AUTO_TUNE=0), then teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 10 s warm-up), teleport to Market, take the picture market to compare with main, measure market for 20 s (after 10 s warm-up); 2 runs on each side for each of 2 cells (2 game starts a run).Measurements on `amd+igpu`, for the PR description
Verdict: could not be judged on amd+igpu (2 reports).
Hardware: 1: linux+amd+radv+igpu
AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM; 2: linux+amd+radv+igpuAMD Radeon 760M Graphics (RADV PHOENIX), 26.0.8AMD Ryzen 5 230 w/ Radeon 760M Graphics, 16 GB RAMScene: field-market, from the repository's save castle-gate (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-market: 2 game starts a side, field 20 s after 10 s warm-up, market 20 s after 10 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
RX_VK_RECORDERoffAs Markdown for the PR description:
Measurements on `intel+igpu`, for the PR description
Verdict: could not be judged on intel+igpu (2 reports).
Hardware: 1: linux+intel+anv+igpu
Intel(R) Graphics (RKL GT1), 26.2.411th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM; 2: windows+intel+intel-proprietary+igpu+windowIntel(R) UHD Graphics 630, 0.404.2115Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAMScene: field-market, from the repository's save castle-gate (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-market: 2 game starts a side, field 20 s after 10 s warm-up, market 20 s after 10 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
RX_VK_RECORDERoffAs Markdown for the PR description:
Measurements on `amd+dgpu`, for the PR description
Verdict: could not be judged on amd+dgpu (2 reports).
Hardware: 1: linux+amd+radv+dgpu
AMD Radeon RX 9070 (RADV GFX1201), 26.3.1AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM; 2: linux+amd+radv+dgpuAMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMScene: field-market, from the repository's save castle-gate (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-market: 2 game starts a side, field 20 s after 10 s warm-up, market 20 s after 10 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
RX_VK_RECORDERoffAs Markdown for the PR description:
Measurements on `windows+nvidia+dgpu`, for the PR description
Verdict: could not be judged on windows+nvidia+dgpu (2 reports).
Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess
NVIDIA GeForce RTX 3070, 621.35.0AMD Ryzen 5 5600X3D 6-Core Processor, 32 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xessNVIDIA GeForce RTX 4090, 621.40.013th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAMScene: field-market, from the repository's save castle-gate (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-market: 2 game starts a side, field 20 s after 10 s warm-up, market 20 s after 10 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
RX_VK_RECORDERoffAs Markdown for the PR description:
Measurements on `linux+nvidia+dgpu`, for the PR description
Verdict: could not be judged on linux+nvidia+dgpu (2 reports).
Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu+dlss
NVIDIA GeForce RTX 5070 Laptop GPU, 620.85.2AMD Ryzen AI 9 365 w/ Radeon 880M, 32 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpuNVIDIA GeForce RTX 5070, 620.73.4AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMScene: field-market, from the repository's save castle-gate (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-market: 2 game starts a side, field 20 s after 10 s warm-up, market 20 s after 10 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
RX_VK_RECORDERoffAs Markdown for the PR description:
Measurements on `linux+radv`, for the PR description
Verdict: could not be judged on linux+radv (2 reports).
Hardware: 1: linux+amd+radv+dgpu
AMD Radeon RX 9070 (RADV GFX1201), 26.3.1AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM; 2: linux+amd+radv+dgpuAMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMScene: field-market, from the repository's save castle-gate (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-market: 2 game starts a side, field 20 s after 10 s warm-up, market 20 s after 10 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
RX_VK_RECORDERoffAs Markdown for the PR description:
Measurements on `steamdeck`, for the PR description
Verdict: queued on steamdeck (1 report).
Hardware: 1: linux+amd+radv+igpu+handheld
AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99AMD Custom APU 0405, 16 GB RAMScene: field-market, from the repository's save castle-gate (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-market: 2 game starts a side, field 20 s after 10 s warm-up, market 20 s after 10 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)Nothing was measured: no metric came back.
Flags and settings
RX_VK_RECORDERoffAs Markdown for the PR description:
The testers' hardware
amd+igpuAMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAMamd+igpuAMD Radeon 760M Graphics (RADV PHOENIX), 26.0.8AMD Ryzen 5 230 w/ Radeon 760M Graphics, 16 GB RAMintel+igpuIntel(R) Graphics (RKL GT1), 26.2.411th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAMintel+igpuIntel(R) UHD Graphics 630, 0.404.2115Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAMamd+dgpuAMD Radeon RX 9070 (RADV GFX1201), 26.3.1AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAMamd+dgpuAMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMwindows+nvidia+dgpuNVIDIA GeForce RTX 3070, 621.35.0AMD Ryzen 5 5600X3D 6-Core Processor, 32 GB RAMwindows+nvidia+dgpuNVIDIA GeForce RTX 4090, 621.40.013th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAMlinux+nvidia+dgpuNVIDIA GeForce RTX 5070 Laptop GPU, 620.85.2AMD Ryzen AI 9 365 w/ Radeon 880M, 32 GB RAMlinux+nvidia+dgpuNVIDIA GeForce RTX 5070, 620.73.4AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMlinux+radvAMD Radeon RX 9070 (RADV GFX1201), 26.3.1AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAMlinux+radvAMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMsteamdeckAMD Custom GPU 0405 (RADV VANGOGH), 26.1.99AMD Custom APU 0405, 16 GB RAMPossibly related, for context:
@rebase
I rebased this pull request onto
main(4007f6eae4): the new head isa9dc966b84.Conflicts resolved
gpu/vk/settings/settings.cppNothing was built or run: read the resolution before merging.
Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
c5ccebbca9a9dc966b84Beanstalk test farm
Commit
a9dc966Β· approved by nobody yet Β· dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.Recommendation: Approve. The code is ready: only testing is left. The recorder thread now runs by default on systems with fewer than four usable cores, but its performance and frame pacing there have not been measured. The change needs game runs before its gain and default can be judged. Recommend approval; not approved on the forge.
Auto uses the recorder thread on one-, two- and three-core configurations while keeping the render thread off. This may overlap Vulkan recording with replay, at the cost of another competing thread, packet copies and waits; the net effect is unknown.
Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/threaded_rendering.h:101: The new default enables the recorder on fewer than four usable cores without a measured gain or a game run on that configuration. (more on the line) Do: Compare the merge base and this head on affected Windows and Linux configurations, including integrated and discrete GPUs and one-core affinity where practical. Use the same heavy scenes and settings, interleaved repeated runs, and report average fps, 1% lows, median and p99 frame times, crashes and visual differences.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven. The pull request reports no before-and-after game measurements below four cores; the recorded four-core results do not establish the effect on those systems.
Other systems: The changed default can affect Windows and Linux, integrated and discrete GPUs, and processes restricted to fewer than four physical cores by affinity. Configurations with four or more usable cores retain their previous Auto choice. The game-free checks exercise policy and safety gates but do not establish rendering correctness or frame pacing on the newly affected configurations.
Switches: The Threaded rendering row remains Auto by default, but Auto now enables the recorder below four cores. RX_VK_RECORDER remains an override and its documented default changes with the row. Whether the new default is right is unproven; the switch table and user documentation are updated.
Reviewed:
a9dc966b84against4007f6eae4: Read the repository rules, standards and PR template, commit and diff. Read threaded_rendering.h and the changed policy, settings, recorder, replay, test and documentation sections; skimmed the remainder of the larger changed files and related recorder implementation. The review checklist and sibling Tooling AGENTS.md were absent.; nothing run (a code review).Checked and fine:
Testing: No commands from the project, builds or tests were run during this read-only review. The author reports game-free Linux checks passing; the game has not been built or run for this change, and CI was still running.
Overlaps and merge order: Not checked; network access is unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.
@ -107,3 +99,3 @@constexpr Choice auto_picks(unsigned cores) {if (cores >= kAutoCores) return {true, true, Why::AutoBothThreads};return {false, false, Why::AutoFewCores};return {false, true, Why::AutoFewCores};L1 (should fix): The new default enables the recorder on fewer than four usable cores without a measured gain or a game run on that configuration.
When: On a two- or three-core PC, or a process limited to that many cores, Auto now packs and hands Vulkan work to another thread that competes with the game. Its effect on frame rate, frame pacing and output is unknown.
Do: Compare the merge base and this head on affected Windows and Linux configurations, including integrated and discrete GPUs and one-core affinity where practical. Use the same heavy scenes and settings, interleaved repeated runs, and report average fps, 1% lows, median and p99 frame times, crashes and visual differences.
@fix
There is nothing for an edit to fix on this pull request. It was already up to date with
main.For the author (no edit does these)
gpu/vk/threaded_rendering.h:101: The new default enables the recorder on fewer than four usable cores without a measured gain or a game run on that configuration. When: On a two- or three-core PC, or a process limited to that many cores, Auto now packs and hands Vulkan work to another thread that competes with the game. Its effect on frame rate, frame pacing and output is unknown. Do: Compare the merge base and this head on affected Windows and Linux configurations, including integrated and discrete GPUs and one-core affinity where practical. Use the same heavy scenes and settings, interleaved repeated runs, and report average fps, 1% lows, median and p99 frame times, crashes and visual differences.Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
WIP: perf(vk): Threaded rendering's Auto runs the recorder thread at any core countto perf(vk): Threaded rendering's Auto runs the recorder thread at any core count