fix(host): the render thread's reserved core is one the game may run on, under a launcher's or Process Lasso's affinity mask too #1776

Merged
HumanBean merged 5 commits from klimovich008/Longshot:fix/reserved-core-process-mask into main 2026-11-20 22:55:33 +00:00
Member

Summary

When the game is started kept to some of the CPU's cores (an affinity mask from a launcher, Process Lasso, start /affinity, or keeping a dual-CCD Ryzen to one CCD), the core kept free for the render thread could be one the game isn't allowed to use. Windows then refused to pin the render thread there, nothing was kept free, and the log still said it was pinned. #522 fixed this for the fallback path; the main path (the last core of the fastest kind, on Windows and on Linux hybrid CPUs) returned before that check.

This PR picks the reserved core only among the cores whose logical processors are all in the process's mask, on every path, or none when the mask has no whole core or fewer than 8 logical processors. The render thread's pin checks Windows' answer, and a refused pin is logged. With no mask the choice is the same as before. No switch, setting or cache changes; 7950X3D / 9950X3D players are unaffected by default (their cache-core rule keeps no reserved core, as before).

How to see it on main: Windows, a CPU with 8+ cores, start the game with start "" /affinity 0FFF longshot.exe (on a 16-thread CPU), play, and read longshot_log.txt: it says reserved core 0xc000 and "may run on 0xcfff", but the render thread's real affinity is 0xfff (the pin was refused) and the game's threads use all of 0xfff. Under 0x5555 the log says "may run on 0xd555", the render thread really runs on 0x5555, and logical processor 14 has no game thread.

What changed, to read first:

  • host/hos_thread.c: new process_cpus() (the process's mask from GetProcessAffinityMask; every processor when it can't be read, as Windows gives 0 for a process in several processor groups). pick_reserved_core() takes the allowed mask: a core with a logical processor outside it is neither a candidate nor counted toward the 8 logical processors or the 4 fastest cores. Windows' last_fastest_core, its legacy twin and Linux's /sys/devices/cpu_core path pass it; the fallback uses process_cpus() too. The reserved-core log lines name the mask they chose from.
  • gpu/vk/vk_replay.cpp: replay_thread_main checks SetThreadAffinityMask; refused, it logs vk: the replay thread was NOT kept to logical processors ... and prints neither "runs on" nor "may run on". ReplayPin (RX_VK_ASYNC=0) logs a refused pin once. Not a shader-cache stamp file.
  • tests/test_reserved_core_mask.py (new): cuts the real hos_reserved_cpus (Windows and Linux branches) and the replay thread's placement, over fake CPUs (8-core SMT, i7-12700K, 7950X3D, Core Ultra 7 265KF, legacy API) and masks, with a fake SetThreadAffinityMask that refuses a mask outside the process's as Windows does. tests/test_reserved_core.py follows the new argument.

See #522.

Testing

Tested: On my PC (Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2), in the game in Hyrule Field: with no mask, under 0x0FFF and under 0x5555, on main and on this PR, reading the log and the threads' real affinity (Measurements); the no-mask A/B and the keep-a-core vs none A/B under 0x0FFF. Game-free: tests/test_reserved_core_mask.py passes with g++ 16.2 and clang++ 23.1.5, on Windows and WSL Ubuntu, fails with main's sources, and its 6 broken variants each fail; tests/test_reserved_core.py passes on Windows and Linux; a no-mask differential runs main's and this PR's hos_reserved_cpus on 200,000 random machines (1-64 cores, SMT or not, hybrid or one kind, L3 splits, the Ex call failing, HOS_RESERVE_CORE unset/0/1, Linux with and without cpu_core), mask = all, unreadable or failing: every choice equal; with random masks every choice of this PR lies inside the mask. After merging main 89c3d21e: both tests pass again (g++ and clang++; the new one fails with main 89c3d21e's sources and its broken variants fail), the no-mask differential against main 89c3d21e's code is equal, host/hos_thread.c compiles whole with llvm-mingw (the same 28 warnings as main), linux_syntax.sh ok for both files. python -I -B tests/run_all.py --strict --jobs 4 (mise run test), Windows, llvm-mingw 20261104: this PR 762 passed, 72 failed, 48 skipped; main 89c3d21e on the same PC 761 / 72 / 48, the same 72 failing checks (this Windows checkout's; they fail on main too), the extra pass is the new test. mise run lint: the known SC2016 info at build-windows.yml:82 only.

Test Farm, round 2 on 0573496 (no mask, uncapped, windowed, Hyrule Field, 2 runs a side against main 3653c9c): Linux pass on an RX 7900 XTX (RADV 26.2.7) and a GTX 1070 (580.196.7), 65.2 vs 65.9 fps, p99 20.1 vs 19.7 ms. Windows NVIDIA: on an RTX 3080 Ti (621.24.0) all four runs clean, this PR 99.21 / 101.01 fps against main 100.22 / 101.89 (flat). On an RTX 4070 Ti SUPER (621.14.0) one PR run crashed with 0xC0000005 inside NVIDIA's shader compiler (nvgpucomp64.dll+0x607360, right after "a C++ allocation refused (at the commit limit?)") and one main run crashed too (0xC0000409): that PC's driver or memory, not this PR (reports rp_fd86096052384aa1, rp_f04e079bcd5c1698). Round 1's Linux RADV runs passed as well (89.2 vs 88.9 fps).

Still to test:

  • Windows, a CPU with 8+ cores: start the game with start "" /affinity <a mask leaving out the last core>, expecting the log's reserved core inside the mask, the render thread's real affinity as logged and no "NOT kept" line (by hand: the farm can't start the game with an affinity mask)
  • Windows, a hybrid Intel CPU (P- and E-cores), any GPU: normal play with no mask, Hyrule Field, uncapped, this PR against main, expecting fps and frametime p99 the same and the log's reserved-core line unchanged (@Beanstalk, when a hybrid Intel tester is free)

Not covered: the legacy API, dual-CCD X3D (HOS_RESERVE_CORE=1) and Linux hybrid paths on real hardware (the game-free test and the differential stand in for them); a mask applied to a game already running (Process Lasso's usual way) or changed after start: the choice is made once at start, before and after this PR; Windows with more than 64 logical processors (fixture only); a real 6-core CPU for whether a reserved core pays off there (a question for every 6-core CPU, not this PR).

Measurements

Verdict: a fix, not a speed-up. With no mask it is unchanged (A/B within noise). Under a mask the log is now true and the render thread's real affinity matches it; keeping one core of a 6-core mask for the render thread costs at most about 1 % fps (inside the noise) and about 1.5-3 % CPU ms a frame on this PC, the same rule an unmasked 6-core, 12-thread CPU already gets (#522).

Setup: Windows 11, Ryzen 7 5700X3D (8 cores, 16 threads), RX 9070 XT, AMD 26.11.2. Hyrule Field, fast camera rotation, 16:9 window, frame rate unlocked (HOS_FPS_MAX=240), render thread on, a fixed background CPU load; 3 alternating pairs, a 20 s window each, the median; game clock 1.000 in every run (a <5 % result with 3 pairs is diagnostic only). Thread affinity read from the running game (NtQueryInformationThread, read-only). Masked rows: start "" /affinity 0FFF (or 5555); "none kept": HOS_RESERVE_CORE=0.
Baseline: measured on main 1055077d with this PR's commit a8476710; main has been merged in since (3653c9c5, then 89c3d21e) with no change to these files' code outside this PR, and the farm's no-mask runs above are on the merged head.

Before: main @ 1055077d After: this PR @ a8476710
No mask, fps (median of 3) 72.99 73.79
No mask, CPU ms a frame (median) 57.32 57.74
No mask, frametime p99 ms (median) 19.59 18.48
No mask, frames over 100 ms (3 runs) 3 (one 301 ms stall, a known file-backed wait) 0
No mask, reserved core in the log 0xc000 0xc000
Mask 0x0FFF, reserved core in the log 0xc000 (outside the mask) 0xc00
Mask 0x0FFF, render thread's real affinity 0xfff (pin refused; log said 0xcfff) 0xfff (as logged)
Mask 0x0FFF, game threads' affinity 0xfff (nothing kept free) 0x3ff
Mask 0x5555, reserved core in the log 0xc000 0 (no whole core in the mask)
Mask 0x5555, game threads' affinity 0x1555 (one logical processor left empty) 0x5555

Keeping a core under 0x0FFF (this PR) against keeping none (HOS_RESERVE_CORE=0), 3 pairs: fps 69.94 vs 70.89, CPU ms 61.47 vs 59.77 (medians); per pair fps -5.4 % (a 321 ms frame in this PR's arm, a Presentation Thread hold), +0.6 %, -1.2 %; CPU ms +5.4 %, +0.4 %, +1.5 %. Without the pair with the stall the two are within about 1 % fps.

no mask, both:   vk: reserved core mask (enhanced): 0xc000 ...      (the same 13 placement lines once "(of ...)" is removed)
main, 0x0FFF:    vk: reserved core mask (enhanced): 0xc000 (8 cores)       real replay thread affinity 0xfff
this PR, 0x0FFF: vk: reserved core mask (enhanced): 0xc00 (6 cores; a core the process may run on wholly, of 0xfff)
                                                                            real replay thread affinity 0xfff
game-free:       test_reserved_core_mask: ok   (with main's sources: "process mask 0xfff: reserved 0xc000, want 0xc00")

No switch added: the change restores #522's rule on the paths that skipped it. HOS_RESERVE_CORE=0 (none) and HOS_RESERVE_CORE_MASK=<hex> stay the overrides.

Risks

Under a mask that keeps whole cores, the game's threads now get one core of the mask fewer (the render thread has it), the same as an unmasked CPU of that size today; measured above at about 1 % fps. With no mask nothing changes. A small leftover: with HOS_RESERVE_CORE_MASK set outside the process's mask and RX_VK_ASYNC=0, the "replays run on ..." announcement still prints before the new "NOT kept" line (a test override only; the PR no longer picks such a core). Off: HOS_RESERVE_CORE=0 keeps no core; otherwise a revert is enough. After updating a player notices nothing: no save, option, shader or pipeline cache, or renderer API change.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary When the game is started kept to some of the CPU's cores (an affinity mask from a launcher, Process Lasso, `start /affinity`, or keeping a dual-CCD Ryzen to one CCD), the core kept free for the render thread could be one the game isn't allowed to use. Windows then refused to pin the render thread there, nothing was kept free, and the log still said it was pinned. #522 fixed this for the fallback path; the main path (the last core of the fastest kind, on Windows and on Linux hybrid CPUs) returned before that check. This PR picks the reserved core only among the cores whose logical processors are all in the process's mask, on every path, or none when the mask has no whole core or fewer than 8 logical processors. The render thread's pin checks Windows' answer, and a refused pin is logged. With no mask the choice is the same as before. No switch, setting or cache changes; 7950X3D / 9950X3D players are unaffected by default (their cache-core rule keeps no reserved core, as before). **How to see it on main:** Windows, a CPU with 8+ cores, start the game with `start "" /affinity 0FFF longshot.exe` (on a 16-thread CPU), play, and read `longshot_log.txt`: it says reserved core `0xc000` and "may run on 0xcfff", but the render thread's real affinity is `0xfff` (the pin was refused) and the game's threads use all of `0xfff`. Under `0x5555` the log says "may run on 0xd555", the render thread really runs on `0x5555`, and logical processor 14 has no game thread. What changed, to read first: - `host/hos_thread.c`: new `process_cpus()` (the process's mask from `GetProcessAffinityMask`; every processor when it can't be read, as Windows gives 0 for a process in several processor groups). `pick_reserved_core()` takes the allowed mask: a core with a logical processor outside it is neither a candidate nor counted toward the 8 logical processors or the 4 fastest cores. Windows' `last_fastest_core`, its legacy twin and Linux's `/sys/devices/cpu_core` path pass it; the fallback uses `process_cpus()` too. The reserved-core log lines name the mask they chose from. - `gpu/vk/vk_replay.cpp`: `replay_thread_main` checks `SetThreadAffinityMask`; refused, it logs `vk: the replay thread was NOT kept to logical processors ...` and prints neither "runs on" nor "may run on". `ReplayPin` (`RX_VK_ASYNC=0`) logs a refused pin once. Not a shader-cache stamp file. - `tests/test_reserved_core_mask.py` (new): cuts the real `hos_reserved_cpus` (Windows and Linux branches) and the replay thread's placement, over fake CPUs (8-core SMT, i7-12700K, 7950X3D, Core Ultra 7 265KF, legacy API) and masks, with a fake `SetThreadAffinityMask` that refuses a mask outside the process's as Windows does. `tests/test_reserved_core.py` follows the new argument. See #522. ## Testing **Tested:** On my PC (Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2), in the game in Hyrule Field: with no mask, under `0x0FFF` and under `0x5555`, on main and on this PR, reading the log and the threads' real affinity (Measurements); the no-mask A/B and the keep-a-core vs none A/B under `0x0FFF`. Game-free: `tests/test_reserved_core_mask.py` passes with g++ 16.2 and clang++ 23.1.5, on Windows and WSL Ubuntu, fails with main's sources, and its 6 broken variants each fail; `tests/test_reserved_core.py` passes on Windows and Linux; a no-mask differential runs main's and this PR's `hos_reserved_cpus` on 200,000 random machines (1-64 cores, SMT or not, hybrid or one kind, L3 splits, the Ex call failing, `HOS_RESERVE_CORE` unset/0/1, Linux with and without `cpu_core`), mask = all, unreadable or failing: every choice equal; with random masks every choice of this PR lies inside the mask. After merging main 89c3d21e: both tests pass again (g++ and clang++; the new one fails with main 89c3d21e's sources and its broken variants fail), the no-mask differential against main 89c3d21e's code is equal, `host/hos_thread.c` compiles whole with llvm-mingw (the same 28 warnings as main), `linux_syntax.sh` ok for both files. `python -I -B tests/run_all.py --strict --jobs 4` (`mise run test`), Windows, llvm-mingw 20261104: this PR 762 passed, 72 failed, 48 skipped; main 89c3d21e on the same PC 761 / 72 / 48, the same 72 failing checks (this Windows checkout's; they fail on main too), the extra pass is the new test. `mise run lint`: the known SC2016 info at `build-windows.yml:82` only. Test Farm, round 2 on 0573496 (no mask, uncapped, windowed, Hyrule Field, 2 runs a side against main 3653c9c): Linux pass on an RX 7900 XTX (RADV 26.2.7) and a GTX 1070 (580.196.7), 65.2 vs 65.9 fps, p99 20.1 vs 19.7 ms. Windows NVIDIA: on an RTX 3080 Ti (621.24.0) all four runs clean, this PR 99.21 / 101.01 fps against main 100.22 / 101.89 (flat). On an RTX 4070 Ti SUPER (621.14.0) one PR run crashed with 0xC0000005 inside NVIDIA's shader compiler (`nvgpucomp64.dll+0x607360`, right after "a C++ allocation refused (at the commit limit?)") and one main run crashed too (0xC0000409): that PC's driver or memory, not this PR (reports rp_fd86096052384aa1, rp_f04e079bcd5c1698). Round 1's Linux RADV runs passed as well (89.2 vs 88.9 fps). **Still to test:** - Windows, a CPU with 8+ cores: start the game with `start "" /affinity <a mask leaving out the last core>`, expecting the log's reserved core inside the mask, the render thread's real affinity as logged and no "NOT kept" line (by hand: the farm can't start the game with an affinity mask) - Windows, a hybrid Intel CPU (P- and E-cores), any GPU: normal play with no mask, Hyrule Field, uncapped, this PR against main, expecting fps and frametime p99 the same and the log's reserved-core line unchanged (@Beanstalk, when a hybrid Intel tester is free) Not covered: the legacy API, dual-CCD X3D (`HOS_RESERVE_CORE=1`) and Linux hybrid paths on real hardware (the game-free test and the differential stand in for them); a mask applied to a game already running (Process Lasso's usual way) or changed after start: the choice is made once at start, before and after this PR; Windows with more than 64 logical processors (fixture only); a real 6-core CPU for whether a reserved core pays off there (a question for every 6-core CPU, not this PR). ## Measurements **Verdict:** a fix, not a speed-up. With no mask it is unchanged (A/B within noise). Under a mask the log is now true and the render thread's real affinity matches it; keeping one core of a 6-core mask for the render thread costs at most about 1 % fps (inside the noise) and about 1.5-3 % CPU ms a frame on this PC, the same rule an unmasked 6-core, 12-thread CPU already gets (#522). Setup: Windows 11, Ryzen 7 5700X3D (8 cores, 16 threads), RX 9070 XT, AMD 26.11.2. Hyrule Field, fast camera rotation, 16:9 window, frame rate unlocked (`HOS_FPS_MAX=240`), render thread on, a fixed background CPU load; 3 alternating pairs, a 20 s window each, the median; game clock 1.000 in every run (a <5 % result with 3 pairs is diagnostic only). Thread affinity read from the running game (`NtQueryInformationThread`, read-only). Masked rows: `start "" /affinity 0FFF` (or `5555`); "none kept": `HOS_RESERVE_CORE=0`. Baseline: measured on main 1055077d with this PR's commit a8476710; main has been merged in since (3653c9c5, then 89c3d21e) with no change to these files' code outside this PR, and the farm's no-mask runs above are on the merged head. | | Before: main @ 1055077d | After: this PR @ a8476710 | |---|---|---| | No mask, fps (median of 3) | 72.99 | 73.79 | | No mask, CPU ms a frame (median) | 57.32 | 57.74 | | No mask, frametime p99 ms (median) | 19.59 | 18.48 | | No mask, frames over 100 ms (3 runs) | 3 (one 301 ms stall, a known file-backed wait) | 0 | | No mask, reserved core in the log | 0xc000 | 0xc000 | | Mask 0x0FFF, reserved core in the log | 0xc000 (outside the mask) | 0xc00 | | Mask 0x0FFF, render thread's real affinity | 0xfff (pin refused; log said 0xcfff) | 0xfff (as logged) | | Mask 0x0FFF, game threads' affinity | 0xfff (nothing kept free) | 0x3ff | | Mask 0x5555, reserved core in the log | 0xc000 | 0 (no whole core in the mask) | | Mask 0x5555, game threads' affinity | 0x1555 (one logical processor left empty) | 0x5555 | Keeping a core under 0x0FFF (this PR) against keeping none (`HOS_RESERVE_CORE=0`), 3 pairs: fps 69.94 vs 70.89, CPU ms 61.47 vs 59.77 (medians); per pair fps -5.4 % (a 321 ms frame in this PR's arm, a Presentation Thread hold), +0.6 %, -1.2 %; CPU ms +5.4 %, +0.4 %, +1.5 %. Without the pair with the stall the two are within about 1 % fps. ``` no mask, both: vk: reserved core mask (enhanced): 0xc000 ... (the same 13 placement lines once "(of ...)" is removed) main, 0x0FFF: vk: reserved core mask (enhanced): 0xc000 (8 cores) real replay thread affinity 0xfff this PR, 0x0FFF: vk: reserved core mask (enhanced): 0xc00 (6 cores; a core the process may run on wholly, of 0xfff) real replay thread affinity 0xfff game-free: test_reserved_core_mask: ok (with main's sources: "process mask 0xfff: reserved 0xc000, want 0xc00") ``` No switch added: the change restores #522's rule on the paths that skipped it. `HOS_RESERVE_CORE=0` (none) and `HOS_RESERVE_CORE_MASK=<hex>` stay the overrides. ## Risks Under a mask that keeps whole cores, the game's threads now get one core of the mask fewer (the render thread has it), the same as an unmasked CPU of that size today; measured above at about 1 % fps. With no mask nothing changes. A small leftover: with `HOS_RESERVE_CORE_MASK` set outside the process's mask and `RX_VK_ASYNC=0`, the "replays run on ..." announcement still prints before the new "NOT kept" line (a test override only; the PR no longer picks such a core). Off: `HOS_RESERVE_CORE=0` keeps no core; otherwise a revert is enough. After updating a player notices nothing: no save, option, shader or pipeline cache, or renderer API change. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
#522 kept hos_reserved_cpus' fallback to the cores whose logical processors are all in the
process's affinity mask, but the choice of the last core of the fastest kind (Windows'
last_fastest_core and its legacy twin, Linux's /sys/devices/cpu_core one) returned before
that check. Under a launcher's, Process Lasso's or `start /affinity` mask that leaves the last
core out (0x0FFF of 16), 0xC000 was kept: the game's threads lost nothing they had, the
replay thread's SetThreadAffinityMask to it was refused, and the log said it was pinned.

pick_reserved_core now chooses among the cores the process may run on wholly
(process_cpus: GetProcessAffinityMask, every processor when it cannot be read), as the
fallback does; with no mask the choice is the one before. The replay thread's pin and
ReplayPin check SetThreadAffinityMask's result and log a refusal instead of the placement.

tests/test_reserved_core_mask.py runs the real hos_reserved_cpus (Windows and Linux branches)
and the replay thread's placement over fake topologies and masks, with three broken variants.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The checker's cases for tests/test_reserved_core_mask.py: no mask, an unreadable one (0) and a failing
GetProcessAffinityMask on the hybrid enhanced path, the legacy path (one kind and hybrid, and hybrid kept to
its performance cores), the 7950X3D with HOS_RESERVE_CORE=1 and the Linux hybrid and fallback paths, each the
core the base kept. Broken variants that must fail: Linux's last_fastest_core not passing the mask, the legacy
path without the mask, and an unreadable mask taken as no processor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
test(host): end test_reserved_core.py with a newline (pre-commit's end-of-file-fixer on a changed file)
Some checks failed
beanstalk/windows 0/1 pass, 0 running, 0 queued
beanstalk/windows+vram-ge6gb 1/1 fail
beanstalk/linux 2/1 pass
beanstalk/approval approved by klimovich008 (reviewed)
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 23s
Third-party parts / As their notes say (pull_request) Successful in 40s
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 28s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 33s
CI / Workflow lint (actionlint) (pull_request) Successful in 35s
0573496cdc
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2, Hyrule Field (16:9 window, uncapped): with no affinity mask the reserved core (0xc000), the log and every thread's real affinity are the same as main's; started under 0x0FFF the reserved core is 0xc00 and the render thread really runs where the log says (main: log 0xcfff, real 0xfff, pin refused); under 0x5555 no core is kept and the game's threads have the whole mask. Standard A/B with no mask, 3 pairs: 72.99 vs 73.79 fps, within noise.

Tested in game: Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2, Hyrule Field (16:9 window, uncapped): with no affinity mask the reserved core (0xc000), the log and every thread's real affinity are the same as main's; started under 0x0FFF the reserved core is 0xc00 and the render thread really runs where the log says (main: log 0xcfff, real 0xfff, pin refused); under 0x5555 no core is kept and the game's threads have the whole mask. Standard A/B with no mask, 3 pairs: 72.99 vs 73.79 fps, within noise.
Author
Member

@Beanstalk Check that normal play is unchanged against main with no affinity mask. This PR only changes which core is kept for the render thread when the game runs under a CPU affinity mask; with no mask it must pick the same core and run the same. Targets: Windows and Linux, any GPU; a hybrid Intel CPU (P and E cores) and a dual-CCD Ryzen (7900X, 7950X, 9900X, 9950X, X3D or not) are the most useful, since this PC can't run those paths. Run uncapped so a difference could show: frame_rate_cap = 6, vsync = 2, frame_generation = 0, fullscreen = 0, the same in every cell. Hyrule Field from kokiri-start, a 10 s warm-up, then 30 s measured, 2-3 runs a side. Compare fps_mean and frametime_p99_ms with main; keep run_hitch_count and run_frametime_max_ms report-only, not pass rules. Also report the log's reserved-core line with a log_match probe, report-only (a V-Cache CPU may log no such line): expected vk: reserved core (one of the reserved core mask or reserved core selection lines, or the fallback's), and forbidden NOT kept (the new line for a refused pin, which must not appear with no mask). The fix's own case needs the game started with an affinity mask (start /affinity, taskset), which I don't think the farm can do; a person will be asked for that run, so no masked cell is needed here.

@Beanstalk Check that normal play is unchanged against main with no affinity mask. This PR only changes which core is kept for the render thread when the game runs under a CPU affinity mask; with no mask it must pick the same core and run the same. Targets: Windows and Linux, any GPU; a hybrid Intel CPU (P and E cores) and a dual-CCD Ryzen (7900X, 7950X, 9900X, 9950X, X3D or not) are the most useful, since this PC can't run those paths. Run uncapped so a difference could show: `frame_rate_cap = 6`, `vsync = 2`, `frame_generation = 0`, `fullscreen = 0`, the same in every cell. Hyrule Field from `kokiri-start`, a 10 s warm-up, then 30 s measured, 2-3 runs a side. Compare `fps_mean` and `frametime_p99_ms` with main; keep `run_hitch_count` and `run_frametime_max_ms` report-only, not pass rules. Also report the log's reserved-core line with a `log_match` probe, report-only (a V-Cache CPU may log no such line): expected `vk: reserved core` (one of the `reserved core mask` or `reserved core selection` lines, or the fallback's), and forbidden `NOT kept` (the new line for a refused pin, which must not appear with no mask). The fix's own case needs the game started with an affinity mask (`start /affinity`, taskset), which I don't think the farm can do; a person will be asked for that run, so no masked cell is needed here.
Member
Beanstalk test farm · an earlier run: commit 0573496 (the newer results are in a comment below)

Commit 0573496 · tier reviewed · approved by klimovich008 · dashboard

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

On Windows and Linux, the plan compares unmasked play against main in Hyrule Field with the frame rate uncapped. Two runs per side use a 10-second warm-up and a 30-second measurement, taking about 22 minutes per tester. A crash, an FPS drop over 10%, or a p99 frametime increase over 15% fails the plan; hitch and reserved-core log results are report-only. The affinity-mask case and exact reserved-core selection are not verified by this plan.

  • Where: windows (1-2 reports), linux (1-2 reports).
  • field-unmasked: from the repository's save kokiri-start (settings vsync=2, fullscreen=0, 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.
  • Measured: crashes, frame times, stutters and hitches, draws and frame rate, the game's log.
  • The PR fails if: it crashes; or frame rate is more than 10% below main; or frame time (p99) is more than 15% above main.
  • Time: about 23 min of game runs per tester (4 game starts), plus the two builds.

Done (started 18:53 UTC, last report 19:19 UTC). Comment @Beanstalk to run it again.

Target Reports Crash Frame p99 (ms) vs main VRAM peak (MB) vs main Result
windows · 1: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.24.0; 2: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070 Ti, 621.14.0 2/1 1 2 none — — error
linux · 1: linux+amd+radv+dgpu AMD Radeon RX 9070 XT (RADV GFX1201), 26.2.6; 2: linux+amd+radv+dgpu AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7 2/1 1 2 none 14.5 vs 14.8 (−2%) — pass ⚠ outlier

Measurements · windows

Verdict: could not be judged on windows (2/1 report).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.24.0 AMD Ryzen 7 5800H with Radeon Graphics, 16 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070 Ti, 621.14.0 AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM
Scene: field-unmasked, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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-unmasked: 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 (@Beanstalk on this PR runs it again)

Nothing was measured: no metric came back.

Flags and settings

None: the plan varied no setting, switch or build option.

Markdown for the PR description
## Measurements

**Verdict:** could not be judged on windows (2/1 report).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.24.0` `AMD Ryzen 7 5800H with Radeon Graphics, 16 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti, 621.14.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM`  
Scene: field-unmasked, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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-unmasked: 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 (`@Beanstalk` on this PR runs it again)

Nothing was measured: no metric came back.

### Flags and settings

None: the plan varied no setting, switch or build option.

Measurements · linux

Verdict: pass on linux (2/1 report): no rule failed and no PR run crashed.

Hardware: 1: linux+amd+radv+dgpu AMD Radeon RX 9070 XT (RADV GFX1201), 26.2.6 11th Gen Intel(R) Core(TM) i9-11900KB @ 3.30GHz, 32 GB RAM; 2: linux+amd+radv+dgpu AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7 AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM
Scene: field-unmasked, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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-unmasked: 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 (@Beanstalk on this PR runs it again)

Before: main @ 3653c9c After: this PR @ 0573496
field-unmasked · field · frame rate 89.2 88.9 (−0%)
field-unmasked · field · frame time (p99) (ms) 14.8 14.5 (−2%)

Flags and settings

None: the plan varied no setting, switch or build option.

Markdown for the PR description
## Measurements

**Verdict:** pass on linux (2/1 report): no rule failed and no PR run crashed.

Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.2.6` `11th Gen Intel(R) Core(TM) i9-11900KB @ 3.30GHz, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM`  
Scene: field-unmasked, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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-unmasked: 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 (`@Beanstalk` on this PR runs it again)

| | Before: main @ 3653c9c | After: this PR @ 0573496 |
|---|---|---|
| field-unmasked · field · frame rate | 89.2 | 88.9 (−0%) |
| field-unmasked · field · frame time (p99) (ms) | 14.8 | 14.5 (−2%) |

### Flags and settings

None: the plan varied no setting, switch or build option.
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>0573496</code> (the newer results are in a comment below)</summary> Commit `0573496` · tier **reviewed** · approved by klimovich008 · [dashboard](https://beanstalk.magicbean.dev/prs/1776) **What will be tested** · AI plan (`gpt-6.1-terra`) On Windows and Linux, the plan compares unmasked play against main in Hyrule Field with the frame rate uncapped. Two runs per side use a 10-second warm-up and a 30-second measurement, taking about 22 minutes per tester. A crash, an FPS drop over 10%, or a p99 frametime increase over 15% fails the plan; hitch and reserved-core log results are report-only. The affinity-mask case and exact reserved-core selection are not verified by this plan. - **Where:** windows (1-2 reports), linux (1-2 reports). - **field-unmasked:** from the repository's save `kokiri-start` (settings vsync=2, fullscreen=0, 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. - **Measured:** crashes, frame times, stutters and hitches, draws and frame rate, the game's log. - **The PR fails if:** it crashes; or frame rate is more than 10% below main; or frame time (p99) is more than 15% above main. - **Time:** about 23 min of game runs per tester (4 game starts), plus the two builds. Done (started 18:53 UTC, last report 19:19 UTC). Comment `@Beanstalk` to run it again. | Target | Reports | Crash | Frame p99 (ms) vs main | VRAM peak (MB) vs main | Result | | --- | --- | --- | --- | --- | --- | | windows · 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.24.0`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti, 621.14.0` | 2/1 [1](https://beanstalk.magicbean.dev/reports/rp_c30a910ec09a754d) [2](https://beanstalk.magicbean.dev/reports/rp_4c9df513d9770ff1) | none | — | — | error | | linux · 1: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.2.6`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` | 2/1 [1](https://beanstalk.magicbean.dev/reports/rp_834abc79915f918a) [2](https://beanstalk.magicbean.dev/reports/rp_3f15a894525fcf2a) | none | 14.5 vs 14.8 (−2%) | — | pass ⚠ outlier | #### Measurements · windows **Verdict:** could not be judged on windows (2/1 report). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.24.0` `AMD Ryzen 7 5800H with Radeon Graphics, 16 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti, 621.14.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM` Scene: field-unmasked, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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-unmasked: 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 (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. ### Flags and settings None: the plan varied no setting, switch or build option. <details><summary>Markdown for the PR description</summary> ```markdown ## Measurements **Verdict:** could not be judged on windows (2/1 report). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.24.0` `AMD Ryzen 7 5800H with Radeon Graphics, 16 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti, 621.14.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM` Scene: field-unmasked, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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-unmasked: 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 (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. ### Flags and settings None: the plan varied no setting, switch or build option. ``` </details> #### Measurements · linux **Verdict:** pass on linux (2/1 report): no rule failed and no PR run crashed. Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.2.6` `11th Gen Intel(R) Core(TM) i9-11900KB @ 3.30GHz, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM` Scene: field-unmasked, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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-unmasked: 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 (`@Beanstalk` on this PR runs it again) | | Before: main @ 3653c9c | After: this PR @ 0573496 | |---|---|---| | field-unmasked · field · frame rate | 89.2 | 88.9 (−0%) | | field-unmasked · field · frame time (p99) (ms) | 14.8 | 14.5 (−2%) | ### Flags and settings None: the plan varied no setting, switch or build option. <details><summary>Markdown for the PR description</summary> ```markdown ## Measurements **Verdict:** pass on linux (2/1 report): no rule failed and no PR run crashed. Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.2.6` `11th Gen Intel(R) Core(TM) i9-11900KB @ 3.30GHz, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM` Scene: field-unmasked, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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-unmasked: 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 (`@Beanstalk` on this PR runs it again) | | Before: main @ 3653c9c | After: this PR @ 0573496 | |---|---|---| | field-unmasked · field · frame rate | 89.2 | 88.9 (−0%) | | field-unmasked · field · frame time (p99) (ms) | 14.8 | 14.5 (−2%) | ### Flags and settings None: the plan varied no setting, switch or build option. ``` </details> </details>
Author
Member

@Beanstalk plan Again, with two changes for problems the farm has on many PRs, not only this one.

  • Before the teleport, wait 10 s (wait_s) after the save loads, and give the wait for HyruleField_Child 120 s. In several timed-out runs here and on other PRs (#1488, #1755, #1574) the teleport never took: the last picture still shows Kokiri Forest, and #1702's runs were refused with "an event is playing".
  • Windows target: vram_gb = ">= 6". The RTX 3050 Ti Laptop tester fails before building on every PR (git -C Z:\longshot diff --name-only HEAD exits 128 in dev_packs.py; also on #1815, #1763, #1745, #1702), so this keeps the Windows cell on a tester that can build.

Otherwise as before: Windows and Linux, against main, Hyrule Field from kokiri-start, uncapped and windowed (frame_rate_cap = 6, vsync = 2, frame_generation = 0, fullscreen = 0), 10 s warm-up, 30 s measured, 2 runs a side. Linux RADV already passed (89.2 vs 88.9 fps); the Windows number is the one missing.

@Beanstalk plan Again, with two changes for problems the farm has on many PRs, not only this one. - **Before the teleport, wait 10 s** (`wait_s`) after the save loads, and give the wait for `HyruleField_Child` 120 s. In several timed-out runs here and on other PRs (#1488, #1755, #1574) the teleport never took: the last picture still shows Kokiri Forest, and #1702's runs were refused with "an event is playing". - **Windows target: `vram_gb = ">= 6"`.** The RTX 3050 Ti Laptop tester fails before building on every PR (`git -C Z:\longshot diff --name-only HEAD` exits 128 in `dev_packs.py`; also on #1815, #1763, #1745, #1702), so this keeps the Windows cell on a tester that can build. Otherwise as before: Windows and Linux, against main, Hyrule Field from `kokiri-start`, uncapped and windowed (`frame_rate_cap = 6`, `vsync = 2`, `frame_generation = 0`, `fullscreen = 0`), 10 s warm-up, 30 s measured, 2 runs a side. Linux RADV already passed (89.2 vs 88.9 fps); the Windows number is the one missing.
Member
Beanstalk test farm · an earlier run: commit 0573496, run 2 (the newer results are in a comment below)

Commit 0573496 · tier reviewed · approved by klimovich008 · dashboard

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

Compare unmasked gameplay on Windows with at least 6 GB VRAM and on Linux against main, using the Kokiri save and Hyrule Field. Each side runs twice, with uncapped, windowed rendering, a 10-second warm-up and a 30-second measurement; gameplay takes about 23 minutes per tester. The plan compares average FPS and frame-time p99, and reports hitch and reserved-core log data. A crash or a regression greater than 10% in FPS or 15% in frame-time p99 fails the PR; masked affinity behavior is not exercised.

  • Where: windows+vram-ge6gb (6 GB VRAM or more, 1-2 reports), linux (1-2 reports).
  • hyrule-field: from the repository's save kokiri-start (settings vsync=2, fullscreen=0, 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.
  • Measured: crashes, frame times, stutters and hitches, draws and frame rate, the game's log.
  • The PR fails if: it crashes; or frame rate is more than 10% below main; or frame time (p99) is more than 15% above main.
  • Time: about 24 min of game runs per tester (4 game starts), plus the two builds.

Done (started 04:45 UTC, last report 06:38 UTC). Run 2: re-planned by klimovich008. Comment @Beanstalk to run it again.

Target Reports Crash Frame p99 (ms) vs main VRAM peak (MB) vs main Result
windows+vram-ge6gb · 1: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3080 Ti, 621.24.0; 2: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0 2/1 1 2 1 PR run 13.0 vs 13.3 (−2%) — fail ⚠ outlier
linux · 1: linux+amd+radv+dgpu AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7; 2: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce GTX 1070, 580.196.7 2/1 1 2 none 20.1 vs 19.7 (+2%) — pass ⚠ outlier

Measurements · windows+vram-ge6gb

Verdict: fail on windows+vram-ge6gb (2/1 report): hyrule-field crash failed.

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3080 Ti, 621.24.0 AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0 AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM
Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (@Beanstalk on this PR runs it again)

Before: main @ 3653c9c After: this PR @ 0573496
hyrule-field · field · frame rate 99.6 101.5 (+2%)
hyrule-field · field · frame time (p99) (ms) 13.3 13.0 (−2%)

Flags and settings

None: the plan varied no setting, switch or build option.

Markdown for the PR description
## Measurements

**Verdict:** fail on windows+vram-ge6gb (2/1 report): `hyrule-field crash` failed.

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 621.24.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM`  
Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (`@Beanstalk` on this PR runs it again)

| | Before: main @ 3653c9c | After: this PR @ 0573496 |
|---|---|---|
| hyrule-field · field · frame rate | 99.6 | 101.5 (+2%) |
| hyrule-field · field · frame time (p99) (ms) | 13.3 | 13.0 (−2%) |

### Flags and settings

None: the plan varied no setting, switch or build option.

Measurements · linux

Verdict: pass on linux (2/1 report): no rule failed and no PR run crashed.

Hardware: 1: linux+amd+radv+dgpu AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7 AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce GTX 1070, 580.196.7 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM
Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (@Beanstalk on this PR runs it again)

Before: main @ 3653c9c After: this PR @ 0573496
hyrule-field · field · frame rate 65.9 65.2 (−1%)
hyrule-field · field · frame time (p99) (ms) 19.7 20.1 (+2%)

Flags and settings

None: the plan varied no setting, switch or build option.

Markdown for the PR description
## Measurements

**Verdict:** pass on linux (2/1 report): no rule failed and no PR run crashed.

Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1070, 580.196.7` `Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM`  
Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (`@Beanstalk` on this PR runs it again)

| | Before: main @ 3653c9c | After: this PR @ 0573496 |
|---|---|---|
| hyrule-field · field · frame rate | 65.9 | 65.2 (−1%) |
| hyrule-field · field · frame time (p99) (ms) | 19.7 | 20.1 (+2%) |

### Flags and settings

None: the plan varied no setting, switch or build option.
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>0573496</code>, run 2 (the newer results are in a comment below)</summary> Commit `0573496` · tier **reviewed** · approved by klimovich008 · [dashboard](https://beanstalk.magicbean.dev/prs/1776) **What will be tested** · AI plan (`gpt-6.1-terra`) Compare unmasked gameplay on Windows with at least 6 GB VRAM and on Linux against main, using the Kokiri save and Hyrule Field. Each side runs twice, with uncapped, windowed rendering, a 10-second warm-up and a 30-second measurement; gameplay takes about 23 minutes per tester. The plan compares average FPS and frame-time p99, and reports hitch and reserved-core log data. A crash or a regression greater than 10% in FPS or 15% in frame-time p99 fails the PR; masked affinity behavior is not exercised. - **Where:** windows+vram-ge6gb (6 GB VRAM or more, 1-2 reports), linux (1-2 reports). - **hyrule-field:** from the repository's save `kokiri-start` (settings vsync=2, fullscreen=0, 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. - **Measured:** crashes, frame times, stutters and hitches, draws and frame rate, the game's log. - **The PR fails if:** it crashes; or frame rate is more than 10% below main; or frame time (p99) is more than 15% above main. - **Time:** about 24 min of game runs per tester (4 game starts), plus the two builds. Done (started 04:45 UTC, last report 06:38 UTC). Run 2: re-planned by klimovich008. Comment `@Beanstalk` to run it again. | Target | Reports | Crash | Frame p99 (ms) vs main | VRAM peak (MB) vs main | Result | | --- | --- | --- | --- | --- | --- | | windows+vram-ge6gb · 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 621.24.0`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0` | 2/1 [1](https://beanstalk.magicbean.dev/reports/rp_fd86096052384aa1) [2](https://beanstalk.magicbean.dev/reports/rp_f04e079bcd5c1698) | 1 PR run | 13.0 vs 13.3 (−2%) | — | fail ⚠ outlier | | linux · 1: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1070, 580.196.7` | 2/1 [1](https://beanstalk.magicbean.dev/reports/rp_66b169a4c56e95a2) [2](https://beanstalk.magicbean.dev/reports/rp_eb28d3929d3ed1e9) | none | 20.1 vs 19.7 (+2%) | — | pass ⚠ outlier | #### Measurements · windows+vram-ge6gb **Verdict:** fail on windows+vram-ge6gb (2/1 report): `hyrule-field crash` failed. Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 621.24.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (`@Beanstalk` on this PR runs it again) | | Before: main @ 3653c9c | After: this PR @ 0573496 | |---|---|---| | hyrule-field · field · frame rate | 99.6 | 101.5 (+2%) | | hyrule-field · field · frame time (p99) (ms) | 13.3 | 13.0 (−2%) | ### Flags and settings None: the plan varied no setting, switch or build option. <details><summary>Markdown for the PR description</summary> ```markdown ## Measurements **Verdict:** fail on windows+vram-ge6gb (2/1 report): `hyrule-field crash` failed. Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 621.24.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (`@Beanstalk` on this PR runs it again) | | Before: main @ 3653c9c | After: this PR @ 0573496 | |---|---|---| | hyrule-field · field · frame rate | 99.6 | 101.5 (+2%) | | hyrule-field · field · frame time (p99) (ms) | 13.3 | 13.0 (−2%) | ### Flags and settings None: the plan varied no setting, switch or build option. ``` </details> #### Measurements · linux **Verdict:** pass on linux (2/1 report): no rule failed and no PR run crashed. Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1070, 580.196.7` `Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM` Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (`@Beanstalk` on this PR runs it again) | | Before: main @ 3653c9c | After: this PR @ 0573496 | |---|---|---| | hyrule-field · field · frame rate | 65.9 | 65.2 (−1%) | | hyrule-field · field · frame time (p99) (ms) | 19.7 | 20.1 (+2%) | ### Flags and settings None: the plan varied no setting, switch or build option. <details><summary>Markdown for the PR description</summary> ```markdown ## Measurements **Verdict:** pass on linux (2/1 report): no rule failed and no PR run crashed. Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1070, 580.196.7` `Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM` Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (`@Beanstalk` on this PR runs it again) | | Before: main @ 3653c9c | After: this PR @ 0573496 | |---|---|---| | hyrule-field · field · frame rate | 65.9 | 65.2 (−1%) | | hyrule-field · field · frame time (p99) (ms) | 19.7 | 20.1 (+2%) | ### Flags and settings None: the plan varied no setting, switch or build option. ``` </details> </details>
Merge main into fix/reserved-core-process-mask
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 16s
Third-party parts / As their notes say (pull_request) Successful in 17s
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by klimovich008 (reviewed)
beanstalk/windows+vram-ge6gb 1/1 fail
beanstalk/linux 1/1 pass
CI / Website build and checks (pull_request) Failing after 2m23s
7949fcc74d
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member

Beanstalk test farm · ❌ failed on windows+vram-ge6gb

Commit 7949fcc · approved by klimovich008 (reviewed) · dashboard

Summary, written by AI (gpt-6.1-terra) from the numbers below:

The change passed on Windows and Linux, although one Linux PC could not be judged. Frame-time p99 improved from 13.62 to 13.45 ms on Windows and rose from 20.92 to 21.10 ms on the passing Linux PC; on Linux, the worst field frame time also rose from 29.79 to 69.79 ms. The other Linux PC timed out after 900 seconds without loading the save on either side, suggesting a PC or setup issue rather than a change-specific failure. The masked-start fix was not directly exercised because the farm did not apply a CPU affinity mask.

Done (started 15:51 UTC, last report 17:24 UTC). Comment @Beanstalk to run it again.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
windows+vram-ge6gb (6 GB VRAM or more) ❌ fail (an outlier) 2 1 2 13.7 → 12.7 (−8%) — 1 PR run
linux ✅ pass 2 1 2 20.9 → 21.1 (+1%) — none

Why it failed

  • windows+vram-ge6gb: hyrule-field crash: 1 PR run crashed

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.

  • linux, report 1: Insufficient frame-time evidence for 1 required comparison(s). See rule results. a step ran out of time: timeout: the save did not load into play within 900 s
What was tested

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

On Windows PCs with at least 6 GB VRAM and on Linux PCs, this plan compares uncapped, windowed Hyrule Field gameplay against main over two runs per side, taking about 23 minutes per tester. It measures FPS and frame-time p99 and reports whole-run hitches and reserved-core log matches. A crash, FPS drop over 10%, or p99 increase over 15% fails the PR. The farm does not apply a CPU affinity mask, so the masked-start fix is not directly exercised.

  • Where: windows+vram-ge6gb (6 GB VRAM or more, 1-2 reports), linux (1-2 reports).
  • hyrule-field: from the repository's save kokiri-start (settings vsync=2, fullscreen=0, 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.
  • Measured: crashes, frame times, stutters and hitches, draws and frame rate, the game's log.
  • The PR fails if: it crashes; or frame rate is more than 10% below main; or frame time (p99) is more than 15% above main.
  • Time: about 24 min of game runs per tester (4 game starts), plus the two builds.
Measurements on `windows+vram-ge6gb`, for the PR description

Verdict: fail on windows+vram-ge6gb (2 reports): hyrule-field crash failed.

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3090, 621.1.0 AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0 AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM
Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (@Beanstalk on this PR runs it again)

Before: main @ 89c3d21 After: this PR @ 7949fcc
hyrule-field · field · frame rate 94.7 96.7 (+2%)
hyrule-field · field · frame time (p99) (ms) 13.7 12.7 (−8%)

Flags and settings

None: the plan varied no setting, switch or build option.

As Markdown for the PR description:

## Measurements

**Verdict:** fail on windows+vram-ge6gb (2 reports): `hyrule-field crash` failed.

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3090, 621.1.0` `AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM`  
Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (`@Beanstalk` on this PR runs it again)

| | Before: main @ 89c3d21 | After: this PR @ 7949fcc |
|---|---|---|
| hyrule-field · field · frame rate | 94.7 | 96.7 (+2%) |
| hyrule-field · field · frame time (p99) (ms) | 13.7 | 12.7 (−8%) |

**Flags and settings**

None: the plan varied no setting, switch or build option.
Measurements on `linux`, for the PR description

Verdict: pass on linux (2 reports): no rule failed and no PR run crashed.

Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 5070, 620.70.6 AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM; 2: linux+amd+radv+dgpu AMD Steam Machine (RADV NAVI33), 26.1.99 AMD Custom CPU 1772, 16 GB RAM
Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (@Beanstalk on this PR runs it again)

Before: main @ 89c3d21 After: this PR @ 7949fcc
hyrule-field · field · frame rate 52.2 52.3 (+0%)
hyrule-field · field · frame time (p99) (ms) 20.9 21.1 (+1%)

Flags and settings

None: the plan varied no setting, switch or build option.

As Markdown for the PR description:

## Measurements

**Verdict:** pass on linux (2 reports): no rule failed and no PR run crashed.

Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.70.6` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Steam Machine (RADV NAVI33), 26.1.99` `AMD Custom CPU 1772, 16 GB RAM`  
Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (`@Beanstalk` on this PR runs it again)

| | Before: main @ 89c3d21 | After: this PR @ 7949fcc |
|---|---|---|
| hyrule-field · field · frame rate | 52.2 | 52.3 (+0%) |
| hyrule-field · field · frame time (p99) (ms) | 20.9 | 21.1 (+1%) |

**Flags and settings**

None: the plan varied no setting, switch or build option.
The testers' hardware
Target Report Ran on
windows+vram-ge6gb 1 windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3090, 621.1.0 AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAM
windows+vram-ge6gb 2 windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0 AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM
linux 1 linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 5070, 620.70.6 AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM
linux 2 linux+amd+radv+dgpu AMD Steam Machine (RADV NAVI33), 26.1.99 AMD Custom CPU 1772, 16 GB RAM
<!-- beanstalk:sticky --> ### Beanstalk test farm · ❌ failed on windows+vram-ge6gb Commit `7949fcc` · approved by klimovich008 (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/1776) > **Summary**, written by AI (`gpt-6.1-terra`) from the numbers below: > > The change passed on Windows and Linux, although one Linux PC could not be judged. Frame-time p99 improved from 13.62 to 13.45 ms on Windows and rose from 20.92 to 21.10 ms on the passing Linux PC; on Linux, the worst field frame time also rose from 29.79 to 69.79 ms. The other Linux PC timed out after 900 seconds without loading the save on either side, suggesting a PC or setup issue rather than a change-specific failure. The masked-start fix was not directly exercised because the farm did not apply a CPU affinity mask. Done (started 15:51 UTC, last report 17:24 UTC). Comment `@Beanstalk` to run it again. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `windows+vram-ge6gb` (6 GB VRAM or more) | ❌ fail (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_5072ab1c444a542a) [2](https://beanstalk.magicbean.dev/reports/rp_5200d4e47b311930) | 13.7 → 12.7 (−8%) | — | 1 PR run | | `linux` | ✅ pass | 2 [1](https://beanstalk.magicbean.dev/reports/rp_7e39eb7ee3069524) [2](https://beanstalk.magicbean.dev/reports/rp_1d68f9a80a29c882) | 20.9 → 21.1 (+1%) | — | none | **Why it failed** - `windows+vram-ge6gb`: `hyrule-field` `crash`: `1 PR run crashed` **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. - `linux`, [report 1](https://beanstalk.magicbean.dev/reports/rp_7e39eb7ee3069524): `Insufficient frame-time evidence for 1 required comparison(s). See rule results. a step ran out of time: timeout: the save did not load into play within 900 s` <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) On Windows PCs with at least 6 GB VRAM and on Linux PCs, this plan compares uncapped, windowed Hyrule Field gameplay against main over two runs per side, taking about 23 minutes per tester. It measures FPS and frame-time p99 and reports whole-run hitches and reserved-core log matches. A crash, FPS drop over 10%, or p99 increase over 15% fails the PR. The farm does not apply a CPU affinity mask, so the masked-start fix is not directly exercised. - **Where:** windows+vram-ge6gb (6 GB VRAM or more, 1-2 reports), linux (1-2 reports). - **hyrule-field:** from the repository's save `kokiri-start` (settings vsync=2, fullscreen=0, 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. - **Measured:** crashes, frame times, stutters and hitches, draws and frame rate, the game's log. - **The PR fails if:** it crashes; or frame rate is more than 10% below main; or frame time (p99) is more than 15% above main. - **Time:** about 24 min of game runs per tester (4 game starts), plus the two builds. </details> <details><summary>Measurements on `windows+vram-ge6gb`, for the PR description</summary> **Verdict:** fail on windows+vram-ge6gb (2 reports): `hyrule-field crash` failed. Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3090, 621.1.0` `AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (`@Beanstalk` on this PR runs it again) | | Before: main @ 89c3d21 | After: this PR @ 7949fcc | |---|---|---| | hyrule-field · field · frame rate | 94.7 | 96.7 (+2%) | | hyrule-field · field · frame time (p99) (ms) | 13.7 | 12.7 (−8%) | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** fail on windows+vram-ge6gb (2 reports): `hyrule-field crash` failed. Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3090, 621.1.0` `AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (`@Beanstalk` on this PR runs it again) | | Before: main @ 89c3d21 | After: this PR @ 7949fcc | |---|---|---| | hyrule-field · field · frame rate | 94.7 | 96.7 (+2%) | | hyrule-field · field · frame time (p99) (ms) | 13.7 | 12.7 (−8%) | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>Measurements on `linux`, for the PR description</summary> **Verdict:** pass on linux (2 reports): no rule failed and no PR run crashed. Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.70.6` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Steam Machine (RADV NAVI33), 26.1.99` `AMD Custom CPU 1772, 16 GB RAM` Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (`@Beanstalk` on this PR runs it again) | | Before: main @ 89c3d21 | After: this PR @ 7949fcc | |---|---|---| | hyrule-field · field · frame rate | 52.2 | 52.3 (+0%) | | hyrule-field · field · frame time (p99) (ms) | 20.9 | 21.1 (+1%) | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** pass on linux (2 reports): no rule failed and no PR run crashed. Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.70.6` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Steam Machine (RADV NAVI33), 26.1.99` `AMD Custom CPU 1772, 16 GB RAM` Scene: hyrule-field, from the repository's save kokiri-start (vsync=2, fullscreen=0, frame_rate_cap=6, frame_generation=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); 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 (`@Beanstalk` on this PR runs it again) | | Before: main @ 89c3d21 | After: this PR @ 7949fcc | |---|---|---| | hyrule-field · field · frame rate | 52.2 | 52.3 (+0%) | | hyrule-field · field · frame time (p99) (ms) | 20.9 | 21.1 (+1%) | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>The testers' hardware</summary> | Target | Report | Ran on | | --- | --- | --- | | `windows+vram-ge6gb` | [1](https://beanstalk.magicbean.dev/reports/rp_5072ab1c444a542a) | windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3090, 621.1.0` `AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAM` | | `windows+vram-ge6gb` | [2](https://beanstalk.magicbean.dev/reports/rp_5200d4e47b311930) | windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` | | `linux` | [1](https://beanstalk.magicbean.dev/reports/rp_7e39eb7ee3069524) | linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.70.6` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM` | | `linux` | [2](https://beanstalk.magicbean.dev/reports/rp_1d68f9a80a29c882) | linux+amd+radv+dgpu `AMD Steam Machine (RADV NAVI33), 26.1.99` `AMD Custom CPU 1772, 16 GB RAM` | </details>
Author
Member

🤖 Main (89c3d21e) merged in, no conflict; no code change beyond the merge. The description is in the new template.

Test Farm round 2 on 0573496 (no mask, uncapped, windowed, Hyrule Field, 2 runs a side):

  • Linux: pass (RX 7900 XTX RADV, GTX 1070): 65.2 vs main 65.9 fps, p99 20.1 vs 19.7 ms.
  • Windows NVIDIA: flat where it ran clean. RTX 3080 Ti: all four runs clean, this PR 99.21 / 101.01 fps against main 100.22 / 101.89. RTX 4070 Ti SUPER: one PR run crashed with 0xC0000005 inside NVIDIA's shader compiler (nvgpucomp64.dll+0x607360, right after "a C++ allocation refused (at the commit limit?)"), and one main run crashed too (0xC0000409). So the "crash" is that tester's driver or memory, not this PR (reports rp_fd86096052384aa1, rp_f04e079bcd5c1698).

Still WIP: the masked start on an 8+ core CPU needs a person (the farm can't set an affinity mask).

🤖 Main (89c3d21e) merged in, no conflict; no code change beyond the merge. The description is in the new template. Test Farm round 2 on 0573496 (no mask, uncapped, windowed, Hyrule Field, 2 runs a side): - **Linux: pass** (RX 7900 XTX RADV, GTX 1070): 65.2 vs main 65.9 fps, p99 20.1 vs 19.7 ms. - **Windows NVIDIA: flat where it ran clean.** RTX 3080 Ti: all four runs clean, this PR 99.21 / 101.01 fps against main 100.22 / 101.89. RTX 4070 Ti SUPER: one PR run crashed with 0xC0000005 inside NVIDIA's shader compiler (`nvgpucomp64.dll+0x607360`, right after "a C++ allocation refused (at the commit limit?)"), and one main run crashed too (0xC0000409). So the "crash" is that tester's driver or memory, not this PR (reports rp_fd86096052384aa1, rp_f04e079bcd5c1698). Still WIP: the masked start on an 8+ core CPU needs a person (the farm can't set an affinity mask).
klimovich008 changed title from WIP: fix(host): the render thread's reserved core is one the game may run on, under a launcher's or Process Lasso's affinity mask too to fix(host): the render thread's reserved core is one the game may run on, under a launcher's or Process Lasso's affinity mask too 2026-11-20 13:04:06 +00:00
Author
Member

@Beanstalk plan 🤖 The new head 7949fcc only merges main (89c3d21e) into 0573496: no change of its own. The same plan as round 2 (comment 57081):

  • Targets: Windows (vram_gb = ">= 6") and Linux, any GPU, against main.
  • Hyrule Field from kokiri-start, uncapped and windowed (frame_rate_cap = 6, vsync = 2, frame_generation = 0, fullscreen = 0). Wait 10 s (wait_s = 10) after the save loads before the teleport, and give the wait for HyruleField_Child 120 s. Then a 10 s warm-up and 30 s measured, 2 runs a side.
  • Compare fps_mean and frametime_p99_ms with main; run_hitch_count and run_frametime_max_ms report-only. A report-only log_match probe on the reserved-core line: expected vk: reserved core, forbidden NOT kept. No masked cell (the farm can't set an affinity mask).
@Beanstalk plan 🤖 The new head 7949fcc only merges main (89c3d21e) into 0573496: no change of its own. The same plan as round 2 (comment 57081): - Targets: Windows (`vram_gb = ">= 6"`) and Linux, any GPU, against main. - Hyrule Field from `kokiri-start`, uncapped and windowed (`frame_rate_cap = 6`, `vsync = 2`, `frame_generation = 0`, `fullscreen = 0`). Wait 10 s (`wait_s = 10`) after the save loads before the teleport, and give the wait for `HyruleField_Child` 120 s. Then a 10 s warm-up and 30 s measured, 2 runs a side. - Compare `fps_mean` and `frametime_p99_ms` with main; `run_hitch_count` and `run_frametime_max_ms` report-only. A report-only `log_match` probe on the reserved-core line: expected `vk: reserved core`, forbidden `NOT kept`. No masked cell (the farm can't set an affinity mask).
Member

@klimovich008 7949fcc isn't approved yet: a member of BigBeans starts it with @Beanstalk first.

@klimovich008 `7949fcc` isn't approved yet: a member of `BigBeans` starts it with `@Beanstalk` first.
Author
Member

@Beanstalk Please test 7949fcc (it only merges main 89c3d21e into 0573496) with the same plan as comment 57081: Windows (vram_gb = ">= 6") and Linux, any GPU, against main; Hyrule Field from kokiri-start, uncapped and windowed (frame_rate_cap = 6, vsync = 2, frame_generation = 0, fullscreen = 0); wait_s = 10 after the save loads, then the teleport, then the map wait with timeout_s = 120; 10 s warm-up, 30 s measured, 2 runs a side.

@Beanstalk Please test 7949fcc (it only merges main 89c3d21e into 0573496) with the same plan as comment 57081: Windows (`vram_gb = ">= 6"`) and Linux, any GPU, against main; Hyrule Field from `kokiri-start`, uncapped and windowed (`frame_rate_cap = 6`, `vsync = 2`, `frame_generation = 0`, `fullscreen = 0`); `wait_s = 10` after the save loads, then the teleport, then the map wait with `timeout_s = 120`; 10 s warm-up, 30 s measured, 2 runs a side.
Author
Member

🤖 About the farm's ❌ on 7949fcc: the crash isn't this PR's.

  • What failed: one Windows tester (RTX 4070 Ti SUPER, driver 621.14) crashed on both sides in its last two runs:
    • PR run 2: 0xc0000005 inside NVIDIA's shader compiler, nvgpucomp64.dll+0x607a30;
    • main run 3: exit 0xc0000409.
    • Its two clean runs read 99.1 (main) and 102.8 (PR) fps.
  • The other Windows tester (RTX 3090, 621.1) ran all 4 starts clean: 90.41 → 90.58 fps, p99 13.62 → 13.45 ms.
  • Linux: passed on one PC. The other never loaded the save on either side (900 s timeout).

As the farm's plan says, it doesn't set a CPU affinity mask, so these runs show that the change costs nothing without a mask. They don't exercise the masked start the PR fixes; that was measured on my PC (see Measurements in the description).

🤖 About the farm's ❌ on `7949fcc`: the crash isn't this PR's. - **What failed:** one Windows tester (RTX 4070 Ti SUPER, driver 621.14) crashed on **both** sides in its last two runs: - PR run 2: `0xc0000005` inside NVIDIA's shader compiler, `nvgpucomp64.dll+0x607a30`; - main run 3: exit `0xc0000409`. - Its two clean runs read 99.1 (main) and 102.8 (PR) fps. - **The other Windows tester** (RTX 3090, 621.1) ran all 4 starts clean: 90.41 → 90.58 fps, p99 13.62 → 13.45 ms. - **Linux:** passed on one PC. The other never loaded the save on either side (900 s timeout). As the farm's plan says, it doesn't set a CPU affinity mask, so these runs show that the change costs nothing without a mask. They don't exercise the masked start the PR fixes; that was measured on my PC (see Measurements in the description).
HumanBean left a comment

Recommendation: Approve. With no affinity mask the choice is provably the same as main's on every path. Under a mask, the reserved core now lands where the render thread can actually be pinned, and the log says what really happened. The one cost, keeping a core of the mask for the render thread, is measured (about 1 %, within noise, on 6 of 8 cores), stated in Risks, and HOS_RESERVE_CORE=0 turns it off. Recommend approval; not approved on the forge.

For a player who starts the game under a CPU affinity mask (a launcher, Process Lasso, start /affinity, taskset), the render thread's reserved core is now one the game may run on. Before, on Windows the pin was silently refused and nothing was kept. On Linux hybrid the render thread left the taskset set. Under a mask with only one SMT thread per core (0x5555), main also left one logical processor of the mask empty, and that is fixed too. The code is better: the enhanced, legacy and Linux hybrid paths now follow #522's fallback rule through one process_cpus(), and a refused pin is logged instead of hidden.

Does it help: not a perf change, it is a fix. The author's PC (Windows 11, 5700X3D, RX 9070 XT, Hyrule Field, 3 alternating pairs each):

  • With no mask: 72.99 vs 73.79 fps, flat, and the same reserved core (0xc000).
  • Under 0x0FFF: the reserved core is 0xc00 and the render thread's real affinity matches the log. On main the log said 0xcfff while the real affinity was 0xfff.
  • Keeping a core under 0x0FFF against keeping none: 69.94 vs 70.89 fps, CPU ms +1.5 to 5 % per pair. One pair had a 321 ms stall; without it the two are within about 1 %.

The Test Farm's no-mask runs agree:

  • Linux: 52.2 → 52.3 fps on 7949fcc; 65.9 → 65.2 and 89.2 → 88.9 on 0573496.
  • Windows RTX 3090: 4 clean starts, 90.41 → 90.58 fps.
  • Windows 3080 Ti: flat (round 2).

The farm's ❌ is the tester, not the change. The RTX 4070 Ti SUPER / 7800X3D tester (driver 621.14) crashed inside NVIDIA's shader compiler (nvgpucomp64.dll), on main's runs as well as the PR's, in round 2 and round 3. Nothing in this diff runs near shader compilation, and with no mask the code chooses exactly what main chose.

Other systems:

  • Windows with no mask, including hybrid Intel P/E cores: allowed holds every logical processor of the group, so masks[i] & ~allowed is 0 and the choice is identical. The missing hybrid-Intel farm run can't show a difference.
  • Steam Deck (4 cores / 8 threads, AMD, no cpu_core file): takes the fallback, which already had this rule. process_cpus() there is the same code moved, so nothing changes.
  • SMT siblings: a core counts only when all its siblings are in the mask (see the suggestion below).
  • More than 64 logical processors (processor groups): a process with threads in several groups gets 0 from GetProcessAffinityMask, which becomes ~0, as main's fallback did. A single-group process gets its group's full mask. Unchanged without a mask, but only covered by the fixture.
  • 7950X3D / 9950X3D: the cache-core rule still returns before this code. With HOS_RESERVE_CORE=1, the mask is the process's, not the cache cores'.
  • Linux hybrid with offline CPUs: a small change for the better. The shim's GetLogicalProcessorInformation counts _SC_NPROCESSORS_CONF CPUs and turns an offline CPU, which has no topology directory, into a one-CPU "core". That pseudo-core is outside process_affinity, so it is no longer counted or picked.
  • Frame pacing under a mask: the game's threads now give up one core of the mask, as an unmasked CPU of that size does today. That is measured only for 6 of 8 cores. A 4-core mask (0x00FF) now keeps 1 of 4, the same as a real 4c/8t CPU (the Deck) already does. Whether that pays off is a question for the 8-logical-processor threshold, not for this PR.
  • RX_VK_ASYNC=0: ReplayPin now logs a refused pin once, and its destructor still restores only when the pin held.

Switches: none added or changed. HOS_RESERVE_CORE (default: one core kept with 8+ logical processors) and HOS_RESERVE_CORE_MASK keep their meaning. Their defaults stay right, and the switches.def row is still accurate.

Reviewed: 7949fcc74d against main 89c3d21e, the first main parent of the PR's last merge, so the diff is the PR's own.

  • Read in full where changed, with the code around each change: host/hos_thread.c (pick_reserved_core, process_cpus, both last_fastest_core, the legacy path, hos_reserved_cpus, hos_thread_pin), gpu/vk/vk_replay.cpp (replay_pin_mask, ReplayPin, the placement in replay_thread_main, fastest_kind_cpus), host/posix/win32_posix.c (the shim's GetProcessAffinityMask, SetThreadAffinityMask, GetLogicalProcessorInformation), tests/test_reserved_core.py and tests/test_reserved_core_mask.py.
  • Nothing run: this is a code review.

Fixed in this review: nothing. I tried to push a one-line doc fix, but the push wasn't allowed from here; it is the first suggestion below.

Checked and fine:

  • With no mask, every path chooses what main chose.
  • last_fastest_core_legacy returns *cores = listed, so a mask that excludes every core still ends in that path, with the same result as the fallback.
  • fast < 4 and logical < 8 now count only allowed cores, so a mask of 3 P-cores plus E-cores keeps none, as an i5-1235U does.
  • GetLastError() is read in the logf arguments before anything else can reset it.
  • replay_pin_prev == 0 after a refusal means the destructor restores nothing.
  • hos_thread_pin's may & ~reserved now really leaves the reserved core free, because that core is inside may.
  • The new test cuts the real source on both the Windows and the Linux branches. It models Windows' refusal of an outside mask, and has six broken variants that must fail, including the replay pin left unchecked and an unreadable mask taken as no processors.
  • The test only compiles and runs a fixture in a temporary directory; it touches nothing outside it.

Suggestions (the author may take or leave)

  • docs/dev/reference/threads.md:89 still says the render thread's core is "the last core of the fastest kind". Add the new rule, for example: "...; only a core whose logical processors are all in the process's affinity mask, as a launcher, Process Lasso or taskset sets it; HOS_RESERVE_CORE=0: none)."
  • host/hos_thread.c:815: under a mask with one SMT thread per core (0x5555), no core is kept. A machine with SMT off in the BIOS and the same 8 single-thread cores does keep one. Taking masks[i] & allowed as the core when it is non-zero would treat the two alike. Requiring a whole core is also defensible, since the sibling outside the mask is probably busy with something else. Either way, say which in the comment.
  • host/hos_thread.c:800: process_cpus() and process_threads() (line 680), plus #1669's Linux branch for it, all read the same mask. Once both PRs are in, process_threads() could count process_cpus(). That needs process_cpus() moved above it, and the group-count guard kept.

Testing:

  • The author ran the game on their own PC: Windows, AMD, no mask, 0x0FFF and 0x5555, on main and on this PR.
  • The Test Farm's no-mask runs passed on Linux and were clean on two Windows NVIDIA PCs. The fail is the one tester's NVIDIA crash on both sides.
  • CI: everything that ran passed except "Guide screenshots", which checks guide images this PR doesn't touch.
  • Still missing:
    • A second person's masked start on an 8+ core Windows PC. It is not needed to merge: the author's run and the fixture cover it.
    • A hybrid Intel no-mask run. Its code path is identical to main's, so it doesn't hold the merge.

Overlaps and merge order:

  • #1669 is not a duplicate. It changes process_threads(), the spin and timer choice, while this PR changes the reserved core's choice. The two hunks are about 100 lines apart, so they merge in either order.
  • #1860 (vc_acquire, Deck), #1642 and #1666 (the vcore code) touch other parts of hos_thread.c and don't overlap.
**Recommendation: Approve.** With no affinity mask the choice is provably the same as main's on every path. Under a mask, the reserved core now lands where the render thread can actually be pinned, and the log says what really happened. The one cost, keeping a core of the mask for the render thread, is measured (about 1 %, within noise, on 6 of 8 cores), stated in Risks, and `HOS_RESERVE_CORE=0` turns it off. Recommend approval; not approved on the forge. For a player who starts the game under a CPU affinity mask (a launcher, Process Lasso, `start /affinity`, `taskset`), the render thread's reserved core is now one the game may run on. Before, on Windows the pin was silently refused and nothing was kept. On Linux hybrid the render thread left the `taskset` set. Under a mask with only one SMT thread per core (0x5555), main also left one logical processor of the mask empty, and that is fixed too. The code is better: the enhanced, legacy and Linux hybrid paths now follow #522's fallback rule through one `process_cpus()`, and a refused pin is logged instead of hidden. **Does it help:** not a perf change, it is a fix. The author's PC (Windows 11, 5700X3D, RX 9070 XT, Hyrule Field, 3 alternating pairs each): - With no mask: 72.99 vs 73.79 fps, flat, and the same reserved core (0xc000). - Under 0x0FFF: the reserved core is 0xc00 and the render thread's real affinity matches the log. On main the log said 0xcfff while the real affinity was 0xfff. - Keeping a core under 0x0FFF against keeping none: 69.94 vs 70.89 fps, CPU ms +1.5 to 5 % per pair. One pair had a 321 ms stall; without it the two are within about 1 %. The Test Farm's no-mask runs agree: - Linux: 52.2 → 52.3 fps on 7949fcc; 65.9 → 65.2 and 89.2 → 88.9 on 0573496. - Windows RTX 3090: 4 clean starts, 90.41 → 90.58 fps. - Windows 3080 Ti: flat (round 2). **The farm's ❌ is the tester, not the change.** The RTX 4070 Ti SUPER / 7800X3D tester (driver 621.14) crashed inside NVIDIA's shader compiler (`nvgpucomp64.dll`), on main's runs as well as the PR's, in round 2 and round 3. Nothing in this diff runs near shader compilation, and with no mask the code chooses exactly what main chose. **Other systems:** - **Windows with no mask, including hybrid Intel P/E cores:** `allowed` holds every logical processor of the group, so `masks[i] & ~allowed` is 0 and the choice is identical. The missing hybrid-Intel farm run can't show a difference. - **Steam Deck (4 cores / 8 threads, AMD, no `cpu_core` file):** takes the fallback, which already had this rule. `process_cpus()` there is the same code moved, so nothing changes. - **SMT siblings:** a core counts only when all its siblings are in the mask (see the suggestion below). - **More than 64 logical processors (processor groups):** a process with threads in several groups gets 0 from `GetProcessAffinityMask`, which becomes `~0`, as main's fallback did. A single-group process gets its group's full mask. Unchanged without a mask, but only covered by the fixture. - **7950X3D / 9950X3D:** the cache-core rule still returns before this code. With `HOS_RESERVE_CORE=1`, the mask is the process's, not the cache cores'. - **Linux hybrid with offline CPUs:** a small change for the better. The shim's `GetLogicalProcessorInformation` counts `_SC_NPROCESSORS_CONF` CPUs and turns an offline CPU, which has no topology directory, into a one-CPU "core". That pseudo-core is outside `process_affinity`, so it is no longer counted or picked. - **Frame pacing under a mask:** the game's threads now give up one core of the mask, as an unmasked CPU of that size does today. That is measured only for 6 of 8 cores. A 4-core mask (0x00FF) now keeps 1 of 4, the same as a real 4c/8t CPU (the Deck) already does. Whether that pays off is a question for the 8-logical-processor threshold, not for this PR. - **`RX_VK_ASYNC=0`:** `ReplayPin` now logs a refused pin once, and its destructor still restores only when the pin held. **Switches:** none added or changed. `HOS_RESERVE_CORE` (default: one core kept with 8+ logical processors) and `HOS_RESERVE_CORE_MASK` keep their meaning. Their defaults stay right, and the `switches.def` row is still accurate. **Reviewed:** 7949fcc74d against main 89c3d21e, the first `main` parent of the PR's last merge, so the diff is the PR's own. - Read in full where changed, with the code around each change: `host/hos_thread.c` (`pick_reserved_core`, `process_cpus`, both `last_fastest_core`, the legacy path, `hos_reserved_cpus`, `hos_thread_pin`), `gpu/vk/vk_replay.cpp` (`replay_pin_mask`, `ReplayPin`, the placement in `replay_thread_main`, `fastest_kind_cpus`), `host/posix/win32_posix.c` (the shim's `GetProcessAffinityMask`, `SetThreadAffinityMask`, `GetLogicalProcessorInformation`), `tests/test_reserved_core.py` and `tests/test_reserved_core_mask.py`. - Nothing run: this is a code review. **Fixed in this review:** nothing. I tried to push a one-line doc fix, but the push wasn't allowed from here; it is the first suggestion below. **Checked and fine:** - With no mask, every path chooses what main chose. - `last_fastest_core_legacy` returns `*cores = listed`, so a mask that excludes every core still ends in that path, with the same result as the fallback. - `fast < 4` and `logical < 8` now count only allowed cores, so a mask of 3 P-cores plus E-cores keeps none, as an i5-1235U does. - `GetLastError()` is read in the `logf` arguments before anything else can reset it. - `replay_pin_prev == 0` after a refusal means the destructor restores nothing. - `hos_thread_pin`'s `may & ~reserved` now really leaves the reserved core free, because that core is inside `may`. - The new test cuts the real source on both the Windows and the Linux branches. It models Windows' refusal of an outside mask, and has six broken variants that must fail, including the replay pin left unchecked and an unreadable mask taken as no processors. - The test only compiles and runs a fixture in a temporary directory; it touches nothing outside it. **Suggestions** (the author may take or leave) - `docs/dev/reference/threads.md:89` still says the render thread's core is "the last core of the fastest kind". Add the new rule, for example: "...; only a core whose logical processors are all in the process's affinity mask, as a launcher, Process Lasso or `taskset` sets it; `HOS_RESERVE_CORE=0`: none)." - `host/hos_thread.c:815`: under a mask with one SMT thread per core (0x5555), no core is kept. A machine with SMT off in the BIOS and the same 8 single-thread cores does keep one. Taking `masks[i] & allowed` as the core when it is non-zero would treat the two alike. Requiring a whole core is also defensible, since the sibling outside the mask is probably busy with something else. Either way, say which in the comment. - `host/hos_thread.c:800`: `process_cpus()` and `process_threads()` (line 680), plus https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1669's Linux branch for it, all read the same mask. Once both PRs are in, `process_threads()` could count `process_cpus()`. That needs `process_cpus()` moved above it, and the group-count guard kept. **Testing:** - The author ran the game on their own PC: Windows, AMD, no mask, 0x0FFF and 0x5555, on main and on this PR. - The Test Farm's no-mask runs passed on Linux and were clean on two Windows NVIDIA PCs. The fail is the one tester's NVIDIA crash on both sides. - CI: everything that ran passed except "Guide screenshots", which checks guide images this PR doesn't touch. - Still missing: - A second person's masked start on an 8+ core Windows PC. It is not needed to merge: the author's run and the fixture cover it. - A hybrid Intel no-mask run. Its code path is identical to main's, so it doesn't hold the merge. **Overlaps and merge order:** - https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1669 is not a duplicate. It changes `process_threads()`, the spin and timer choice, while this PR changes the reserved core's choice. The two hunks are about 100 lines apart, so they merge in either order. - https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1860 (`vc_acquire`, Deck), https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1642 and https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1666 (the vcore code) touch other parts of `hos_thread.c` and don't overlap.
@ -798,0 +797,4 @@
/* (longshot) The logical processors this process may run on (its affinity mask: `start /affinity`, a launcher's, Process
Lasso's, taskset's), for the reserved core's choice; every one when the mask cannot be read (Windows gives 0 for a process
with threads in more than one processor group) */
static uint64_t process_cpus(void) {
Owner

process_threads() (line 680) and #1669's Linux branch for it read the same mask. Once both are in, process_threads() could count process_cpus() (move this one above it and keep the group-count guard).

process_threads() (line 680) and #1669's Linux branch for it read the same mask. Once both are in, process_threads() could count process_cpus() (move this one above it and keep the group-count guard).
@ -799,3 +813,3 @@
int best = -1, fast = 0, logical = 0;
for (int i = 0; i < n; i++) {
if (!masks[i]) continue;
if (!masks[i] || (masks[i] & ~allowed)) continue;
Owner

Under 0x5555 (one SMT thread of each core) no core is kept, but a machine with SMT off in the BIOS and the same 8 single-thread cores keeps one. Taking masks[i] & allowed as the core when it is non-zero would treat them alike. Requiring a whole core is defensible too (the sibling outside the mask is probably busy); say which in the comment.

Under 0x5555 (one SMT thread of each core) no core is kept, but a machine with SMT off in the BIOS and the same 8 single-thread cores keeps one. Taking masks[i] & allowed as the core when it is non-zero would treat them alike. Requiring a whole core is defensible too (the sibling outside the mask is probably busy); say which in the comment.
HumanBean deleted branch fix/reserved-core-process-mask 2026-11-20 22:55:34 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1776
No description provided.