WIP: perf(vk): RX_VK_RT_HOME=1 keeps the render thread on its own core on Windows, with a guard for another program holding it (off by default) #2240
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2240
Loading…
Reference in a new issue
No description provided.
Delete branch "klimovich008/Longshot:perf/rt-home-v3"
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
This brings back a switch that keeps the render thread on one core, after #1309 removed
RX_VK_RT_STRICT_PIN. This timeit comes with a guard for #838's case (another program holding that core) and a farm plan. It is off by default, and
this PR proposes no default: that is the team's call once the farm has run it.
What it does, in player words. On Windows, the renderer keeps one core free of the game's own threads for the render
thread (the "reserved core"). Today the thread prefers that core, but Windows may move it to any fast core. When it moves,
it often lands beside a busy game thread on the same physical core, and both run slower.
RX_VK_RT_HOME=1keeps therender thread on its own core. When something else holds that core off it (#838's case: another program at high
priority on the same core), it lets the thread move again for a while:
It does nothing on Linux, the Steam Deck or macOS, and on a CPU without SMT (two logical processors a core) it changes
nothing that matters.
The switch.
RX_VK_RT_HOME(kindattempt):0): main's placement, exactly;1: home, with the guard;strict: home with no guard. It is a measuring arm and the tests' negative control, never meant to be used.RX_VK_RT_HOME_MS(kindtune, default 4, 1-1000) is the guard's threshold.On a PC whose host keeps no core free for the render thread,
1andstrictsay so at start ("the host keeps no corefree for the render thread on this PC, so it moves freely, as unset"), so a run there shows it compared the same
placement twice. Unset and
0print nothing new.How the guard decides it is being held. For each window between two presents (20 ms or more apart), it looks at two
things:
job wait counts as lost;
Each must reach
RX_VK_RT_HOME_MS. For a window over 250 ms, each must reachmax(RX_VK_RT_HOME_MS, half the window):It acts only once it has seen a hold happen, so about one stall frame gets through each time the thread goes back
home (measured below).
Fact 2 is a lower bound (busy time minus what the thread and the waits account for), so it goes below zero when a
processor of the core was free for part of the window. The guard decides on that raw bound; the log lines (the
600-presents summary and the long-present line) show it as at least 0, so "its core taken by others" never reads
negative.
Read first:
gpu/vk/rt_pin.h(the Guard,need), then ingpu/vk/vk_replay.cpp:rt_place,rt_home_frame,job_waitand
rt_ready_note. The present path's own waits are marked as the render thread's waits (FpsRtWait(-1)): the frame slot'sfence,
presenter_wait_idle,image_free's fence and the blocking acquire. Also changed:gpu/vk/vk_fps.cpp/.h: the render thread's waits by kind;gpu/vk/switches.def: the two rows;docs/dev/reference/threads.md;tests/test_rt_pin.py(new) andtests/test_reserved_core_mask.py. The present-path fixtures now stubFpsRtWait.Testing
Tested: Windows 11, Ryzen 7 5700X3D (8 cores, 16 threads), RX 9070 XT, AMD 26.11.2.
Round 3 (this head, main
0e32bc10merged): the DLL built from the round's code (f65e5e69) over main 0e32bc10's base:RX_VK_RT_HOME=1against unset, 3alternating pairs: +2.8 %, diagnostic (Measurements). Every
1run was home through the window: 0 holds, 0 s wide;the longest wake from a job wait 0.17-1.00 ms against the 4 ms threshold; live mask 0xc000 with
1, 0xffff unset;no negative "taken by others" in any log. Unset on this build against main's own build (one run): the same placement
lines and live mask, no new error-line kinds.
0e32bc10: #2275 (Streamline) reshaped the present's fence wait and acquire, two of the waitsthis PR marks. Both keep main's shape (
copy_ready, its early return, the retired acquire semaphore,acquire_semaphore) with the wait insideFpsRtWait(-1);test_rt_pin's pins follow, and a removed or moved scopestill fails them.
tests/test_rt_pin.py, with clang++ and g++: pass, 57 broken variants, each failing (new: a negative orabsolute-value "taken by others" in either log line; on
61a86ea7these checks fail).run_all.py, this head against main0e32bc10, with llvm-mingw clang (branch 880 passed / 25 failed / 53skipped, main 879 / 25 / 53) and MSYS2 gcc (874 / 31 against 872 / 32): nothing fails only on the branch; with gcc
main's flaky
test_longshot_ctlfailed on main only. The present-path fixtures,test_reserved_core*,test_fps_stats,test_threaded_renderingandtest_switch_tablepass with both compilers. Linux syntax (WSL clang and gcc) ok onvk_replay.cppandvk_fps.cpp.The Test Farm on the previous head
61a86ea7(Hyrule Field,1against0and unset on the PR's build):of 4. A manual run, rn_31f9d7473c936025, main
a2dc5385against this PR with1, 3 starts a side: main crashed 3 of 3too, and the PR 3 of 3 (the renderer's out-of-memory stop). The PC, not the switch.
1run (27.73 fps; the other1run 40.36, above both0runs). Ithas the same signature as main's own slow run in the other scenario (18.87 fps, a 21-24 s frame, about 3,000 draws a
frame against 2,374-2,473 in the six other runs): a scene-state freeze main's build also hit. Its log says the render
thread was working, not held off: its jobs 85.72 of 89.56 ms a frame, the game waiting for room at 4 presents of 10 s
each, the guard's most-lost window judged blocked (a processor of its core free), 2 small holds. Its "taken by others
-17.8 ms" was that raw lower bound; the log now shows it as at least 0. One run a cell can't rule out more
(whether being home slowed those long jobs on that CPU), so the farm is asked again with 3 starts a cell there.
Round 2 (Hyrule Field, on main dd5ffe6a's base with main
a2dc5385merged; pack exe 4a697611, DLL 0dae9922):The standard test as it was then (Hyrule Field turning),
RX_VK_RT_HOME=1against unset, 3 alternating pairs, intwo sessions: see Measurements, "Round 2, Hyrule Field".
1run the thread is at home through the window: 0 holds, 0 s wide, and 0 holds in windows over 250 ms.1and 0xffff unset.Long holds made on purpose (both reserved processors at priority 15, 270 ms in every 2,700 ms):
1These are the implementer's three rounds; the checker's one round gave strict 7,
10 and unset 0. Each widen came in a272-280 ms window where the thread lost about 190-270 ms with its core taken 180-270 ms, over the half-window bar.
The short stall (35 ms in every 250 ms, 3 rounds), frames over 40 ms:
11stays within unset + 1. The extra one is the first stall after a return home, caught at that present.Unset and
0against main's own build: the same two placement lines, the same live mask (0xffff, ideal 15), and nonew error-line kinds.
0adds its one line ("free to move, as unset").tests/test_rt_pin.py(round 2), with clang++ and g++:RX_VK_RT_HOME_MSboundaries (1000 fires on a 1 s hold and not on 999 ms; 250);The cost off: one bool test at each job hand-over (1.5 ns), and one thread-local read in each marked wait. No clock
is read with the switch off.
Still to test:
RX_VK_RT_HOME=1against unseton this PR's build, 3 starts a cell, uncapped, Hyrule Field and Lost Woods. Expected: fps up or level, and no more
long frames; on the i5-12400, whether the slow
1run comes back more often than on unset (@Beanstalk, requestbelow).
(
@Beanstalk).1, about one stall frame perreturn home, not every stall (by hand, or the farm if such a tester appears).
Measurements
Verdict: on this PC, in today's standard test (Lost Woods, child), +2.8 % fps with
RX_VK_RT_HOME=1, labelleddiagnostic (under 5 % with 3 pairs); the replay's submit is 16 % shorter in every
1run, and there is no stutterin either arm. The gain is smaller than in Hyrule Field (below) because the Lost Woods frame is CPU-bound elsewhere (CPU
55 ms a frame against Hyrule's 41-43; the submit 4.7 ms against 8.6), so the render thread's share, which this speeds
up, is smaller. The two scenes are separate results and are not joined.
Baseline: this PR's build with
RX_VK_RT_HOMEunset (main's placement).Round 3, Lost Woods (child): this head, over main
0e32bc10.Setup: Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2. Lost Woods as child (the profile save, then the teleport),
fast rotation, 16:9,
RX_VK_ASYNC=1, uncapped (HOS_FPS_MAX=240, cap 0, vsync 0), the fixed light GPU load beside thegame, 20 s window. 3 alternating pairs, all admitted, no replacements, medians. DLL
f65e5e69over main 0e32bc10's base(exe
b658e14b).3cb7b05d,RX_VK_RT_HOMEunset3cb7b05d,RX_VK_RT_HOME=1The pairs: -0.3 %, +2.8 %, +5.7 %. The implementer's single pair on the same code gave +2.6 % (85.14 -> 87.34).
Round 2, Hyrule Field: the previous head
61a86ea7, over main dd5ffe6a's base with maina2dc5385merged.Not comparable with Lost Woods. On this PC, +8.1 % fps with
RX_VK_RT_HOME=1, p99 16.4 -> 14.5 ms (the checker'ssession). Every pair gained (+7.4, +8.5, +7.8 %). The implementer's session on the same build gave +8.5 % (89.64 ->
97.29, p99 16.96 -> 14.43).
Setup:
RX_VK_ASYNC=1.HOS_FPS_MAX=240with the options file's cap 0 and vsync 0. At about 97 fps that is in effect the farm'sframe_rate_cap=6,vsync=2.61a86ea7,RX_VK_RT_HOMEunset61a86ea7,RX_VK_RT_HOME=11345-353 ms). With1it came as onelong frame more often.
1runs, and nothing over 100 ms anywhere.--affinity 0xff), on the build before this round.That is a mask of an 8-core CPU, not a 4-core CPU. It gave 65.04 -> 82.34 fps (+26.6 %), one run a side.
dd5ffe6a. That was another base, and those numbers are not joinedwith these.
Risks
case). The guard sees a hold only once it has happened. Unset doesn't have this.
one:
hand-off, a lock,
replay_mu, a shader worker, the GPU, frame generation's set wait), with both processors of the corebusy with others meanwhile, can widen it for one stay.
steady_clock(QPC), the waits onfps_clock(the TSC, scaled once at itsfirst call). A calibration preempted during its loop mis-scales the waits. Follow-up: compare
fps_clock's rate withthe guard's own 1 s calibration, and give up (
rt_home_off) when they disagree by more than 2 %.__rdtsc()makes phantom busy time.core's two processors one after the other while the thread is held off long enough.
it let one frame through; the next burst widened it.
to the game's other three cores is measured only on the mask above.
RX_VK_ASYNC=0's pin (ReplayPin), host/ and the shader-cache stamp files (no re-prepare). HybridCPUs never keep the thread on an efficiency core. A process affinity mask is respected (#1776).
RX_VK_RT_HOME=0adds one start-up line naming the value. Unset gives exactly main's lines.0e32bc10). The fence wait and the acquire keep main's statements andcontrol flow, with the wait inside
FpsRtWait(-1); outside the guard's own code the branch differs from main inthose two lines only.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
gpu/vk/switches.def.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
a2dc5385) into perf/rt-home-v3 ce23f32f74Tested in game: Windows 11, Ryzen 7 5700X3D (8C/16T), RX 9070 XT, AMD 26.11.2, the PR's renderer over main dd5ffe6a's build: Hyrule Field turning, uncapped (HOS_FPS_MAX=240), 3 alternating pairs of RX_VK_RT_HOME=1 against unset: 91.64 -> 97.79 fps, the thread at home through every window with 0 holds, live mask 0xc000 against 0xffff, clock 1.000. A stall made on purpose (both reserved processors at priority 15, 35 ms in every 250 ms), 3 rounds: frames over 40 ms strict 80/81/81, =1 2/2/2, unset -/0/1 (about one stall frame per return home gets through). Unset against main's own build: the same mask, the same placement lines, no new error lines. The merge with main
a2dc5385was built, not run. Not run: Intel, other AMD CPUs, 4- and 6-core CPUs, SMT off, #838's real stall.@Beanstalk the PR's own build only, its switch against itself: baseline ref = pr, [matrix.pr_only] RX_VK_RT_HOME = ["0", "1"], and pass.compare RX_VK_RT_HOME = "1" against "0" on the pr side (unset is the same as 0: main's placement). It is off by default and does anything only on Windows CPUs with SMT, so every target is Windows.
Targets, each with 1-2 reports. Windows with a CPU that has two logical processors a core, by model:
The 4-core ones matter most (on this PC a 4-core mask gained far more, report-only), but don't let the plan wait on them alone.
Settings: frame_rate_cap = 6 (Uncapped), vsync = 2 (Off), frame_generation = 0; headless is fine.
Scenario: Hyrule Field (HyruleField_Child), measured 30 s, 3 game starts a cell (2 at least). Compare rules, pr side, RX_VK_RT_HOME=1 vs 0: fps_mean min_delta_pct = 3 (fails on a loss of more than 3 %) and frametime_p99_ms max_delta_pct = 10; crash = false. Hitch counts (run_hitch_count, run_frametime_max_ms) report-only.
Log on the =1 cells: "vk: RX_VK_RT_HOME=1: the render thread is kept to logical processors" expected (the thread really went home: on a PC where the placement does not apply it says "free to move, as unset" instead, and that cell compares nothing).
Beanstalk test farm · an earlier run: commit
5867310(the newer results are in a comment below)Commit
5867310· approved by HumanBean, klimovich008 (double-reviewed) · dashboard⚠️ Note: Two starts per setting keep the plan within the farm’s time limit, but leave no spare usable start for the frame-time comparison.
⚠️ Note: The placement log is unjudged when absent, including in the 0 cell; the farm cannot suppress the performance comparison when placement is refused, so such results may compare identical placement.
⚠️ Note: The farm cannot inject the competing high-priority workload needed to test guard recovery under a deliberate core hold.
Started at 2026-11-22 10:54 UTC.
windows+cpu-3300x_i3-10100_i3-12100_i3-13100_i7-6700_i7-6700k_i7-7700_i7-7700k(CPU "3300x" or "i3 10100" or "i3 12100" or "i3 13100" or "i7 6700" or "i7 6700k" or "i7 7700" or "i7 7700k")windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700k(CPU "3600" or "5600" or "5600x" or "7600" or "7600x" or "i5 10400" or "i5 11400" or "i7 8700k")windows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900k(CPU "3700x" or "5700x" or "5800x" or "5800x3d" or "7700x" or "7800x3d" or "i7 10700k" or "i9 9900k")windows+cpu-i5-12400_i5-12600k_i5-13600k_i5-14600k_i7-12700k_i7-13700k(CPU "i5 12400" or "i5 12600k" or "i5 13600k" or "i5 14600k" or "i7 12700k" or "i7 13700k")hyrule-field· frame time p99 (ms)RX_VK_RT_HOME=0(reference)RX_VK_RT_HOME=1windows+cpu-3300x_i3-10100_i3-12100_i3-13100_i7-6700_i7-6700k_i7-7700_i7-7700k(CPU "3300x" or "i3 10100" or "i3 12100" or "i3 13100" or "i7 6700" or "i7 6700k" or "i7 7700" or "i7 7700k")windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700k(CPU "3600" or "5600" or "5600x" or "7600" or "7600x" or "i5 10400" or "i5 11400" or "i7 8700k")windows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900k(CPU "3700x" or "5700x" or "5800x" or "5800x3d" or "7700x" or "7800x3d" or "i7 10700k" or "i9 9900k")windows+cpu-i5-12400_i5-12600k_i5-13600k_i5-14600k_i7-12700k_i7-13700k(CPU "i5 12400" or "i5 12600k" or "i5 13600k" or "i5 14600k" or "i7 12700k" or "i7 13700k")Why it failed
windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700k:hyrule-field · RX_VK_RT_HOME=0 (PR only)crash:2 PR runs crashedwindows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700k:hyrule-field · RX_VK_RT_HOME=1 (PR only)crash:2 PR runs crashedCouldn'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+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700k, report 2:Insufficient frame-time evidence for 1 required comparison(s). See rule results.windows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900k, report 1:Insufficient frame-time evidence for 1 required comparison(s). See rule results.windows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900k, report 2:Insufficient frame-time evidence for 1 required comparison(s). See rule results.What was tested
What will be tested · AI plan (
gpt-6.1-terra)On selected Windows SMT CPUs, this compares the PR’s render-thread placement switch with its off setting in Hyrule Field. Two starts per setting measure 30 seconds of uncapped gameplay, taking about 45 minutes per tester. A crash, an FPS loss over 3%, or a p99 frame-time increase over 10% fails the comparison; hitches are reported without a limit. Some requested CPU targets may wait for matching Windows testers. No tester online now matches windows+cpu-3300x_i3-10100_i3-12100_i3-13100_i7-6700_i7-6700k_i7-7700_i7-7700k, windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700k, windows+cpu-i5-12400_i5-12600k_i5-13600k_i5-14600k_i7-12700k_i7-13700k: those targets wait for one.
RX_VK_RT_HOME) and off; main is not built or run.0or1(PR only).castle-gate(settings vsync=2, frame_rate_cap=6, frame_generation=0), then teleport to Hyrule Field, measure field for 30 s (after 5 s warm-up); 2 runs on each side for each of 2 cells (2 game starts a run).Measurements on `windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-`, for the PR description
Verdict: fail on windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700k (2 reports):
hyrule-field crashfailed.Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu
NVIDIA GeForce RTX 5070 Ti, 621.24.0AMD Ryzen 5 5600X 6-Core Processor, 16 GB RAM; 2: windows+amd+amd-proprietary+dgpuAMD Radeon RX 9060 XT, 2.0.416AMD Ryzen 5 5600 6-Core Processor, 32 GB RAMScene: hyrule-field, from the repository's save castle-gate (vsync=2, frame_rate_cap=6, frame_generation=0); 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); hyrule-field: 2 game starts a side, field 30 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)5867310, switch off5867310, switch onRX_VK_RT_HOME=0 (PR only)· expected log lines missingRX_VK_RT_HOME=0 (PR only)· field · frame time (p99) (ms)RX_VK_RT_HOME=1 (PR only)· expected log lines missingRX_VK_RT_HOME=1 (PR only)· field · frame time (p99) (ms)Flags and settings
RX_VK_RT_HOME0,1As Markdown for the PR description:
Measurements on `windows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700`, for the PR description
Verdict: could not be judged on windows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900k (2 reports): required frame-time comparison inconclusive (fewer than two usable starts per side).
Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu
NVIDIA GeForce RTX 5070 Ti, 621.24.0AMD Ryzen 7 5800X3D 8-Core Processor, 64 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: hyrule-field, from the repository's save castle-gate (vsync=2, frame_rate_cap=6, frame_generation=0); 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); hyrule-field: 2 game starts a side, field 30 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)5867310, switch off5867310, switch onRX_VK_RT_HOME=0 (PR only)· expected log lines missingRX_VK_RT_HOME=0 (PR only)· field · frame time (p99) (ms)RX_VK_RT_HOME=1 (PR only)· expected log lines missingRX_VK_RT_HOME=1 (PR only)· field · frame time (p99) (ms)Flags and settings
RX_VK_RT_HOME0,1As Markdown for the PR description:
The testers' hardware
windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700kNVIDIA GeForce RTX 5070 Ti, 621.24.0AMD Ryzen 5 5600X 6-Core Processor, 16 GB RAMwindows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700kAMD Radeon RX 9060 XT, 2.0.416AMD Ryzen 5 5600 6-Core Processor, 32 GB RAMwindows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900kNVIDIA GeForce RTX 5070 Ti, 621.24.0AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAMwindows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900kNVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAMRun by hand on PCs that don't match their target (not counted)
NVIDIA GeForce RTX 4070 Ti, 620.70.6)Read of
5867310bonmaina2dc5385(WIP). The switch and the guard's code are coherent, and the test is real; the perf claim is not at this head or current main.Perf claim. The Measurements are at
608775b2on maindd5ffe6a; the head5867310bis the merge ontoa2dc5385, and the Windows build at the head was not run in the game ("the numbers below are from the PR's code before the merge"). Thevk_replay.cppchange from608775b2is only the merge'scxx_escape::spawn_neededand include order, so the guard's timing code is the same — but the measured scene changed with #2174's Hyrule Field simulated turf, and the baseline main moved. The +6.7 % (91.64 → 97.79 fps) is evidence for608775b2ondd5ffe6a, not for this head. What is missing: the standard test run at5867310bona2dc5385(or the farm's) with the mask, ideal processor and guard lines, and the same for the Still-to-test cases (4/6/8 SMT cores, Intel/AMD/hybrid, #838, SMT off).Switch, default and off path. Good:
RX_VK_RT_HOMEis off by default; unset/0 is main's Free placement;1is home + guard;strictis home with no guard (the measuring arm, never for players);RX_VK_RT_HOME_MSis 4. Unset keeps main's lines, mask and ideal processor; the additions are thert_ready_notebool tests,gate_ready'sgate_openre-check andrt_home_frame's early return (the 1.5 ns claim), and explicit 0/unknown values log. Linux/macOS keep the reserved core as before and say the switch does nothing.test_switch_tablefails on main'sRX_VK_GRASS_DISTANCEorder (named in the body).Threading and lifetime. No race found. The wake stamp (
rt_wake_on,rt_ready_set,rt_ready_at,rt_wake_floor) is written and read underq_mubyenqueue,gate_need_value,wait_queue_emptyandjob_wait;rt_home,rt_home_on,rt_wokeandfps_rt_waitedare the render thread's alone; the parked buffer is only read there; the affinity calls are on the render thread;rt_home_offcovers a clock/read/affinity failure. The acknowledged false-hold paths (the present's fence/acquire waits not marked, thefps_clockvssteady_clockcalibration, the DPC between the idle read and__rdtsc, a notifier preempted while holdingq_mu) are real but bounded: a hold costs one stay, never the session.Test. Strong:
test_rt_pin(the placement and unset against main's mask/ideal/lines, the guard through the real queue code, the stall cases, 47 broken variants) andtest_reserved_core_mask. Here at5867310b,test_rt_pin,test_reserved_core_mask,test_fps_stats,test_perf_pipe_waitsandtest_threaded_renderingpass on Linux. The Windows API paths (SetThreadAffinityMask,QueryThreadCycleTime, the idle counts,__rdtsc) are not exercised game-free on Linux, and the head's Windows build was not run; the farm is what covers them.WIP. Not "no test" — the test is there. Missing before ready: the head/current-main in-game run and measurement, the farm's other CPUs, and the team's default decision. No approval or claim.
@Beanstalk run
a2dc5385#2240 on tester-mekyon, windows+nvidia+dgpuMain against this PR's head, both with no switch at all (RX_VK_RT_HOME unset on both sides), to see whether main crashes the same way on that PC. On this PR's round, rp_0579c120f0bacfb8 (Ryzen 5 5600X, RTX 5070 Ti, 621.24) crashed or hung in all 8 PR runs, in both cells, RX_VK_RT_HOME=0 included, with one log ending in an exception inside NVIDIA's shader compiler (nvgpucomp64.dll). Main was built there but never run.
Settings, both sides: frame_rate_cap = 6, vsync = 2, frame_generation = 0; headless. Scenario: from the save castle-gate, Hyrule Field (HyruleField_Child) measured 30 s, 3 game starts a side. Rules: crash = false on each side; everything else report-only. The second target (any Windows PC with an NVIDIA card) is for whether this is that PC alone.
@klimovich008 that run was not started: there is no branch or tag
a2dc5385for the baseline.@Beanstalk run
a2dc538590#2240 on tester-mekyon, windows+nvidia+dgpuMain against this PR's head, both with no switch at all (RX_VK_RT_HOME unset on both sides), to see whether main crashes the same way on that PC. On this PR's round, rp_0579c120f0bacfb8 (Ryzen 5 5600X, RTX 5070 Ti, 621.24) crashed or hung in all 8 PR runs, in both cells, RX_VK_RT_HOME=0 included, with one log ending in an exception inside NVIDIA's shader compiler (nvgpucomp64.dll). Main was built there but never run.
Settings, both sides: frame_rate_cap = 6, vsync = 2, frame_generation = 0; headless. Scenario: from the save castle-gate, Hyrule Field (HyruleField_Child) measured 30 s, 3 game starts a side. Rules: crash = false on each side; everything else report-only. The second target (any Windows PC with an NVIDIA card) is for whether this is that PC alone.
@klimovich008 started a manual run: a2dc5385901812d183c4b7f0f9d48b295f17a510 vs #2240
Candidate
#2240(5867310bc8) against baselinea2dc5385901812d183c4b7f0f9d48b295f17a510(a2dc538590). Done.⚠️ Note: The guarded render-thread mode is not exercised because RX_VK_RT_HOME is unset on both sides.
⚠️ Note: The baseline's crash outcome is reported for comparison; the crash pass rule judges the candidate.
tester-mekyonwindows+nvidia+dgpuAbout the farm's first results on
5867310The fail on
windows+cpu-3600_5600...(rp_0579c120f0bacfb8: Ryzen 5 5600X, RTX 5070 Ti, NVIDIA 621.24, 16 GB).RX_VK_RT_HOME=0included.CRASH: exception 0x80000003 ... at nvgpucomp64.dll+0x5f13d2.What the switch does at
0. I read the code path. At0the PR makes the same Windows calls as main:rt_placemakes the sameSetThreadAffinityMaskandSetThreadIdealProcessorcalls with the same mask and ideal processor.test_rt_pin.pyholds unset to main's mask, ideal processor and lines.0adds only one start-up line naming the value.rt_home_onfalse), so the job wait does no stamping and the waits are not summed.So by the code, this PR is not what crashes in the
0cell. That is a reading, not a measurement.To see whether main crashes there too, I started a manual run: main
a2dc5385against this PR's head, with no switch on either side, on that tester's PC and on any Windows PC with an NVIDIA card (rn_e521cf3b11018b29).The 8-core target couldn't be judged twice. The two starts a cell leave no spare start for the frame-time rule. The p99 so far is 18.4 ms at
0against 18.1 at1.@Beanstalk
@HumanBean
5867310is already running: see the dashboard.@review
Recommendation: Request changes. The guard permanently misses repeated holds longer than 250 ms, leaving the render thread pinned through every stall. The opt-in gain was measured on an earlier build, and the head’s NVIDIA farm crashes still need a base comparison.
Adds an experimental Windows render-thread affinity mode with a guard intended to release the thread when another program occupies its reserved core. An earlier build gained 6.7% median fps on one AMD system, at the cost of extra sampling and at least one stall on each return home; the guard also misses longer repeated holds.
Blocking (1): must change before merging.
gpu/vk/rt_pin.h:164: The guard discards every window longer than 250 ms, including windows caused by the contention it is meant to escape. (more on the line) Do: Provide a bounded escape for long windows that could be contention, and add a test for repeated holds over 250 ms.Should fix (1): not blocking, but worth doing before merging.
gpu/vk/rt_pin.h:78: The threshold parser accepts values that the guard cannot normally reach because it discards windows over 250 ms. (more on the line) Do: Restrict the accepted threshold to a range the sampling rule can satisfy, or change the sampling rule to support the documented range; test the boundary.Testing before merging (3) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1 and L2.Checks: Failing on this head, which is behind its base, where they pass:
Guide screenshots / Guide images and local UI source review (pull_request),CI / Website build and checks (pull_request).@rebase(or@fix) brings it up to date and runs them again; not held against it.More: does it help, other systems, switches, what was read
Does it help: Unproven at this head. On an earlier build, three alternating pairs on a Ryzen 7 5700X3D and RX 9070 XT gave 91.64 to 97.79 fps and p99 frame time 15.87 to 14.36 ms. The merged head was built but not run in game, and the comparison used the PR with the switch unset as its baseline.
Other systems: The affinity mode affects the asynchronous render thread on Windows; Linux keeps its existing placement and synchronous replay uses a separate pin. Intel, hybrid CPUs, other core counts, SMT off, the real #838 workload and the current head remain unverified. All eight farm runs on one Windows NVIDIA system crashed or hung with both switch values; a main comparison is pending.
Switches: RX_VK_RT_HOME defaults to 0, retaining the existing placement; 1 enables guarded pinning and strict enables unguarded pinning for measurement. The default is safe for existing behavior but has not been chosen from current-head cross-system measurements. RX_VK_RT_HOME_MS defaults to 4 ms; its accepted upper range includes values the guard cannot reach. Both have switch-table rows and developer documentation.
Reviewed:
5867310bc8againsta2dc538590: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the commit log, rt_pin.h and the diffs; examined the changed replay, FPS, placement and test code and their surrounding queue and clock paths. Skimmed the large test fixture and unchanged portions of the large replay and FPS files; they were not read in full. docs/review-checklist.md and the adjacent Tooling checkout were absent.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run for this review. The author reports game and synthetic contention runs on the earlier build and a successful Windows build of the merged head; the farm results and pending comparison are described above.
Overlaps and merge order: None found in the supplied information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -0,0 +75,4 @@/// for a value set but not used)constexpr int kHeldMs = 4;constexpr int held_ms(const char* v, bool* known = nullptr) {if (known) *known = true;L2 (should fix): The threshold parser accepts values that the guard cannot normally reach because it discards windows over 250 ms.
When: With RX_VK_RT_HOME=1 and RX_VK_RT_HOME_MS=1000, the value is accepted and logged, but a one-second hold is discarded as an overlong window instead of releasing the thread.
Do: Restrict the accepted threshold to a range the sampling rule can satisfy, or change the sampling rule to support the documented range; test the boundary.
@ -0,0 +161,4 @@wide = false, home_since = now;return Act::Home;}/// While home, one window (above): Widen when both facts holdL1 (blocking): The guard discards every window longer than 250 ms, including windows caused by the contention it is meant to escape.
When: With RX_VK_RT_HOME=1, another high-priority program repeatedly occupies both usable processors of the reserved core for 300 ms. Each delayed present produces a window over 250 ms, so sample returns without widening and every subsequent hold stalls the render thread again.
Do: Provide a bounded escape for long windows that could be contention, and add a test for repeated holds over 250 ms.
Thanks, BeanBot (review 2378). The round is in
61a86ea7, which squashes the work into one commit.L1, fixed. A window over 250 ms is now judged. Each fact must reach
max(RX_VK_RT_HOME_MS, half the window): the time lost off the CPU outside the thread's waits, and every processor of its core taken by others.presenter_wait_idle,image_free's fence, the blocking acquire) now count as the thread's waits, so a long one isn't taken for lost time.test_rt_pin.pyhas repeated 300 ms holds that widen at each return home with the stays doubling, plus long windows that must not widen (a 1.5 s compile, an 800 ms block, small losses over 2 s). It has 54 broken variants, each failing, including "a window over 250 ms not judged".1let through no frame over 250 ms, in 3 implementer rounds and 1 checker round;L2, fixed.
RX_VK_RT_HOME_MSkeeps 1-1000, and every value is now reachable, because a hold over 250 ms is judged in its own window."1001"falls back to 4.L3. The head's code (main
a2dc5385merged) is measured in two sessions, 3 alternating pairs each, with the switch at1against unset on the same build. Unset is main's placement.L4. The manual run rn_e521cf3b11018b29 ran main
a2dc5385against the head with no switch. Main crashed on all 3 starts on that tester's PC too, and the other Windows NVIDIA dGPU passed. So that crash isn't this PR's.L5. Still wanted: the real #838 case (Intel's PresentMon service on an i5-13600K). It isn't run here. It's in the farm request (hybrid Intel) and the wanted post.
One more note: main's #2275 reshaped the present's fence wait and acquire, which this PR marks, so merging current main conflicts there. That merge is still to do.
@Beanstalk the PR's own build only, its switch against itself: baseline ref = pr, [matrix.pr_only] RX_VK_RT_HOME = ["0", "1"], and pass.compare RX_VK_RT_HOME = "1" against "0" on the pr side (unset is the same as 0: main's placement). It is off by default and does anything only on Windows CPUs with SMT, so every target is Windows.
Targets, each with 1-2 reports. Windows with a CPU that has two logical processors a core, by model:
The 4-core ones matter most (on this PC a 4-core mask gained far more, report-only), but don't let the plan wait on them alone.
Settings: frame_rate_cap = 6 (Uncapped), vsync = 2 (Off), frame_generation = 0; headless is fine.
Scenario: Hyrule Field (HyruleField_Child), measured 30 s, 3 game starts a cell (2 at least). Compare rules, pr side, RX_VK_RT_HOME=1 vs 0: fps_mean min_delta_pct = 3 (fails on a loss of more than 3 %) and frametime_p99_ms max_delta_pct = 10; crash = false. Hitch counts (run_hitch_count, run_frametime_max_ms) report-only.
Log on the =1 cells: "vk: RX_VK_RT_HOME=1: the render thread is kept to logical processors" expected (the thread really went home: on a PC where the placement does not apply it says "free to move, as unset" instead, and that cell compares nothing).
Beanstalk test farm · an earlier run: commit
61a86ea(the newer results are in a comment below)Commit
61a86ea· approved by klimovich008 (reviewed) · dashboard⚠️ Note: The log check is unjudged when placement is not confirmed, including in the 0 cells; the schema cannot condition the performance comparison on that log, so a comparison without confirmed placement may compare equivalent modes.
⚠️ Note: The headless run does not exercise swapchain waits or reproduce the external high-priority contention needed to test the guard's escape and return behavior; it also does not compare the PR build with main.
⚠️ Note: Two starts per cell, rather than three, keep the plan within the farm's time limit; run-wide hitch count and maximum frame time are report-only.
Started at 00:10 UTC.
windows+cpu-3300x_i3-10100_i3-12100_i3-13100_i7-6700_i7-6700k_i7-7700_i7-7700k(CPU "3300x" or "i3 10100" or "i3 12100" or "i3 13100" or "i7 6700" or "i7 6700k" or "i7 7700" or "i7 7700k")windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700k(CPU "3600" or "5600" or "5600x" or "7600" or "7600x" or "i5 10400" or "i5 11400" or "i7 8700k")windows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900k(CPU "3700x" or "5700x" or "5800x" or "5800x3d" or "7700x" or "7800x3d" or "i7 10700k" or "i9 9900k")windows+cpu-i5-12400_i5-12600k_i5-13600k_i5-14600k_i7-12700k_i7-13700k(CPU "i5 12400" or "i5 12600k" or "i5 13600k" or "i5 14600k" or "i7 12700k" or "i7 13700k")hyrule-field· frame time p99 (ms)RX_VK_RT_HOME=0(reference)RX_VK_RT_HOME=1windows+cpu-3300x_i3-10100_i3-12100_i3-13100_i7-6700_i7-6700k_i7-7700_i7-7700k(CPU "3300x" or "i3 10100" or "i3 12100" or "i3 13100" or "i7 6700" or "i7 6700k" or "i7 7700" or "i7 7700k")windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700k(CPU "3600" or "5600" or "5600x" or "7600" or "7600x" or "i5 10400" or "i5 11400" or "i7 8700k")windows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900k(CPU "3700x" or "5700x" or "5800x" or "5800x3d" or "7700x" or "7800x3d" or "i7 10700k" or "i9 9900k")windows+cpu-i5-12400_i5-12600k_i5-13600k_i5-14600k_i7-12700k_i7-13700k(CPU "i5 12400" or "i5 12600k" or "i5 13600k" or "i5 14600k" or "i7 12700k" or "i7 13700k")Why it failed
windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700k:hyrule-field · RX_VK_RT_HOME=1 (PR only)crash:2 PR runs crashedwindows+cpu-i5-12400_i5-12600k_i5-13600k_i5-14600k_i7-12700k_i7-13700k:hyrule-field · RX_VK_RT_HOME=1 (PR only)field.fps_mean: RX_VK_RT_HOME=1 vs RX_VK_RT_HOME=0 (PR):38.6 → 34.0 (−11.8%); limit 3.0; the PR's own cells: RX_VK_RT_HOME=1 against RX_VK_RT_HOME=0 (RX_VK_RT_HOME=0 (PR only))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+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900k, report 1:Insufficient frame-time evidence for 1 required comparison(s). See rule results.windows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900k, report 2:Insufficient frame-time evidence for 1 required comparison(s). See rule results.What was tested
What will be tested · AI plan (
gpt-6.1-terra)On Windows SMT systems, the PR build will run in Hyrule Field with its render-thread switch set to 0 and 1, using uncapped frame rate, V-Sync off, and frame generation off. Two starts per cell measure 30 seconds of gameplay, comparing mean FPS and p99 frame time; a crash, an FPS loss over 3%, or a p99 increase over 10% fails the plan. The four-core target may wait for a matching PC, and other CPU targets may also wait if their matching online machines are not running Windows. No tester online now matches windows+cpu-3300x_i3-10100_i3-12100_i3-13100_i7-6700_i7-6700k_i7-7700_i7-7700k, windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700k: those targets wait for one.
RX_VK_RT_HOME) and off; main is not built or run.0or1(PR only).castle-gate(settings vsync=2, frame_rate_cap=6, frame_generation=0), then teleport to Hyrule Field, measure field for 30 s (after 10 s warm-up); 2 runs on each side for each of 2 cells (2 game starts a run).Measurements on `windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-`, for the PR description
Verdict: fail on windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700k (1 report):
hyrule-field crashfailed.Hardware: 1: windows+amd+amd-proprietary+dgpu
AMD Radeon RX 6600 XT, 2.0.353AMD Ryzen 5 3600 6-Core Processor, 16 GB RAMScene: hyrule-field, from the repository's save castle-gate (vsync=2, frame_rate_cap=6, frame_generation=0); 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); hyrule-field: 2 game starts a side, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)61a86ea, switch off61a86ea, switch onRX_VK_RT_HOME=0 (PR only)· expected log lines missingRX_VK_RT_HOME=0 (PR only)· field · frame time (p99) (ms)RX_VK_RT_HOME=1 (PR only)· expected log lines missingFlags and settings
RX_VK_RT_HOME0,1As Markdown for the PR description:
Measurements on `windows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700`, for the PR description
Verdict: could not be judged on windows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900k (2 reports): required frame-time comparison inconclusive (fewer than two usable starts per side).
Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu
NVIDIA GeForce RTX 5080, 621.24.0AMD Ryzen 7 7800X3D 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: hyrule-field, from the repository's save castle-gate (vsync=2, frame_rate_cap=6, frame_generation=0); 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); hyrule-field: 2 game starts a side, field 30 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)61a86ea, switch off61a86ea, switch onRX_VK_RT_HOME=0 (PR only)· expected log lines missingRX_VK_RT_HOME=0 (PR only)· field · frame time (p99) (ms)RX_VK_RT_HOME=1 (PR only)· expected log lines missingRX_VK_RT_HOME=1 (PR only)· field · frame time (p99) (ms)Flags and settings
RX_VK_RT_HOME0,1As Markdown for the PR description:
Measurements on `windows+cpu-i5-12400_i5-12600k_i5-13600k_i5-14600k_i7-12700k`, for the PR description
Verdict: fail on windows+cpu-i5-12400_i5-12600k_i5-13600k_i5-14600k_i7-12700k_i7-13700k (1 report):
hyrule-field field.fps_mean: RX_VK_RT_HOME=1 vs RX_VK_RT_HOME=0 (PR) (-11.8%)failed.Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu
NVIDIA GeForce RTX 5060 Ti, 616.56.012th Gen Intel(R) Core(TM) i5-12400, 32 GB RAMScene: hyrule-field, from the repository's save castle-gate (vsync=2, frame_rate_cap=6, frame_generation=0); 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); hyrule-field: 2 game starts a side, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)61a86ea, switch off61a86ea, switch onRX_VK_RT_HOME=0 (PR only)· expected log lines missingRX_VK_RT_HOME=0 (PR only)· field · frame time (p99) (ms)RX_VK_RT_HOME=1 (PR only)· expected log lines missingRX_VK_RT_HOME=1 (PR only)· field · frame time (p99) (ms)Flags and settings
RX_VK_RT_HOME0,1As Markdown for the PR description:
The testers' hardware
windows+cpu-3600_5600_5600x_7600_7600x_i5-10400_i5-11400_i7-8700kAMD Radeon RX 6600 XT, 2.0.353AMD Ryzen 5 3600 6-Core Processor, 16 GB RAMwindows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900kNVIDIA GeForce RTX 5080, 621.24.0AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAMwindows+cpu-3700x_5700x_5800x_5800x3d_7700x_7800x3d_i7-10700k_i9-9900kNVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAMwindows+cpu-i5-12400_i5-12600k_i5-13600k_i5-14600k_i7-12700k_i7-13700kNVIDIA GeForce RTX 5060 Ti, 616.56.012th Gen Intel(R) Core(TM) i5-12400, 32 GB RAMDoes this make sense to turn on for all platform or just Windows?
@Beanstalk run
a2dc538590#2240 on tester-jackhamer24Main against this PR's head
61a86ea7on that one tester's PC (Ryzen 5 3600, RX 6600 XT, 16 GB). The candidate side sets RX_VK_RT_HOME=1 as a [matrix.pr_only] switch with one value; the baseline side sets nothing, which is main's render-thread placement (the same placement this PR gives unset or at 0). Settings on both sides: frame_rate_cap = 6, vsync = 2, frame_generation = 0; headless. From the save castle-gate, Hyrule Field (HyruleField_Child) measured 30 s, 3 game starts a side. Rules: crash = false, judged; fps, frame times and hitches report-only. The question is only whether RX_VK_RT_HOME=1 dies on this PC more often than without it: in this PR's round (rp_f094b4859e1f981a) that PC's runs died at the commit limit with the switch unset and with it at 1.@klimovich008 started a manual run: a2dc5385901812d183c4b7f0f9d48b295f17a510 vs #2240
Candidate
#2240(61a86ea7d2) against baselinea2dc5385901812d183c4b7f0f9d48b295f17a510(a2dc538590). Done.⚠️ Note: Three starts per side can reveal crashes but cannot reliably quantify a small difference in crash frequency or establish their cause.
⚠️ Note: The run does not test the guard under a controlled external hold or the windowed swapchain path.
tester-jackhamer24About the 6-core fail on
61a86ea(rp_f094b4859e1f981a: Ryzen 5 3600, RX 6600 XT, AMD 2.0.353, 16 GB)That PC was at its memory limit, and the deaths are spread across the arms:
RX_VK_RT_HOMEunset, which is main's placement; main itself isn't run here.RX_VK_RT_HOME=0: 0 of 2 crashed.RX_VK_RT_HOME=1: 2 of 2 died, with exit 3: the renderer's out-of-memory stop. The log has commits made "at the commit limit", "a C++ allocation refused", programs not translated (std::bad_alloc), pipelines refused for want of memory,submit 92193 failed (-13), thenFATAL: the renderer's C++ allocations: refused for 5 s.Unset and
0give the same placement, yet one died 4 of 4 and the other 0 of 2. With 2 starts a cell,1's 2 of 2 can't be told apart from luck on this PC. It hasn't been shown to be the switch's.To find out, I started a manual run on that tester's PC only: main
a2dc5385against this PR's head withRX_VK_RT_HOME=1, 3 starts a side, crashes judged, frame times report-only (rn_31f9d7473c936025).1dies there and main doesn't, that goes back for a fix.The 8-core target couldn't be judged again (too few frame-time samples with 2 starts). Its p99 was 15.5 ms with the switch unset, 16.0 at
0and 16.2 at1. That isn't a result either way.0e32bc10) into perf/rt-home-v3 96bc7cca4ereplay_thread_main: where hos_reserved_cpus gives no core (a cache core choice, too few cores), the render thread is not placed and RX_VK_RT_HOME=1 or strict changed nothing without a word; the start now says so ("the host keeps no core free for the render thread on this PC, so it moves freely, as unset"), so a farm run there shows it compared the same placement twice. Unset and 0 say nothing new. tests/test_rt_pin.py checks the line's place. Co-Authored-By: Claude Opus 5.5 <[email protected]>Round 3 is pushed:
3cb7b05d(on top of61a86ea7, no rewrite). What changed and what the farm's last round showed:0e32bc10merged. #2275 (Streamline) reshaped the present's fence wait and acquire, two of the waits this PR marks. Both keep main's statements and control flow (copy_ready, its early return, the retired acquire semaphore,acquire_semaphore), with the wait insideFpsRtWait(-1);test_rt_pinpins the new forms and still fails on a removed or moved scope.a2dc5385crashed 3 of 3 starts too; the PR with=13 of 3 (the renderer's out-of-memory stop).=1run (27.73 fps; the other=1run 40.36, above both=0runs). It has the signature of main's own slow run there (a 21-24 s frame, about 3,000 draws a frame against 2,374-2,473 in the other six runs): a scene-state freeze main's build also hit. Its log says the render thread was busy (its jobs 85.72 of 89.56 ms a frame), not held off, and the guard judged its worst window blocked, not held. One run a cell can't rule out more, so I'm asking the farm again with 3 starts a cell (below).=1/stricton a PC whose host keeps no core free now say the thread "moves freely, as unset", so a farm cell there shows it compared nothing. Unset and=0print nothing new.=1against unset on this head's DLL over main0e32bc10: 85.49 -> 87.89 fps (+2.8 %, diagnostic: under 5 % with 3 pairs), CPU 55.6 -> 54.8 ms, p99 14.6 -> 14.5, the replay's submit -16 %, no frame over 50 ms in either arm, 0 holds. Smaller than round 2's Hyrule gain (+8.1 %, basedd5ffe6a) because Lost Woods is CPU-bound elsewhere; the two scenes are kept apart in the description.test_rt_pin(57 broken variants), the present-path fixtures and the fullrun_all.pyagainst main0e32bc10with clang and gcc: nothing fails only on the branch.@Beanstalk the PR's own build only, on the new head
3cb7b05d: baseline ref = pr, [matrix.pr_only] RX_VK_RT_HOME = ["1"] against unset (unset is main's placement), judged with pass.compare RX_VK_RT_HOME = "1" against unset on the pr side. 3 game starts a cell (not 2): on the last round the i5-12400's fail was one slow run in a cell of two, and the same kind of slow run (a 21-24 s frame, about 3,000 draws a frame) also hit main's build there, so one run can't decide a cell.Targets, Windows only (it does anything only on Windows CPUs with SMT), 1-2 reports each, by model:
Don't let the plan wait on any one target. Skip a PC with 16 GB or less if the plan can (the last round's Ryzen 5 3600 PC crashed main's build on 3 of 3 starts too, out of memory).
Settings: frame_rate_cap = 6 (Uncapped), vsync = 2 (Off), frame_generation = 0; headless is fine.
Scenes: Hyrule Field (HyruleField_Child) measured 30 s, as before; and, if the plan can take a teleport, Lost Woods as child (from the save kokiri-start, teleport destination 5) measured 30 s in the same start (our standard scene since 11-23). Compare rules, pr side, =1 vs unset, per scene: fps_mean min_delta_pct = 3 (fails on a loss of more than 3 %), frametime_p99_ms max_delta_pct = 10; crash = false. Hitch counts (run_hitch_count, run_frametime_max_ms) report-only.
Log on the =1 cells: "vk: RX_VK_RT_HOME=1: the render thread is kept to logical processors" expected. On a PC whose host keeps no core free it says "the host keeps no core free for the render thread on this PC, so it moves freely, as unset" instead, and that cell compares nothing. Please keep the RX_VK_RT_HOME (600 presents) lines in the report's log excerpt, for both a slow and a normal run.
Beanstalk test farm · 🔄 testing (1 of 3 reports so far)
Commit
3cb7b05· approved by klimovich008 (reviewed) · dashboard⚠️ Note: The regular baseline rules compare the PR build with the switch set against the same build with it unset; the schema does not accept unset as a pass.compare axis value.
⚠️ Note: The schema cannot suppress performance comparisons when the host reserves no core: the log identifies that same-placement case, which is not evidence of the switch's effect. The placement-line check is unjudged if the line is absent.
⚠️ Note: The farm cannot create the external contention needed to test guard recovery, exercise swapchain waits headlessly, prioritize the i5-12400 tester, or select 600-present lines for report excerpts.
Started at 2026-11-23 13:29 UTC.
⚠ No tester has a PC for
windows+ram-ge17gb+cpu-i3-10100_i3-12100_i3-13100_i7-6700_i7-6700k_i7-7700_i7-7700k_ryzen-3-3300x(none seen in 14 days): it waits until one signs in.windows+ram-ge17gb+cpu-i5-12400_i5-12600k_i5-13600k_i5-14600k_i7-12700k_i7-13700k(17 GB RAM or more, CPU "i5 12400" or "i5 12600k" or "i5 13600k" or "i5 14600k" or "i7 12700k" or "i7 13700k")windows+ram-ge17gb+cpu-i3-10100_i3-12100_i3-13100_i7-6700_i7-6700k_i7-7700_i7-7700k_ryzen-3-3300x(17 GB RAM or more, CPU "i3 10100" or "i3 12100" or "i3 13100" or "i7 6700" or "i7 6700k" or "i7 7700" or "i7 7700k" or "ryzen 3 3300x")windows+ram-ge17gb+cpu-i5-10400_i5-11400_i7-8700k_ryzen-5-3600_ryzen-5-5600_ryzen-5-5600x_ryzen-5-7600_ryzen-5-7600x(17 GB RAM or more, CPU "i5 10400" or "i5 11400" or "i7 8700k" or "ryzen 5 3600" or "ryzen 5 5600" or "ryzen 5 5600x" or "ryzen 5 7600" or "ryzen 5 7600x")What was tested
What will be tested · AI plan (
gpt-6.1-terra)On the PR build at the requested head, three Windows CPU groups will compare RX_VK_RT_HOME=1 with unset using three starts per side. Each start measures Hyrule Field and Lost Woods for 30 seconds apiece, with uncapped frame rate, V-Sync off and frame generation off. A crash, an FPS loss over 3%, or a p99 frame-time increase over 10% fails the relevant check. Some requested CPU groups may wait for eligible Windows testers; the groups can run independently. No tester online now matches windows+ram-ge17gb+cpu-i3-10100_i3-12100_i3-13100_i7-6700_i7-6700k_i7-7700_i7-7700k_ryzen-3-3300x, windows+ram-ge17gb+cpu-i5-10400_i5-11400_i7-8700k_ryzen-5-3600_ryzen-5-5600_ryzen-5-5600x_ryzen-5-7600_ryzen-5-7600x: those targets wait for one.
RX_VK_RT_HOME) and off; main is not built or run.1(PR only).kokiri-start(settings vsync=2, frame_rate_cap=6, frame_generation=0), then teleport to Hyrule Field, measure field for 30 s (after 10 s warm-up), teleport to Lost Woods, measure woods for 30 s (after 10 s warm-up); 3 runs on each side.Measurements on `windows+ram-ge17gb+cpu-i5-12400_i5-12600k_i5-13600k_i5-14600`, for the PR description
Verdict: pass on windows+ram-ge17gb+cpu-i5-12400_i5-12600k_i5-13600k_i5-14600k_i7-12700k_i7-13700k (1 report): no rule failed and no PR run crashed.
Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu
NVIDIA GeForce RTX 5060 Ti, 616.56.012th Gen Intel(R) Core(TM) i5-12400, 32 GB RAMScene: field-and-woods, from the repository's save kokiri-start (vsync=2, frame_rate_cap=6, frame_generation=0); 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); field-and-woods: 3 game starts a side, field 30 s after 10 s warm-up, woods 30 s after 10 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)3cb7b05, switch off3cb7b05, switch onRX_VK_RT_HOME=1 (PR only)· field · frame rateRX_VK_RT_HOME=1 (PR only)· woods · frame rateRX_VK_RT_HOME=1 (PR only)· field · frame time (p99) (ms)RX_VK_RT_HOME=1 (PR only)· woods · frame time (p99) (ms)RX_VK_RT_HOME=1 (PR only)· expected log lines missingFlags and settings
RX_VK_RT_HOME1As Markdown for the PR description:
The testers' hardware
windows+ram-ge17gb+cpu-i5-12400_i5-12600k_i5-13600k_i5-14600k_i7-12700k_i7-13700kNVIDIA GeForce RTX 5060 Ti, 616.56.012th Gen Intel(R) Core(TM) i5-12400, 32 GB RAM@review
Recommendation: Request changes. The guard now judges long contention windows, and the reported tests show it responding to synthetic holds. The gain against the current base and the real #838 contention case still need measurement before the default can be settled. (It stands on L6: The check
Guide screenshots / Guide images and local UI source review (pull_request)fails on this head and passes on the base branch: Failing after 13s.)Adds an opt-in Windows render-thread affinity mode with a guard that temporarily releases the affinity when another workload holds the reserved core. It may improve CPU-bound performance, at the cost of guard complexity and approximately one stall frame each time contention is encountered after returning home.
Blocking (1): must change before merging.
Guide screenshots / Guide images and local UI source review (pull_request)fails on this head and passes on the base branch: Failing after 13s.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L6.Since the last review (on
5867310bc8)Resolved: L1 (The guard discards every window longer than 250 ms, including windows caused by the conten…); L2 (The threshold parser accepts values that the guard cannot normally reach because it discar…); L4 (The farm crashes with the switch both on and off need a base-side comparison.)
Still open: L3 (The current head and base need an in-game performance comparison before the gain and defau…); L5 (The guard has not been checked against the real contention case it is intended to mitigate…)
New: L6 (The check
Guide screenshots / Guide images and local UI source review (pull_request)fai…)Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven against the current base: the current-build switch comparison reports 85.49 to 87.89 fps (+2.8%) in Lost Woods over three pairs, with p99 14.61 to 14.47 ms. The earlier Hyrule Field comparison reports +8.1% on a different base; neither is a repeated current-head build versus current-base build comparison.
Other systems: The affinity change targets Windows SMT CPUs; Linux and macOS retain their existing placement. Intel, hybrid and lower-core-count Windows systems, SMT-off operation and the real PresentMon contention case remain insufficiently tested. The reported base comparisons reproduce the farm crashes on the affected PCs.
Switches: RX_VK_RT_HOME defaults to unset/free placement; 1 enables guarded home placement and strict disables the guard for measurement. RX_VK_RT_HOME_MS defaults to 4 ms and accepts 1–1000 ms. The off default avoids imposing the unconfirmed placement on players; an enabled default remains a measurement and maintainer decision.
Reviewed:
3cb7b05d07against0e32bc100d: Read AGENTS.md, CONTRIBUTING.md, the ledger and supplied review and run reports; examined the guard and the changes since the ledger, including the wait instrumentation and test changes. The large replay implementation, generated fixtures and test suite were skimmed rather than read in full; docs/review-checklist.md is absent.; nothing run (a code review).Checked and fine:
Testing: No commands that build or execute project code were run. The author reports Windows in-game measurements, synthetic contention runs, and game-free checks on Windows and Linux; the real contention case and current-base performance comparison remain outstanding.
Overlaps and merge order: No overlapping pull request was identified from the supplied material; #2275 is already merged into the base.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
Answers to review 2429 (on
3cb7b05d):L6 (Guide screenshots): not this PR's. The check fails on main itself:
0e32bc10: https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/50801/jobs/0f9fb7449: https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/51382/jobs/0host/hos_thread.c) https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/51319/jobs/0, and #1282; all "Failing after 9-14s".Why, run locally:
scripts/check_guide_screenshots.py --review-sourceson main 0e32bc10's tree reports 8 "REVIEW REQUIRED" lines forsettings-graphics.png(device_policy.h,menu/threads.cpp,threaded_rendering.h,vk_api.h,vk_dlss.h,vk_menu.cpp,vk_menu.h,vk_recorder.hchanged since its reviewed revision), so main fails it. On this head it reports the same 8 plusvk_fps.h, which this PR changes for the render thread's wait accounting (FpsRtWait), not the Graphics page. The fix is a screenshot review and new hashes on main, not something in this PR, so I'm declining@fixhere; once main's review hashes are updated,vk_fps.hcan go into the same review.L5 (#838, PresentMon on an i5-13600K): still not run. The farm says it can't create that contention ("The farm cannot create the external contention needed to test guard recovery", on this head's plan). It needs a tester with that CPU running Intel's PresentMon service, with the switch unset and
=1, recording long frames and theRX_VK_RT_HOMElines. I can write that up as a manual request for a tester who has the setup.L3 (main against the current head, in the game): run. Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2. Lost Woods as child (the standard scene: the profile save, then the teleport), fast rotation, 16:9, frame rate unlocked (
HOS_FPS_MAX=240),RX_VK_ASYNC=1, a fixed light GPU load beside the game, 20 s window, 3 alternating pairs, none rejected, 16:05-16:14Z. Before: main 0e32bc10's own build (longshot.exeb658e14b,longshot_vk.dll0551f256), nothing set. After: the same exe with this head's renderer (longshot_vk.dllf65e5e69, built from25dd2d2e;3cb7b05dadds a test only),RX_VK_RT_HOME=1. The 1 % low is 1000 / the mean of the slowest 1 % of the window's frame times (from each run's present log); the rest is the harness's.0e32bc103cb7b05d,RX_VK_RT_HOME=1Pairs: +3.0 %, +1.6 %, +3.5 %; every
1run above every main run. Under 5 % with 3 pairs, so the harness calls it diagnostic. It agrees with the switch-against-unset sessions on this head's code (+2.8 % and +2.6 %, Lost Woods). The gain is smaller than round 2's Hyrule Field result (+8.1 %, on basedd5ffe6a, a different scene) because Lost Woods is CPU-bound in the game's job workers, not in the render thread.The farm on this head, i5-12400 (rp_3a2353eac6aa882a, RTX 5060 Ti, NVIDIA 616.56, Windows; this PR's build,
=1against unset): pass. Hyrule Field then Lost Woods, 30 s each:=1side 2 (its third start timed out at the farm's teleport to Hyrule Field, in Kokiri Forest). The Hyrule p99 median is carried by two switch-off starts with stutter (p99 86.0 and 312.9 ms); the third switch-off start (26.8 ms) was better than both=1starts (32.5, 30.8). So: no slow=1run this time, and no loss in either scene, but the size of the p99 gain is not settled by these starts.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.