fix(linux): a start with no window loads the renderer with the process's affinity, as a windowed start does #2784

Merged
HumanBean merged 11 commits from klimovich008/Longshot:perf/linux-core-count into main 2026-12-05 20:25:29 +00:00
Member

Summary

Why: on Linux a game started with no window (HOS_HEADLESS=1) loads the renderer on the game's own thread. That thread is pinned off the reserved core, so the renderer counts the process without that core. Headless runs (the control bridge's test profile, the pipeline tour, the Test Farm's headless starts, a Steam Deck test harness) then measure a renderer set up differently from the one a player's windowed game runs.

Who it affects: only headless starts on Linux. A windowed start (every player) and --prepare-shaders already count right, and Windows is not changed (host/display.c is untouched). On a Steam Deck the same build logged CPUs 8 (6 usable, 3 cores) and Threaded rendering: Auto: off (3 cores of 6 logical processors; ...) when started headless, and CPUs 8 (8 usable, 4 cores) when it prepared its shaders. This PR gives no gain to players. What it gives is measurement parity: a headless Linux run now sets the renderer up as a windowed one does.

The cause: longshot_vk.so has its own copy of host/posix/win32_posix.c (builder/crates/build-compile/src/plan.rs, linked -Bsymbolic). That copy's GetProcessAffinityMask is the mask its constructor read when the module was loaded, which is the affinity of the loading thread.

  • Windowed: the module is loaded on renderer_main, a CreateThread thread. Such a thread starts with the process's affinity (win32_posix.c thread_entry).
  • Headless: hos_display_start called rx_start(NULL) on the game's thread, which hos_thread_pin had moved off the reserved core. So usable_cpus() and usable_cores() counted one physical core fewer, and the module's own threads started on that narrower mask.

How to see it on main: start a Linux build headless (HOS_HEADLESS=1) on a PC with 8 or more logical processors. The log's CPUs N (M usable, K cores) line has 2 usable processors and 1 core fewer than a windowed start of the same build.

What changes:

  • host/posix/display_sdl.c (Linux only), hos_display_start's no-window branch, through the new headless_renderer_start and headless_renderer_main:
    • rx_start(NULL) now runs on a CreateThread thread, as renderer_main does with a window, and the game's thread waits for it (WaitForSingleObject, then CloseHandle).
    • The start stays synchronous, as before. If CreateThread fails, the start runs on the game's thread as before.
    • The thread names itself mkw_vk_start, then asks the all-thread sampler to list the threads again (hos_prof_relist), so the renderer's start is sampled from the sampler's next sweep on (review L1).
    • The hos_renderer_wait comment follows.
  • host/posix/prof.c (Linux only), for L1:
    • hos_prof_relist() moves a generation on. sample_all_thread (HOS_SAMPLE_ALL, and HOS_SLOW_FRAMES's ring) lists the threads again at its next sweep when the generation moved, besides every 5 s as before.
    • Its wait is now the loop's first step, then the .go file's check, the list's and the sweep: an ask made during the wait reaches the next sweep (2 ms; HOS_SLOW_FRAMES_EVERY_MS in the ring), and no sweep follows a .go file taken away in the wait.
  • tests/test_headless_renderer_cpus.py (new):
    • It builds the real win32_posix.c twice: into an executable, and into a -fPIC -shared -Wl,-Bsymbolic module, as longshot_vk.so has it.
    • It cuts hos_display_start and its helpers from the source, and pins the calling thread off the highest processor, as hos_thread_pin does.
    • A stand-in rx_start loads the module and asks both its GetProcessAffinityMask and the loading thread's own mask. Both must be the process's mask.
    • A broken copy (rx_start on the game's thread) must fail, with both masks equal to the pinned thread's. Any other pair is a plain failure, not the expected one.
    • It skips on Windows, and when the starting thread's mask has fewer than 2 processors or a processor id above 63 (win32_posix.c's masks are 64 bits).
  • tests/test_display_startup_failure.py and tests/display_startup_failure_test.cpp: they cut hos_display_start, so they cut and stub the new helpers too. The headless case now also checks that the start ran on its own thread, was named, and was waited for and closed, and that it asked the sampler to list it once, on that thread, after its name and before the start.
  • tests/test_slow_frames.py: the sampler's order in host/posix/prof.c (one wait, then the one .go check, the generation read and compared, the sweep), and hos_prof_relist, compiled from its cut, moving the generation by one a call.

What headless Linux runs do differently after this PR:

  • Both threads by Auto: Threaded rendering's Auto can now turn on the render thread and the recorder thread on a 4-core / 8-thread PC whose GPU has mirrored pools, as a windowed start already does. Farm headless runs on RADV should keep #2446 (an open GPU ring hang on RADV with both threads) in mind. A Steam Deck started headless counts 4 cores, and Auto stays off there: its pools have no mirrors.
  • Pool workers: every worker pool sized by usable_cpus() (the shader preparation, the noted pipelines, the texture threads) gets 2 more workers.
  • Thread placement: the module's own threads (pools, recorder, preparation workers) start on the process's whole mask, as in a windowed start.
  • A pre-existing widening, now visible headless: win32_posix.c thread_self() registers a thread its copy did not create on that thread's first GetCurrentThread(), and applies the copy's process mask to it. In vk_replay.cpp ReplayPin that happens before SetThreadAffinityMask reads the old mask. So with RX_VK_ASYNC off, the submitting guest thread comes back from its first inline replay on the process's whole mask, the reserved core included. A windowed Linux start does this today; a headless one hid it, because its module mask was the pinned one. It now shows in headless runs too. It is not caused here, and it is not fixed here: fixing it changes players' thread placement on Linux, which needs its own change and a measurement.

Unchanged: no vk_api.h change, and no file of the shader-cache stamp, so no player prepares again. Nothing under gpu/ changes. Windows does not build display_sdl.c, and a pack of this branch on a Windows base had no module that differs from the base's.

Read first: headless_renderer_start in host/posix/display_sdl.c, then thread_entry and process_affinity in host/posix/win32_posix.c.

Testing

Tested: in the game on a Steam Deck OLED (SteamOS 3.9.5, kernel 7.2.7, Mesa 26.2.0-devel RADV, 4 cores / 8 threads, AC power, stock 15 W), head d9876f0f (main 2ca7d4f74 merged) against main 2ca7d4f74, each built from source on the Deck. Headless starts (HOS_HEADLESS=1, the control bridge's test profile), Market as a child:

  • main: CPUs 8 (6 usable, 3 cores), Threaded rendering: Auto: off (3 cores of 6 logical processors; the render thread and the recorder thread from 4 cores).
  • this PR: CPUs 8 (8 usable, 4 cores), Threaded rendering: Auto: off (not safe on this run: the buffer pools have no mirrors). That is the reason a windowed start on the Deck logs. Every run of each side logged the same lines (9 starts).
  • Pools are the same on the Deck either way (workers 2, capture helpers 2, texture threads 4), and both sides replay on 0xc0 while they replay.
  • The Test Farm ran the earlier head 9315148 headless on two Linux PCs (Ryzen AI MAX+ 395 / 8060S RADV, Ryzen 7 5800X / RX 9070 RADV): usable processors 30 -> 32 and 14 -> 16, cores 15 -> 16 and 7 -> 8, no crash.

Game-free, on the Deck at d9876f0f:

  • tests/test_headless_renderer_cpus.py: PASS (process 0xff, game thread 0x7f, loader and module 0xff); its broken copy fails as it should (loader and module 0x7f).
  • tests/test_display_startup_failure.py: 12 of 12. On main's display_sdl.c (--source-root) the headless case fails ("the headless renderer started on the game's thread, not on a thread of its own"), as it must.
  • tests/run_all.py, the whole suite: 727 passed, 14 failed, 143 skipped. main 2ca7d4f74 on the same Deck: 726 passed and the same 14 failed. They are this Deck's toolchain, not the change: no ASan runtime (test_audio_source, test_obj_cache_size, test_obj_guest_id, test_obj_table_bounded); -fuse-ld=lld under -Werror (test_option_ids, test_options_path, test_settings_atomic, test_ui_renderer); no string.h for builder/rt (test_game_module, test_game_module_imports); test_check_cache, test_game_font, test_vk_wb_cpu_words_fast; and test_i18n_complete (missing translations, main's).
  • pre-commit (as mise run lint, gitleaks not installed here): passes.
  • The earlier rounds on Windows and WSL (main 694ae5820 / 3ab4db6e9) are unchanged: see the first comments.
  • A second-opinion review (gpt-6.2-sol) of d9876f0f, the whole diff and the merge's fixture resolution: none found.

L1's change, game-free on the Deck at 9c71d05a (main f8b54338 merged in, da3bb0a7):

  • tests/test_display_startup_failure.py: 12 of 12. Negative controls: the call dropped fails ("the all-thread sampler was not asked to list the start's thread"), and the call before the name fails.
  • tests/test_slow_frames.py: ok. Negative controls, each failing: the samplers of 207652d8 and 067fb88f, the generation's load above the wait with its compare below, a second .go check before the wait, an empty hos_prof_relist, one kept under #if 0 beside an empty one, and a step of 2.
  • tests/test_headless_renderer_cpus.py, test_profiling_mode, test_sampler_stack_walk, test_prof_walk_fault, test_prof_modules: pass. Both changed files syntax-checked with the build's own flags; ruff on the changed tests.
  • gpt-6.2-sol, four rounds: round 1 (an ask made in the sampler's wait was seen a sweep late) gave 067fb88f, round 2 (a sweep after the .go file went; the order check too loose) c60a5f82, round 3 (an empty hos_prof_relist passed the tests) bbe4e625, round 4 (the text checks passed an #if 0 copy and a second .go check) 9c71d05a, round 5: none found.

L3 and L1, in the game on the same Deck at 9c71d05a (built as v3.2.0-247-g9c71d05a) against main f8b54338, each built from source there; headless, Market as a child:

  • L3, RX_VK_MIRROR=1 (mirrored pools), Threaded rendering left to Auto, one long run each (--lead 600: about 10 minutes of turning before the measured window). main: CPUs 8 (6 usable, 3 cores), Threaded rendering: Auto: off (3 cores of 6 logical processors; the render thread and the recorder thread from 4 cores). This PR: CPUs 8 (8 usable, 4 cores), Threaded rendering: Auto: on, the render thread and the recorder thread (4 cores of 8 logical processors). No GPU ring timeout, reset or device loss in either game log (#2446), and no amdgpu timeout, reset, fault or hang in the kernel's log (journalctl -k) from the first start to the last run's end. No frame over 100 ms in either window (38.38 and 41.53 fps: one run each with a different thread choice, not a measurement of this PR). With the render thread on, this PR also logs RX_VK_READBACK_EARLY left off: the render thread is on ...; the renderer leaves it off whenever the render thread is on.
  • L1, one start of this PR with HOS_SAMPLE_ALL from the boot (no mirrors: Threaded rendering: Auto: the recorder thread only (4 cores of 8 logical processors; the render thread off: the buffer pools have no mirrors)): the sampler began with 2 threads listed, and 19,487 of its 734,776 sample lines are mkw_vk_start's, from its first sweep (0 ms) on, inside longshot_vk.so's load.

Still to test:

  • L4, a headless start with NVIDIA's Linux driver: queued on the Test Farm (linux+nvidia, no report yet).

Measurements

Verdict: no change in speed on the Steam Deck, as expected (same pools, Auto off either way): fps +1.9 %, CPU ms +0.0 %, the two admitted pairs disagreeing in sign (fps +8.5 % / -4.4 %, CPU ms -4.8 % / +5.2 %), so noise.

Setup: Steam Deck OLED, SteamOS 3.9.5, Mesa 26.2.0-devel RADV, stock 15 W, AC; Market as a child, uncapped (HOS_FPS_MAX=240), headless, 1280x720 at 75 %; 3 alternating pairs, 2 admitted (the third pair's PR run swapped 80 MB in and was refused); a 20 s window each, the median of the runs. Numbers from headless Linux runs before and after this PR are still not comparable on PCs where the count changes the pools or Auto (above).

Before: main @ 2ca7d4f74 After: this PR @ d9876f0f
fps 40.30 41.06
CPU ms a frame 84.05 84.09
1 % low (fps) 21.4 24.9
p99 frame (ms) 40.6 36.0
GPU ms 12.05 11.95

Measured again on current main (2026-12-04), the same Deck and settings, at steady state.

  • Arms: main 6318f405 against main 6318f405 with this PR's four files (applied locally, built as a player's build).
  • Window: 45 s, after 150 s of turning in Market (--lead 150). 3 pairs, all admitted.
Before: main @ 6318f405 After: main @ 6318f405 + this PR
fps 41.24 42.64 (+3.4 %; pairs −2.2, +5.7, +3.2 %)
CPU ms a frame 79.84 79.73 (−0.1 %)
1 % low (fps) 25.5 26.9
p99 frame (ms) 35.1 34.0
  • No cost on current main. Under 5 % with 3 pairs: diagnostic.
  • The renderer's line changes as intended. Main says "Threaded rendering: Auto: off (3 cores of 6 logical processors; ...)", one core too few. With this PR it says "Auto: off (not safe on this run: the buffer pools have no mirrors)".
  • The reserved core: without this PR, a headless start with no core reserved (HOS_RESERVE_CORE=0) measured +1.0 % and +4.1 %. With it, −0.1 %. So that gain was this bug, and players (windowed) never had it.

Risks

  • What could break: headless Linux starts only. The renderer's start moves from the game's thread to a thread of its own, and the game's thread waits for it as long as the start ran before. The windowed start already runs the same rx_start on such a thread for every player. A revert is enough; there is no switch, because it is a fix.
  • What a player notices after updating: nothing (windowed starts and Windows are unchanged; the caches are untouched).
  • What headless runs notice: the renderer's setup now matches a windowed start's. That means more pool workers and possibly both threads by Auto on 4+ core machines with mirrors (#2446), as listed above. Numbers from headless Linux runs before and after this PR are not comparable.

Not covered:

  • A windowed Linux start of this head (the windowed path is unchanged), and a 4-core / 8-thread Linux PC with a discrete GPU, where Auto may now run both threads headless (#2446).
  • Machines with more than 64 logical processors (the test skips), and kernel CPU masks wider than 1024 bits (the test's first affinity read fails).
  • HOS_PIN experiments that pin the loading thread by hand.
  • Under HOS_SAMPLE_ALL, the start's thread is listed from the sweep after it named itself, and sampled when it runs at its turn in a sweep, as any thread: a start of a few milliseconds can still give no sample.
  • The pre-existing ReplayPin widening above: a follow-up, not this PR.

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. (Linux: the game built from source on the Deck; Windows does not build display_sdl.c; no path is handled by the change.)
  • 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"). (Steam Deck here; RX 9070 RADV on Linux by the farm, on 9315148.)
  • 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 **Why:** on Linux a game started with no window (`HOS_HEADLESS=1`) loads the renderer on the game's own thread. That thread is pinned off the reserved core, so the renderer counts the process without that core. Headless runs (the control bridge's `test` profile, the pipeline tour, the Test Farm's headless starts, a Steam Deck test harness) then measure a renderer set up differently from the one a player's windowed game runs. **Who it affects:** only headless starts on Linux. A windowed start (every player) and `--prepare-shaders` already count right, and Windows is not changed (`host/display.c` is untouched). On a Steam Deck the same build logged `CPUs 8 (6 usable, 3 cores)` and `Threaded rendering: Auto: off (3 cores of 6 logical processors; ...)` when started headless, and `CPUs 8 (8 usable, 4 cores)` when it prepared its shaders. This PR gives no gain to players. What it gives is measurement parity: a headless Linux run now sets the renderer up as a windowed one does. **The cause:** `longshot_vk.so` has its own copy of `host/posix/win32_posix.c` (`builder/crates/build-compile/src/plan.rs`, linked `-Bsymbolic`). That copy's `GetProcessAffinityMask` is the mask its constructor read when the module was loaded, which is the affinity of the loading thread. - **Windowed:** the module is loaded on `renderer_main`, a `CreateThread` thread. Such a thread starts with the process's affinity (`win32_posix.c` `thread_entry`). - **Headless:** `hos_display_start` called `rx_start(NULL)` on the game's thread, which `hos_thread_pin` had moved off the reserved core. So `usable_cpus()` and `usable_cores()` counted one physical core fewer, and the module's own threads started on that narrower mask. **How to see it on main:** start a Linux build headless (`HOS_HEADLESS=1`) on a PC with 8 or more logical processors. The log's `CPUs N (M usable, K cores)` line has 2 usable processors and 1 core fewer than a windowed start of the same build. **What changes:** - `host/posix/display_sdl.c` (Linux only), `hos_display_start`'s no-window branch, through the new `headless_renderer_start` and `headless_renderer_main`: - `rx_start(NULL)` now runs on a `CreateThread` thread, as `renderer_main` does with a window, and the game's thread waits for it (`WaitForSingleObject`, then `CloseHandle`). - The start stays synchronous, as before. If `CreateThread` fails, the start runs on the game's thread as before. - The thread names itself `mkw_vk_start`, then asks the all-thread sampler to list the threads again (`hos_prof_relist`), so the renderer's start is sampled from the sampler's next sweep on (review L1). - The `hos_renderer_wait` comment follows. - `host/posix/prof.c` (Linux only), for L1: - `hos_prof_relist()` moves a generation on. `sample_all_thread` (`HOS_SAMPLE_ALL`, and `HOS_SLOW_FRAMES`'s ring) lists the threads again at its next sweep when the generation moved, besides every 5 s as before. - Its wait is now the loop's first step, then the `.go` file's check, the list's and the sweep: an ask made during the wait reaches the next sweep (2 ms; `HOS_SLOW_FRAMES_EVERY_MS` in the ring), and no sweep follows a `.go` file taken away in the wait. - `tests/test_headless_renderer_cpus.py` (new): - It builds the real `win32_posix.c` twice: into an executable, and into a `-fPIC -shared -Wl,-Bsymbolic` module, as `longshot_vk.so` has it. - It cuts `hos_display_start` and its helpers from the source, and pins the calling thread off the highest processor, as `hos_thread_pin` does. - A stand-in `rx_start` loads the module and asks both its `GetProcessAffinityMask` and the loading thread's own mask. Both must be the process's mask. - A broken copy (`rx_start` on the game's thread) must fail, with both masks equal to the pinned thread's. Any other pair is a plain failure, not the expected one. - It skips on Windows, and when the starting thread's mask has fewer than 2 processors or a processor id above 63 (`win32_posix.c`'s masks are 64 bits). - `tests/test_display_startup_failure.py` and `tests/display_startup_failure_test.cpp`: they cut `hos_display_start`, so they cut and stub the new helpers too. The headless case now also checks that the start ran on its own thread, was named, and was waited for and closed, and that it asked the sampler to list it once, on that thread, after its name and before the start. - `tests/test_slow_frames.py`: the sampler's order in `host/posix/prof.c` (one wait, then the one `.go` check, the generation read and compared, the sweep), and `hos_prof_relist`, compiled from its cut, moving the generation by one a call. **What headless Linux runs do differently after this PR:** - **Both threads by Auto:** Threaded rendering's Auto can now turn on the render thread and the recorder thread on a 4-core / 8-thread PC whose GPU has mirrored pools, as a windowed start already does. Farm headless runs on RADV should keep #2446 (an open GPU ring hang on RADV with both threads) in mind. A Steam Deck started headless counts 4 cores, and Auto stays off there: its pools have no mirrors. - **Pool workers:** every worker pool sized by `usable_cpus()` (the shader preparation, the noted pipelines, the texture threads) gets 2 more workers. - **Thread placement:** the module's own threads (pools, recorder, preparation workers) start on the process's whole mask, as in a windowed start. - **A pre-existing widening, now visible headless:** `win32_posix.c` `thread_self()` registers a thread its copy did not create on that thread's first `GetCurrentThread()`, and applies the copy's process mask to it. In `vk_replay.cpp` `ReplayPin` that happens before `SetThreadAffinityMask` reads the old mask. So with `RX_VK_ASYNC` off, the submitting guest thread comes back from its first inline replay on the process's whole mask, the reserved core included. A windowed Linux start does this today; a headless one hid it, because its module mask was the pinned one. It now shows in headless runs too. It is not caused here, and it is not fixed here: fixing it changes players' thread placement on Linux, which needs its own change and a measurement. **Unchanged:** no `vk_api.h` change, and no file of the shader-cache stamp, so no player prepares again. Nothing under `gpu/` changes. Windows does not build `display_sdl.c`, and a pack of this branch on a Windows base had no module that differs from the base's. Read first: `headless_renderer_start` in `host/posix/display_sdl.c`, then `thread_entry` and `process_affinity` in `host/posix/win32_posix.c`. ## Testing **Tested:** in the game on a Steam Deck OLED (SteamOS 3.9.5, kernel 7.2.7, Mesa 26.2.0-devel RADV, 4 cores / 8 threads, AC power, stock 15 W), head d9876f0f (main 2ca7d4f74 merged) against main 2ca7d4f74, each built from source on the Deck. Headless starts (`HOS_HEADLESS=1`, the control bridge's test profile), Market as a child: - **main:** `CPUs 8 (6 usable, 3 cores)`, `Threaded rendering: Auto: off (3 cores of 6 logical processors; the render thread and the recorder thread from 4 cores)`. - **this PR:** `CPUs 8 (8 usable, 4 cores)`, `Threaded rendering: Auto: off (not safe on this run: the buffer pools have no mirrors)`. That is the reason a windowed start on the Deck logs. Every run of each side logged the same lines (9 starts). - Pools are the same on the Deck either way (`workers 2, capture helpers 2, texture threads 4`), and both sides replay on `0xc0` while they replay. - The Test Farm ran the earlier head 9315148 headless on two Linux PCs (Ryzen AI MAX+ 395 / 8060S RADV, Ryzen 7 5800X / RX 9070 RADV): usable processors 30 -> 32 and 14 -> 16, cores 15 -> 16 and 7 -> 8, no crash. Game-free, on the Deck at d9876f0f: - `tests/test_headless_renderer_cpus.py`: PASS (process 0xff, game thread 0x7f, loader and module 0xff); its broken copy fails as it should (loader and module 0x7f). - `tests/test_display_startup_failure.py`: 12 of 12. On main's `display_sdl.c` (`--source-root`) the headless case fails ("the headless renderer started on the game's thread, not on a thread of its own"), as it must. - `tests/run_all.py`, the whole suite: 727 passed, 14 failed, 143 skipped. main 2ca7d4f74 on the same Deck: 726 passed and the same 14 failed. They are this Deck's toolchain, not the change: no ASan runtime (`test_audio_source`, `test_obj_cache_size`, `test_obj_guest_id`, `test_obj_table_bounded`); `-fuse-ld=lld` under `-Werror` (`test_option_ids`, `test_options_path`, `test_settings_atomic`, `test_ui_renderer`); no `string.h` for `builder/rt` (`test_game_module`, `test_game_module_imports`); `test_check_cache`, `test_game_font`, `test_vk_wb_cpu_words_fast`; and `test_i18n_complete` (missing translations, main's). - pre-commit (as `mise run lint`, gitleaks not installed here): passes. - The earlier rounds on Windows and WSL (main 694ae5820 / 3ab4db6e9) are unchanged: see the first comments. - A second-opinion review (gpt-6.2-sol) of d9876f0f, the whole diff and the merge's fixture resolution: none found. L1's change, game-free on the Deck at 9c71d05a (main f8b54338 merged in, da3bb0a7): - `tests/test_display_startup_failure.py`: 12 of 12. Negative controls: the call dropped fails ("the all-thread sampler was not asked to list the start's thread"), and the call before the name fails. - `tests/test_slow_frames.py`: ok. Negative controls, each failing: the samplers of 207652d8 and 067fb88f, the generation's load above the wait with its compare below, a second `.go` check before the wait, an empty `hos_prof_relist`, one kept under `#if 0` beside an empty one, and a step of 2. - `tests/test_headless_renderer_cpus.py`, `test_profiling_mode`, `test_sampler_stack_walk`, `test_prof_walk_fault`, `test_prof_modules`: pass. Both changed files syntax-checked with the build's own flags; ruff on the changed tests. - gpt-6.2-sol, four rounds: round 1 (an ask made in the sampler's wait was seen a sweep late) gave 067fb88f, round 2 (a sweep after the `.go` file went; the order check too loose) c60a5f82, round 3 (an empty `hos_prof_relist` passed the tests) bbe4e625, round 4 (the text checks passed an `#if 0` copy and a second `.go` check) 9c71d05a, round 5: none found. L3 and L1, in the game on the same Deck at 9c71d05a (built as `v3.2.0-247-g9c71d05a`) against main f8b54338, each built from source there; headless, Market as a child: - **L3**, `RX_VK_MIRROR=1` (mirrored pools), Threaded rendering left to Auto, one long run each (`--lead 600`: about 10 minutes of turning before the measured window). main: `CPUs 8 (6 usable, 3 cores)`, `Threaded rendering: Auto: off (3 cores of 6 logical processors; the render thread and the recorder thread from 4 cores)`. This PR: `CPUs 8 (8 usable, 4 cores)`, `Threaded rendering: Auto: on, the render thread and the recorder thread (4 cores of 8 logical processors)`. No GPU ring timeout, reset or device loss in either game log (#2446), and no amdgpu timeout, reset, fault or hang in the kernel's log (`journalctl -k`) from the first start to the last run's end. No frame over 100 ms in either window (38.38 and 41.53 fps: one run each with a different thread choice, not a measurement of this PR). With the render thread on, this PR also logs `RX_VK_READBACK_EARLY left off: the render thread is on ...`; the renderer leaves it off whenever the render thread is on. - **L1**, one start of this PR with `HOS_SAMPLE_ALL` from the boot (no mirrors: `Threaded rendering: Auto: the recorder thread only (4 cores of 8 logical processors; the render thread off: the buffer pools have no mirrors)`): the sampler began with 2 threads listed, and 19,487 of its 734,776 sample lines are `mkw_vk_start`'s, from its first sweep (0 ms) on, inside `longshot_vk.so`'s load. **Still to test:** - L4, a headless start with NVIDIA's Linux driver: queued on the Test Farm (`linux+nvidia`, no report yet). ## Measurements **Verdict:** no change in speed on the Steam Deck, as expected (same pools, Auto off either way): fps +1.9 %, CPU ms +0.0 %, the two admitted pairs disagreeing in sign (fps +8.5 % / -4.4 %, CPU ms -4.8 % / +5.2 %), so noise. Setup: Steam Deck OLED, SteamOS 3.9.5, Mesa 26.2.0-devel RADV, stock 15 W, AC; Market as a child, uncapped (`HOS_FPS_MAX=240`), headless, 1280x720 at 75 %; 3 alternating pairs, 2 admitted (the third pair's PR run swapped 80 MB in and was refused); a 20 s window each, the median of the runs. Numbers from headless Linux runs before and after this PR are still not comparable on PCs where the count changes the pools or Auto (above). | | Before: main @ 2ca7d4f74 | After: this PR @ d9876f0f | |---|---|---| | fps | 40.30 | 41.06 | | CPU ms a frame | 84.05 | 84.09 | | 1 % low (fps) | 21.4 | 24.9 | | p99 frame (ms) | 40.6 | 36.0 | | GPU ms | 12.05 | 11.95 | **Measured again on current main (2026-12-04)**, the same Deck and settings, at steady state. - **Arms:** main 6318f405 against main 6318f405 with this PR's four files (applied locally, built as a player's build). - **Window:** 45 s, after 150 s of turning in Market (`--lead 150`). 3 pairs, all admitted. | | Before: main @ 6318f405 | After: main @ 6318f405 + this PR | |---|---|---| | fps | 41.24 | 42.64 (+3.4 %; pairs −2.2, +5.7, +3.2 %) | | CPU ms a frame | 79.84 | 79.73 (−0.1 %) | | 1 % low (fps) | 25.5 | 26.9 | | p99 frame (ms) | 35.1 | 34.0 | - **No cost on current main.** Under 5 % with 3 pairs: diagnostic. - **The renderer's line changes as intended.** Main says "Threaded rendering: Auto: off (3 cores of 6 logical processors; ...)", one core too few. With this PR it says "Auto: off (not safe on this run: the buffer pools have no mirrors)". - **The reserved core:** without this PR, a headless start with no core reserved (`HOS_RESERVE_CORE=0`) measured +1.0 % and +4.1 %. With it, −0.1 %. So that gain was this bug, and players (windowed) never had it. ## Risks - **What could break:** headless Linux starts only. The renderer's start moves from the game's thread to a thread of its own, and the game's thread waits for it as long as the start ran before. The windowed start already runs the same `rx_start` on such a thread for every player. A revert is enough; there is no switch, because it is a fix. - **What a player notices after updating:** nothing (windowed starts and Windows are unchanged; the caches are untouched). - **What headless runs notice:** the renderer's setup now matches a windowed start's. That means more pool workers and possibly both threads by Auto on 4+ core machines with mirrors (#2446), as listed above. Numbers from headless Linux runs before and after this PR are not comparable. **Not covered:** - A windowed Linux start of this head (the windowed path is unchanged), and a 4-core / 8-thread Linux PC with a discrete GPU, where Auto may now run both threads headless (#2446). - Machines with more than 64 logical processors (the test skips), and kernel CPU masks wider than 1024 bits (the test's first affinity read fails). - `HOS_PIN` experiments that pin the loading thread by hand. - Under `HOS_SAMPLE_ALL`, the start's thread is listed from the sweep after it named itself, and sampled when it runs at its turn in a sweep, as any thread: a start of a few milliseconds can still give no sample. - The pre-existing `ReplayPin` widening above: a follow-up, not this PR. ## 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. (Linux: the game built from source on the Deck; Windows does not build `display_sdl.c`; no path is handled by the change.) - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [x] Everything in Still to test has run, its results in Tested. - [x] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). (Steam Deck here; RX 9070 RADV on Linux by the farm, on 9315148.) - [ ] 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)
longshot_vk.so has its own copy of host/posix/win32_posix.c, and that copy's GetProcessAffinityMask is the mask its
constructor read at the load: the loading thread's. A windowed start loads the module on renderer_main, a CreateThread
thread that starts with the process's affinity. Without a window (HOS_HEADLESS=1, or no SDL) hos_display_start called
rx_start on the game's own thread, which hos_thread_pin had already kept off the reserved core, so the module counted
the process without it: a Steam Deck started headless logged "CPUs 8 (6 usable, 3 cores)" and "Threaded rendering:
Auto: off (3 cores of 6 logical processors; ...)", where the same Deck preparing its shaders logged "8 usable, 4 cores",
and the module's threads were kept to that mask. Headless runs (the control bridge's test profile, the pipeline tour,
the Steam Deck harness) measured another thread shape than a player's windowed game.

Now the headless start runs rx_start on a thread of its own, named mkw_vk_start, and the game's thread waits for
it, as before. Linux only:
host/display.c (Windows) is unchanged, and so is the windowed start. No renderer or interface change.

tests/test_headless_renderer_cpus.py (Linux): win32_posix.c built into an executable and into a -Bsymbolic shared module,
hos_display_start cut from the source, the game's thread pinned off a reserved processor: the module must see the
process's mask; a broken copy (rx_start on the game's thread) and the base fail.
tests/test_display_startup_failure.py cuts the new helpers too; its headless case now asks that the renderer starts on a
thread of its own, named by itself (mkw_vk_start, so HOS_SAMPLE_ALL samples it), waited for and closed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The expected failure of the base and of the broken copy was told by the loader's mask alone: a module still
answering the process's whole mask from a pinned loader counted as that failure. It now needs both masks to be
the pinned thread's; any other pair is a plain failure. The docstring says a cpuset with a processor id above 63
makes the test skip (win32_posix.c's masks are 64 bits).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The plain failure's line says the two masks are neither both the process's nor both the pinned thread's (each
alone may be one of them). The skip note names the starting thread's mask, which is what main() reads, and a kernel
CPU mask wider than 1024 bits failing the first affinity read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge main into perf/linux-core-count
Some checks failed
PR description / Title and description (pull_request_target) Successful in 9s
CI / What the change needs (pull_request) Successful in 11s
CI / Third-party parts and guide screenshots (pull_request) Successful in 17s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 18s
beanstalk/approval approved by klimovich008 (reviewed)
beanstalk/linux 2/1 pass
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m14s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 4m10s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m38s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m0s
CI / Website build and checks (pull_request) Successful in 1m32s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 19m6s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 38m13s
931514821d
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: Not run in the game: the change is Linux only (host/posix/display_sdl.c, headless starts) and this PC (Windows 11, Ryzen 7 5700X3D, RX 9070 XT) has no Linux game build; on Windows no module differs from main's. Game-free in WSL Ubuntu with gcc and clang: the renderer module built as longshot_vk.so is, loaded by the headless start, sees the process's whole mask (0xffff) where main's sees the pinned thread's (0x7fff). A headless Linux start is asked of the Test Farm.

Tested in game: Not run in the game: the change is Linux only (host/posix/display_sdl.c, headless starts) and this PC (Windows 11, Ryzen 7 5700X3D, RX 9070 XT) has no Linux game build; on Windows no module differs from main's. Game-free in WSL Ubuntu with gcc and clang: the renderer module built as longshot_vk.so is, loaded by the headless start, sees the process's whole mask (0xffff) where main's sees the pinned thread's (0x7fff). A headless Linux start is asked of the Test Farm.
Author
Member

@Beanstalk linux, the Steam Deck or a 4-core / 8-thread PC if one is free (any Linux PC otherwise), this PR's head and main: one headless start each (HOS_HEADLESS=1, the farm's usual headless start), to the title screen or any area. No timing is needed. Expected in the log: this PR CPUs 8 (8 usable, 4 cores) where main logs CPUs 8 (6 usable, 3 cores) on an 8-thread machine (on a larger one: every logical processor usable on this PR, two fewer and one core fewer on main), and the Threaded rendering: Auto: ... line of each. Fail on a crash or a hang at start-up. Please attach both logs' CPUs and Threaded rendering lines.

@Beanstalk linux, the Steam Deck or a 4-core / 8-thread PC if one is free (any Linux PC otherwise), this PR's head and main: one headless start each (HOS_HEADLESS=1, the farm's usual headless start), to the title screen or any area. No timing is needed. Expected in the log: this PR `CPUs 8 (8 usable, 4 cores)` where main logs `CPUs 8 (6 usable, 3 cores)` on an 8-thread machine (on a larger one: every logical processor usable on this PR, two fewer and one core fewer on main), and the `Threaded rendering: Auto: ...` line of each. Fail on a crash or a hang at start-up. Please attach both logs' CPUs and Threaded rendering lines.
Author
Member
@review
Member
Beanstalk test farm · an earlier run: commit 9315148 (the newer results are in a comment below)

Commit 9315148 · approved by klimovich008 (reviewed) · dashboard

⚠️ Note: The farm cannot prefer a Steam Deck or 4-core/8-thread machine conditionally, so the target accepts any online Linux PC.
⚠️ Note: The plan records the counts and matches the log lines but cannot automatically check equality between CPU counts, the expected difference from main, or attach selected log excerpts.

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

The change passed headless startup on both Linux PCs. Usable logical processors increased from 30 → 32 and 14 → 16, while usable cores increased from 15 → 16 and 7 → 8, respectively.

Done (started 04:34 UTC, last report 04:46 UTC). Comment @Beanstalk to run it again.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
linux ✅ pass 2 1 2 — — none
What was tested

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

One headless Linux start of the pull request and one of main will reach the title screen, with a bounded wait for startup. The runs will record the CPU counts and Threaded rendering Auto log lines for comparison; the pull request fails on a crash or startup hang. The expected change is that all logical processors are usable on the pull request, while main reports two fewer usable processors and one fewer core.

  • Where: linux (1-2 reports).
  • headless-startup: from the title screen; 1 run on each side.
  • Measured: crashes, the game's log, numbers from the game's log.
  • The PR fails if: it crashes.
  • Time: about 10 min of game runs per tester (2 game starts), plus the two builds.
Measurements on `linux`, for the PR description

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

Hardware: 1: linux+amd+radv+igpu AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99 AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM; 2: linux+amd+radv+dgpu AMD Radeon RX 9070 (RADV GFX1201), 26.0.8 AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM
Scene: headless-startup, from the title screen; 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); headless-startup: 1 game start a side; 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.

As Markdown for the PR description:

## Measurements

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

Hardware: 1: linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM`  
Scene: headless-startup, from the title screen; 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); headless-startup: 1 game start a side; 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.
The testers' hardware
Target Report Ran on
linux 1 linux+amd+radv+igpu AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99 AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM
linux 2 linux+amd+radv+dgpu AMD Radeon RX 9070 (RADV GFX1201), 26.0.8 AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>9315148</code> (the newer results are in a comment below)</summary> Commit `9315148` · approved by klimovich008 (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/2784) ⚠️ **Note:** The farm cannot prefer a Steam Deck or 4-core/8-thread machine conditionally, so the target accepts any online Linux PC. ⚠️ **Note:** The plan records the counts and matches the log lines but cannot automatically check equality between CPU counts, the expected difference from main, or attach selected log excerpts. > **Summary**, written by AI (`gpt-6.1-terra`) from the numbers below: > > The change passed headless startup on both Linux PCs. Usable logical processors increased from 30 → 32 and 14 → 16, while usable cores increased from 15 → 16 and 7 → 8, respectively. Done (started 04:34 UTC, last report 04:46 UTC). Comment `@Beanstalk` to run it again. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `linux` | ✅ pass | 2 [1](https://beanstalk.magicbean.dev/reports/rp_b2bffcecf5e85723) [2](https://beanstalk.magicbean.dev/reports/rp_c0f798b8c5e35215) | — | — | none | <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) One headless Linux start of the pull request and one of main will reach the title screen, with a bounded wait for startup. The runs will record the CPU counts and Threaded rendering Auto log lines for comparison; the pull request fails on a crash or startup hang. The expected change is that all logical processors are usable on the pull request, while main reports two fewer usable processors and one fewer core. - **Where:** linux (1-2 reports). - **headless-startup:** from the title screen; 1 run on each side. - **Measured:** crashes, the game's log, numbers from the game's log. - **The PR fails if:** it crashes. - **Time:** about 10 min of game runs per tester (2 game starts), plus the two builds. </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+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM` Scene: headless-startup, from the title screen; 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); headless-startup: 1 game start a side; 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. 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+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM` Scene: headless-startup, from the title screen; 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); headless-startup: 1 game start a side; 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> <details><summary>The testers' hardware</summary> | Target | Report | Ran on | | --- | --- | --- | | `linux` | [1](https://beanstalk.magicbean.dev/reports/rp_b2bffcecf5e85723) | linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM` | | `linux` | [2](https://beanstalk.magicbean.dev/reports/rp_c0f798b8c5e35215) | linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM` | </details> </details>
Member

Possibly related, for context:

  • PR #499 fix(vk): on Linux the texture helpers started inside a replay run on every core again — Linux renderer threads inherit affinity; related shim behavior already fixed for texture helpers
  • PR #1664 perf(vk): Threaded rendering's Auto chooses by physical cores, in three tiers — physical-core Auto threshold depends on usable-core counting
  • PR #2232 perf(vk): Threaded rendering's Auto runs the recorder thread from 4 cores, not 6 — Auto threaded rendering behavior relevant to added headless capacity
Possibly related, for context: - PR #499 fix(vk): on Linux the texture helpers started inside a replay run on every core again — Linux renderer threads inherit affinity; related shim behavior already fixed for texture helpers - PR #1664 perf(vk): Threaded rendering's Auto chooses by physical cores, in three tiers — physical-core Auto threshold depends on usable-core counting - PR #2232 perf(vk): Threaded rendering's Auto runs the recorder thread from 4 cores, not 6 — Auto threaded rendering behavior relevant to added headless capacity
BeanBot left a comment

Recommendation: Approve. The affinity test demonstrates the intended mechanism, but this head has not yet run the real renderer on Linux. Headless starts can also select different renderer threads and worker counts, so the affected hardware needs a game run before merge. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

Headless Linux starts load the renderer on a thread with the process affinity, matching windowed startup. This improves the comparability of headless runs, at the cost of different worker counts and renderer thread selection; short renderer starts can also disappear from all-thread profiles.

Should fix (1): not blocking, but worth doing before merging.

  • L1 host/posix/display_sdl.c:375: Moving startup to a short-lived thread can make the all-thread sampler miss renderer startup entirely. (more on the line) Do: Make the sampler discover the startup thread promptly, or otherwise keep startup visible to it.

Testing before merging (3) (runs on the systems it can change; it doesn't hold the recommendation)

  • L2 host/posix/display_sdl.c:376: Verify the real headless renderer startup and affinity on a Steam Deck. (more on the line) Do: Run headless starts of main and this head on a Steam Deck, check the CPU and Auto thread-selection log lines, and confirm startup reaches the game without a crash or hang.
  • L3 host/posix/display_sdl.c:376: Check the changed Auto thread selection on a RADV system with mirrored pools. (more on the line) Do: Run main and this head headless on a suitable RADV system, verify the CPU and Auto lines, and exercise rendering long enough to check for the reported hang.
  • L4 host/posix/display_sdl.c:376: Exercise the changed headless startup with the NVIDIA Linux driver as well. (more on the line) Do: Run a headless game start on an NVIDIA Linux system and check startup, rendering, CPU count and Auto thread selection.

@fix can do L1.

Checks: Still running: 9 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven in the game. The reported game-free GCC and Clang runs saw mask 0xffff in both the loader and module, versus 0x7fff on the pinned caller and on main. No game run of this head has confirmed the resulting CPU counts or renderer startup.

Other systems: Windowed Linux startup, shader preparation and Windows do not use the changed branch. Headless Linux can change pool sizes, thread placement and Auto threaded-rendering selection across GPU drivers; the temporary startup thread also affects all-thread profiling. No real Linux renderer run of this head is reported.

Switches: None added, changed or removed.

Reviewed: 931514821d against 3ab4db6e91: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the four changed files, the diff and commit messages. Read the relevant renderer loading, affinity, thread lifetime, replay pinning and profiler paths. Reviewed the reported test runs and comments; no review checklist file was present. Other renderer code and tests were searched or skimmed rather than read in full.; nothing run (a code review).

Checked and fine:

  • The new thread is waited for before the game continues and its handle is closed.
  • The game-free affinity test includes a broken-copy control and checks both the loader and module masks.
  • The changed files contain no game-derived output, generated shader files or renderer API changes; the commits record AI assistance.

Testing: No code, tests or project scripts were run during this review. The author reports game-free GCC and Clang passes; CI was still running.

Overlaps and merge order: Not checked; network access was unavailable.


Automated code review by BeanBot (gpt-6.1-terra), asked for by klimovich008. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The affinity test demonstrates the intended mechanism, but this head has not yet run the real renderer on Linux. Headless starts can also select different renderer threads and worker counts, so the affected hardware needs a game run before merge. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. Headless Linux starts load the renderer on a thread with the process affinity, matching windowed startup. This improves the comparability of headless runs, at the cost of different worker counts and renderer thread selection; short renderer starts can also disappear from all-thread profiles. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `host/posix/display_sdl.c:375`: Moving startup to a short-lived thread can make the all-thread sampler miss renderer startup entirely. (more on the line) **Do:** Make the sampler discover the startup thread promptly, or otherwise keep startup visible to it. **Testing before merging (3)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2** `host/posix/display_sdl.c:376`: Verify the real headless renderer startup and affinity on a Steam Deck. (more on the line) **Do:** Run headless starts of main and this head on a Steam Deck, check the CPU and Auto thread-selection log lines, and confirm startup reaches the game without a crash or hang. - **L3** `host/posix/display_sdl.c:376`: Check the changed Auto thread selection on a RADV system with mirrored pools. (more on the line) **Do:** Run main and this head headless on a suitable RADV system, verify the CPU and Auto lines, and exercise rendering long enough to check for the reported hang. - **L4** `host/posix/display_sdl.c:376`: Exercise the changed headless startup with the NVIDIA Linux driver as well. (more on the line) **Do:** Run a headless game start on an NVIDIA Linux system and check startup, rendering, CPU count and Auto thread selection. `@fix` can do L1. **Checks:** Still running: 9 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven in the game. The reported game-free GCC and Clang runs saw mask 0xffff in both the loader and module, versus 0x7fff on the pinned caller and on main. No game run of this head has confirmed the resulting CPU counts or renderer startup. **Other systems:** Windowed Linux startup, shader preparation and Windows do not use the changed branch. Headless Linux can change pool sizes, thread placement and Auto threaded-rendering selection across GPU drivers; the temporary startup thread also affects all-thread profiling. No real Linux renderer run of this head is reported. **Switches:** None added, changed or removed. **Reviewed:** 931514821d63 against 3ab4db6e9154: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the four changed files, the diff and commit messages. Read the relevant renderer loading, affinity, thread lifetime, replay pinning and profiler paths. Reviewed the reported test runs and comments; no review checklist file was present. Other renderer code and tests were searched or skimmed rather than read in full.; nothing run (a code review). **Checked and fine:** - The new thread is waited for before the game continues and its handle is closed. - The game-free affinity test includes a broken-copy control and checks both the loader and module masks. - The changed files contain no game-derived output, generated shader files or renderer API changes; the commits record AI assistance. **Testing:** No code, tests or project scripts were run during this review. The author reports game-free GCC and Clang passes; CI was still running. **Overlaps and merge order:** Not checked; network access was unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by klimovich008. Nothing was run; a maintainer decides.</sub>
@ -363,0 +372,4 @@
its thread list, taken again every 5 s, has the new thread: a start that ends before that is not sampled) */
static DWORD WINAPI headless_renderer_main(void *p) {
(void)p;
SetThreadDescription(GetCurrentThread(), L"mkw_vk_start"); /* (itself, before the start: its pthread id is its own) */
Member

L1 (should fix): Moving startup to a short-lived thread can make the all-thread sampler miss renderer startup entirely.

When: With HOS_SAMPLE_ALL active, if the sampler has already listed threads and this thread starts and finishes before the next five-second refresh, its renderer startup stacks are absent. Previously that work ran on the already-listed guest thread.

Do: Make the sampler discover the startup thread promptly, or otherwise keep startup visible to it.

**L1** (should fix): Moving startup to a short-lived thread can make the all-thread sampler miss renderer startup entirely. *When:* With HOS_SAMPLE_ALL active, if the sampler has already listed threads and this thread starts and finishes before the next five-second refresh, its renderer startup stacks are absent. Previously that work ran on the already-listed guest thread. **Do:** Make the sampler discover the startup thread promptly, or otherwise keep startup visible to it.
@ -363,0 +373,4 @@
static DWORD WINAPI headless_renderer_main(void *p) {
(void)p;
SetThreadDescription(GetCurrentThread(), L"mkw_vk_start"); /* (itself, before the start: its pthread id is its own) */
rx_start(NULL);
Member

L2 (should fix): Verify the real headless renderer startup and affinity on a Steam Deck.

When: The stand-in module checks affinity but does not initialize Vulkan or exercise the renderer's startup and worker pools.

Do: Run headless starts of main and this head on a Steam Deck, check the CPU and Auto thread-selection log lines, and confirm startup reaches the game without a crash or hang.

**L2** (should fix): Verify the real headless renderer startup and affinity on a Steam Deck. *When:* The stand-in module checks affinity but does not initialize Vulkan or exercise the renderer's startup and worker pools. **Do:** Run headless starts of main and this head on a Steam Deck, check the CPU and Auto thread-selection log lines, and confirm startup reaches the game without a crash or hang.
Member

L3 (should fix): Check the changed Auto thread selection on a RADV system with mirrored pools.

When: On a four-core, eight-thread system the wider mask can enable both renderer threads where headless main left them off; the PR identifies an open RADV ring hang involving both threads.

Do: Run main and this head headless on a suitable RADV system, verify the CPU and Auto lines, and exercise rendering long enough to check for the reported hang.

**L3** (should fix): Check the changed Auto thread selection on a RADV system with mirrored pools. *When:* On a four-core, eight-thread system the wider mask can enable both renderer threads where headless main left them off; the PR identifies an open RADV ring hang involving both threads. **Do:** Run main and this head headless on a suitable RADV system, verify the CPU and Auto lines, and exercise rendering long enough to check for the reported hang.
Member

L4 (should fix): Exercise the changed headless startup with the NVIDIA Linux driver as well.

When: The new thread initializes the real Vulkan renderer and its workers on a different affinity mask, but the reported checks use a stand-in module and do not exercise this driver.

Do: Run a headless game start on an NVIDIA Linux system and check startup, rendering, CPU count and Auto thread selection.

**L4** (should fix): Exercise the changed headless startup with the NVIDIA Linux driver as well. *When:* The new thread initializes the real Vulkan renderer and its workers on a different affinity mask, but the reported checks use a stand-in module and do not exercise this driver. **Do:** Run a headless game start on an NVIDIA Linux system and check startup, rendering, CPU count and Auto thread selection.
Merge main into perf/linux-core-count
Some checks reported errors
CI / What the change needs (pull_request) Successful in 12s
CI / Third-party parts and guide screenshots (pull_request) Successful in 13s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 13s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m29s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 17m10s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 12m19s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 12m52s
CI / Website build and checks (pull_request) Failing after 43s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Successful in 49m21s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1h0m10s
beanstalk/approval approved by klimovich008 (reviewed)
beanstalk/linux+radv 0/1 pass, 2 error
beanstalk/linux+nvidia 0/1 pass, 2 error
beanstalk/linux+intel 0/1 pass, 0 running, 1 queued
beanstalk/steamdeck 0/1 pass, 2 error
PR description / Title and description (pull_request_target) Successful in 7s
d9876f0fc9
The display startup fixture: main's windowless wait (50 ms polls, WAIT_OBJECT_0) and its new stubs kept; the headless
start's own thread (made, named, waited for with INFINITE, closed) added beside them; the stubs main dropped stay dropped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012MibRabbL9JhKKrsNVaBfg
Author
Member

Synced with main and tested on a Steam Deck.

  • Head d9876f0f: main 2ca7d4f74 merged. Two test fixtures conflicted with main's windowless wait (#2786's 50 ms polls). Main's side is kept, the start thread's stubs are added beside it, and INFINITE is back for the start's wait. No change to host/.
  • In the game, Steam Deck OLED, headless: main logs CPUs 8 (6 usable, 3 cores). This PR logs CPUs 8 (8 usable, 4 cores) and Auto's windowed reason, "the buffer pools have no mirrors". That held on all 9 starts. Pools are unchanged on the Deck.
  • A/B at 15 W in Market (diagnostic): no speed change, as expected. Details are in Measurements.
  • Full run_all.py on the Deck: the same 14 environment failures as main, plus this PR's own test passing. They are named in Tested.
  • Sol review of the new head: none found.

Still to test is now empty. Description updated.

Synced with main and tested on a Steam Deck. - **Head d9876f0f:** main 2ca7d4f74 merged. Two test fixtures conflicted with main's windowless wait (#2786's 50 ms polls). Main's side is kept, the start thread's stubs are added beside it, and `INFINITE` is back for the start's wait. No change to `host/`. - **In the game, Steam Deck OLED, headless:** main logs `CPUs 8 (6 usable, 3 cores)`. This PR logs `CPUs 8 (8 usable, 4 cores)` and Auto's windowed reason, "the buffer pools have no mirrors". That held on all 9 starts. Pools are unchanged on the Deck. - **A/B at 15 W in Market (diagnostic):** no speed change, as expected. Details are in Measurements. - **Full `run_all.py` on the Deck:** the same 14 environment failures as main, plus this PR's own test passing. They are named in Tested. - **Sol review of the new head:** none found. Still to test is now empty. Description updated.
Author
Member
@review
Author
Member

@Beanstalk

@Beanstalk
Member
Beanstalk test farm · an earlier run: commit d9876f0 (the newer results are in a comment below)

Commit d9876f0 · approved by klimovich008 (reviewed) · dashboard

⚠️ Note: The log checks require the CPU and Auto lines but cannot establish that the reported usable CPU count equals the process affinity or compare it with a windowed start.
⚠️ Note: The farm cannot run the new game-free affinity and startup-failure fixtures or verify that short renderer starts appear in the all-thread sampler.
⚠️ Note: The RADV target does not guarantee mirrored pools or that Auto selects both threads, and the intermittent ring hang has no reliable trigger.

Started at 2026-12-03 11:57 UTC.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
linux+radv ⚠️ couldn't be judged 2 1 2 — — none
linux+nvidia ⚠️ couldn't be judged 2 1 2 — — none
linux+intel ⏳ queued 1 1 — — none
steamdeck ⚠️ couldn't be judged 2 1 2 — — none

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+radv, report 1: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • linux+radv, report 2: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • linux+nvidia, report 1: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • linux+nvidia, report 2: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • linux+intel, report 1: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • steamdeck, report 1: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • steamdeck, report 2: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
What was tested

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

Three headless starts each of main and the PR will exercise Market and Hyrule Field on Linux RADV, NVIDIA and Intel systems, with a separate Steam Deck target that waits for a tester. Each start captures the CPU and threaded-rendering startup lines, compares stationary pictures, and measures uncapped frame times for 20 seconds in each area. Crashes, hangs, missing startup lines, substantial picture differences or frame-time regressions fail the PR. The run also exercises the RADV renderer, although a short test cannot rule out an intermittent ring hang. No tester online now matches steamdeck: that target waits for one.

  • Where: linux+radv (1-2 reports), linux+nvidia (1-2 reports), linux+intel (1-2 reports), steamdeck (1-2 reports).
  • headless-start-and-render: from the repository's save market-entrance (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0; switches HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0), then teleport to Market, take the picture market to compare with main, measure market for 20 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 10 s warm-up); 3 runs on each side.
  • Measured: crashes, frame times, stutters and hitches, the game's log.
  • The PR fails if: it crashes; or a picture differs from main by more than 30%; or frame time (p99) is more than 20% above main; or forbidden log lines is above 0; or expected log lines missing is above 0; or frame time (worst 1%) is more than 20% above main.
  • Time: about 37 min of game runs per tester (6 game starts), plus the two builds.
Measurements on `linux+radv`, for the PR description

Verdict: could not be judged on linux+radv (2 reports).

Hardware: 1: linux+amd+radv+igpu AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99 AMD Ryzen Z2 Extreme, 32 GB RAM; 2: linux+amd+radv+dgpu AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1 AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM
Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@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.

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on linux+radv (2 reports).

Hardware: 1: linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM`  
Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@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 on `linux+nvidia`, for the PR description

Verdict: could not be judged on linux+nvidia (2 reports).

Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 5070, 620.73.4 AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpu+dlss NVIDIA GeForce RTX 5070 Laptop GPU, 620.85.2 AMD Ryzen AI 9 365 w/ Radeon 880M, 32 GB RAM
Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@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.

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on linux+nvidia (2 reports).

Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.73.4` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu+dlss `NVIDIA GeForce RTX 5070 Laptop GPU, 620.85.2` `AMD Ryzen AI 9 365 w/ Radeon 880M, 32 GB RAM`  
Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@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 on `linux+intel`, for the PR description

Verdict: queued on linux+intel (1 report).

Hardware: 1: linux+intel+anv+igpu Intel(R) Graphics (RKL GT1), 26.2.4 11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM
Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (@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.

As Markdown for the PR description:

## Measurements

**Verdict:** queued on linux+intel (1 report).

Hardware: 1: linux+intel+anv+igpu `Intel(R) Graphics (RKL GT1), 26.2.4` `11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM`  
Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 1 report  
How to reproduce: the farm's plan above (`@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 on `steamdeck`, for the PR description

Verdict: could not be judged on steamdeck (2 reports).

Hardware: 1: linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 16 GB RAM; 2: linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 16 GB RAM
Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@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.

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on steamdeck (2 reports).

Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM`; 2: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM`  
Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@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.
The testers' hardware
Target Report Ran on
linux+radv 1 linux+amd+radv+igpu AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99 AMD Ryzen Z2 Extreme, 32 GB RAM
linux+radv 2 linux+amd+radv+dgpu AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1 AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM
linux+nvidia 1 linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 5070, 620.73.4 AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM
linux+nvidia 2 linux+nvidia+nvidia-proprietary+dgpu+dlss NVIDIA GeForce RTX 5070 Laptop GPU, 620.85.2 AMD Ryzen AI 9 365 w/ Radeon 880M, 32 GB RAM
linux+intel 1 linux+intel+anv+igpu Intel(R) Graphics (RKL GT1), 26.2.4 11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM
steamdeck 1 linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 16 GB RAM
steamdeck 2 linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 16 GB RAM
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>d9876f0</code> (the newer results are in a comment below)</summary> Commit `d9876f0` · approved by klimovich008 (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/2784) ⚠️ **Note:** The log checks require the CPU and Auto lines but cannot establish that the reported usable CPU count equals the process affinity or compare it with a windowed start. ⚠️ **Note:** The farm cannot run the new game-free affinity and startup-failure fixtures or verify that short renderer starts appear in the all-thread sampler. ⚠️ **Note:** The RADV target does not guarantee mirrored pools or that Auto selects both threads, and the intermittent ring hang has no reliable trigger. Started at 2026-12-03 11:57 UTC. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `linux+radv` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_87efbbfce40249ee) [2](https://beanstalk.magicbean.dev/reports/rp_24d916df2a1dd654) | — | — | none | | `linux+nvidia` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_58625af15128f1bc) [2](https://beanstalk.magicbean.dev/reports/rp_4c985f092be16c47) | — | — | none | | `linux+intel` | ⏳ queued | 1 [1](https://beanstalk.magicbean.dev/reports/rp_1affab42360578d3) | — | — | none | | `steamdeck` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_3bc333bf53cf788f) [2](https://beanstalk.magicbean.dev/reports/rp_f218ea50c6c2e41a) | — | — | none | **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+radv`, [report 1](https://beanstalk.magicbean.dev/reports/rp_87efbbfce40249ee): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `linux+radv`, [report 2](https://beanstalk.magicbean.dev/reports/rp_24d916df2a1dd654): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `linux+nvidia`, [report 1](https://beanstalk.magicbean.dev/reports/rp_58625af15128f1bc): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `linux+nvidia`, [report 2](https://beanstalk.magicbean.dev/reports/rp_4c985f092be16c47): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `linux+intel`, [report 1](https://beanstalk.magicbean.dev/reports/rp_1affab42360578d3): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `steamdeck`, [report 1](https://beanstalk.magicbean.dev/reports/rp_3bc333bf53cf788f): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `steamdeck`, [report 2](https://beanstalk.magicbean.dev/reports/rp_f218ea50c6c2e41a): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) Three headless starts each of main and the PR will exercise Market and Hyrule Field on Linux RADV, NVIDIA and Intel systems, with a separate Steam Deck target that waits for a tester. Each start captures the CPU and threaded-rendering startup lines, compares stationary pictures, and measures uncapped frame times for 20 seconds in each area. Crashes, hangs, missing startup lines, substantial picture differences or frame-time regressions fail the PR. The run also exercises the RADV renderer, although a short test cannot rule out an intermittent ring hang. No tester online now matches steamdeck: that target waits for one. - **Where:** linux+radv (1-2 reports), linux+nvidia (1-2 reports), linux+intel (1-2 reports), steamdeck (1-2 reports). - **headless-start-and-render:** from the repository's save `market-entrance` (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0; switches `HOS_OUTPUT_RES=1280x720`, `RX_VK_AUTO_TUNE=0`), then teleport to Market, take the picture market to compare with main, measure market for 20 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 10 s warm-up); 3 runs on each side. - **Measured:** crashes, frame times, stutters and hitches, the game's log. - **The PR fails if:** it crashes; or a picture differs from main by more than 30%; or frame time (p99) is more than 20% above main; or forbidden log lines is above 0; or expected log lines missing is above 0; or frame time (worst 1%) is more than 20% above main. - **Time:** about 37 min of game runs per tester (6 game starts), plus the two builds. </details> <details><summary>Measurements on `linux+radv`, for the PR description</summary> **Verdict:** could not be judged on linux+radv (2 reports). Hardware: 1: linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM` Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@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. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on linux+radv (2 reports). Hardware: 1: linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM` Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@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> <details><summary>Measurements on `linux+nvidia`, for the PR description</summary> **Verdict:** could not be judged on linux+nvidia (2 reports). Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.73.4` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu+dlss `NVIDIA GeForce RTX 5070 Laptop GPU, 620.85.2` `AMD Ryzen AI 9 365 w/ Radeon 880M, 32 GB RAM` Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@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. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on linux+nvidia (2 reports). Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.73.4` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu+dlss `NVIDIA GeForce RTX 5070 Laptop GPU, 620.85.2` `AMD Ryzen AI 9 365 w/ Radeon 880M, 32 GB RAM` Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@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> <details><summary>Measurements on `linux+intel`, for the PR description</summary> **Verdict:** queued on linux+intel (1 report). Hardware: 1: linux+intel+anv+igpu `Intel(R) Graphics (RKL GT1), 26.2.4` `11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM` Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@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. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** queued on linux+intel (1 report). Hardware: 1: linux+intel+anv+igpu `Intel(R) Graphics (RKL GT1), 26.2.4` `11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM` Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@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> <details><summary>Measurements on `steamdeck`, for the PR description</summary> **Verdict:** could not be judged on steamdeck (2 reports). Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM`; 2: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM` Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@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. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on steamdeck (2 reports). Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM`; 2: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM` Scene: headless-start-and-render, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); headless-start-and-render: 3 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@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> <details><summary>The testers' hardware</summary> | Target | Report | Ran on | | --- | --- | --- | | `linux+radv` | [1](https://beanstalk.magicbean.dev/reports/rp_87efbbfce40249ee) | linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM` | | `linux+radv` | [2](https://beanstalk.magicbean.dev/reports/rp_24d916df2a1dd654) | linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM` | | `linux+nvidia` | [1](https://beanstalk.magicbean.dev/reports/rp_58625af15128f1bc) | linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.73.4` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM` | | `linux+nvidia` | [2](https://beanstalk.magicbean.dev/reports/rp_4c985f092be16c47) | linux+nvidia+nvidia-proprietary+dgpu+dlss `NVIDIA GeForce RTX 5070 Laptop GPU, 620.85.2` `AMD Ryzen AI 9 365 w/ Radeon 880M, 32 GB RAM` | | `linux+intel` | [1](https://beanstalk.magicbean.dev/reports/rp_1affab42360578d3) | linux+intel+anv+igpu `Intel(R) Graphics (RKL GT1), 26.2.4` `11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM` | | `steamdeck` | [1](https://beanstalk.magicbean.dev/reports/rp_3bc333bf53cf788f) | linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM` | | `steamdeck` | [2](https://beanstalk.magicbean.dev/reports/rp_f218ea50c6c2e41a) | linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM` | </details> </details>
BeanBot left a comment

Recommendation: Approve. The Steam Deck run shows the intended affinity correction, but the sampler can still miss a short renderer start. The requested mirrored-pool RADV and NVIDIA Linux runs also remain outstanding. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

Headless Linux starts load the renderer on a thread with the process affinity, matching windowed startup. This improves measurement parity at the cost of a separate startup thread and potentially different renderer worker and Auto-thread choices.

Should fix (1): not blocking, but worth doing before merging.

  • L1 host/posix/display_sdl.c:375: Moving startup to a short-lived thread can make the all-thread sampler miss renderer startup entirely. When: With HOS_SAMPLE_ALL active, if the sampler has already listed threads and this thread starts and finishes before the next five-second refresh, its renderer startup stacks are absent. Previously that work ran on the already-listed guest thread. Do: Make the sampler discover the startup thread promptly, or otherwise keep startup visible to it.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3 host/posix/display_sdl.c:376: Check the changed Auto thread selection on a RADV system with mirrored pools. When: On a four-core, eight-thread system the wider mask can enable both renderer threads where headless main left them off; the PR identifies an open RADV ring hang involving both threads. Do: Run main and this head headless on a suitable RADV system, verify the CPU and Auto lines, and exercise rendering long enough to check for the reported hang.
  • L4 host/posix/display_sdl.c:376: Exercise the changed headless startup with the NVIDIA Linux driver as well. When: The new thread initializes the real Vulkan renderer and its workers on a different affinity mask, but the reported checks use a stand-in module and do not exercise this driver. Do: Run a headless game start on an NVIDIA Linux system and check startup, rendering, CPU count and Auto thread selection.

@fix can do L1.

Since the last review (on 931514821d)
Resolved: L2 (Verify the real headless renderer startup and affinity on a Steam Deck.)
Still open: L1 (Moving startup to a short-lived thread can make the all-thread sampler miss renderer start…); L3 (Check the changed Auto thread selection on a RADV system with mirrored pools.); L4 (Exercise the changed headless startup with the NVIDIA Linux driver as well.)

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes: on a Steam Deck, nine headless starts reported 8 usable processors and 4 cores, versus 6 and 3 on main. This is an affinity fix, not a claimed player performance gain; the two admitted timing pairs were noisy.

Other systems: Windowed Linux startup and Windows do not use the changed branch. Headless Linux can select more workers or enable Auto threading on mirrored pools; the reported farm runs found no crash on two RADV PCs, but do not establish the requested mirrored-pool case. NVIDIA Linux remains untested.

Switches: None added, changed, or removed.

Reviewed: d9876f0fc9 against 2ca7d4f741: Read the repository rules, pull request template, diff and changed test files, and inspected the display startup, affinity and sampler paths. Skimmed the recorded runs and other surrounding code; docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent.; nothing run (a code review).

Checked and fine:

  • The changed fixture preserves the infinite wait for renderer startup and models the windowless game-thread wait as 50 ms polling.
  • The affinity test checks both the loading thread and the separately linked module, with a negative control.

Testing: No commands that build or run project code were executed. The author reports the game-free tests passing and the same 14 full-suite failures on main and head; CI is still running.

Overlaps and merge order: None found.


Automated code review by BeanBot (gpt-6.1-terra), asked for by klimovich008. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The Steam Deck run shows the intended affinity correction, but the sampler can still miss a short renderer start. The requested mirrored-pool RADV and NVIDIA Linux runs also remain outstanding. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. Headless Linux starts load the renderer on a thread with the process affinity, matching windowed startup. This improves measurement parity at the cost of a separate startup thread and potentially different renderer worker and Auto-thread choices. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `host/posix/display_sdl.c:375`: Moving startup to a short-lived thread can make the all-thread sampler miss renderer startup entirely. *When:* With HOS_SAMPLE_ALL active, if the sampler has already listed threads and this thread starts and finishes before the next five-second refresh, its renderer startup stacks are absent. Previously that work ran on the already-listed guest thread. **Do:** Make the sampler discover the startup thread promptly, or otherwise keep startup visible to it. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `host/posix/display_sdl.c:376`: Check the changed Auto thread selection on a RADV system with mirrored pools. *When:* On a four-core, eight-thread system the wider mask can enable both renderer threads where headless main left them off; the PR identifies an open RADV ring hang involving both threads. **Do:** Run main and this head headless on a suitable RADV system, verify the CPU and Auto lines, and exercise rendering long enough to check for the reported hang. - **L4** `host/posix/display_sdl.c:376`: Exercise the changed headless startup with the NVIDIA Linux driver as well. *When:* The new thread initializes the real Vulkan renderer and its workers on a different affinity mask, but the reported checks use a stand-in module and do not exercise this driver. **Do:** Run a headless game start on an NVIDIA Linux system and check startup, rendering, CPU count and Auto thread selection. `@fix` can do L1. **Since the last review** (on 931514821d63) Resolved: L2 (Verify the real headless renderer startup and affinity on a Steam Deck.) Still open: L1 (Moving startup to a short-lived thread can make the all-thread sampler miss renderer start…); L3 (Check the changed Auto thread selection on a RADV system with mirrored pools.); L4 (Exercise the changed headless startup with the NVIDIA Linux driver as well.) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes: on a Steam Deck, nine headless starts reported 8 usable processors and 4 cores, versus 6 and 3 on main. This is an affinity fix, not a claimed player performance gain; the two admitted timing pairs were noisy. **Other systems:** Windowed Linux startup and Windows do not use the changed branch. Headless Linux can select more workers or enable Auto threading on mirrored pools; the reported farm runs found no crash on two RADV PCs, but do not establish the requested mirrored-pool case. NVIDIA Linux remains untested. **Switches:** None added, changed, or removed. **Reviewed:** d9876f0fc9bf against 2ca7d4f74182: Read the repository rules, pull request template, diff and changed test files, and inspected the display startup, affinity and sampler paths. Skimmed the recorded runs and other surrounding code; docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent.; nothing run (a code review). **Checked and fine:** - The changed fixture preserves the infinite wait for renderer startup and models the windowless game-thread wait as 50 ms polling. - The affinity test checks both the loading thread and the separately linked module, with a negative control. **Testing:** No commands that build or run project code were executed. The author reports the game-free tests passing and the same 14 full-suite failures on main and head; CI is still running. **Overlaps and merge order:** None found. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by klimovich008. Nothing was run; a maintainer decides.</sub>
Author
Member

CI on d9876f0f: the four failures look like main's, not this change's. I couldn't open the job logs (they need a browser sign-in), and main's own CI is still queued. So this rests on the evidence below, not on the logs.

  • Host C for Windows, Rust, Website.
    • This diff touches only host/posix/display_sdl.c (Linux only) and its tests. None of the three builds anything it changes.
    • #3081, an unrelated lifter change, fails the same three jobs in about the same times (1m27s, 15m33s, 38s).
    • #3121 describes main's cargo fmt failure (from #3098) and a Windows build-core failure (#3113).
  • Game-free checks, part 1. I merged main 6318f405 into this branch locally and ran the checks on Linux (Steam Deck, SteamOS).
    • This PR's tests pass: test_headless_renderer_cpus passes, and fails on plain main ("the module saw the pinned thread's mask"); test_display_startup_failure passes 12 of 12.
    • test_cursor_hidden_linux fails there exactly as it does on plain main (esc_had_capture set but not used). #3121 fixes it.
  • Farm errors: main's tools.lock problem, reported before.

I'll check again once main's CI has run.

**CI on d9876f0f:** the four failures look like main's, not this change's. I couldn't open the job logs (they need a browser sign-in), and main's own CI is still queued. So this rests on the evidence below, not on the logs. - **Host C for Windows, Rust, Website.** - This diff touches only `host/posix/display_sdl.c` (Linux only) and its tests. None of the three builds anything it changes. - #3081, an unrelated lifter change, fails the same three jobs in about the same times (1m27s, 15m33s, 38s). - #3121 describes main's `cargo fmt` failure (from #3098) and a Windows build-core failure (#3113). - **Game-free checks, part 1.** I merged main 6318f405 into this branch locally and ran the checks on Linux (Steam Deck, SteamOS). - This PR's tests pass: `test_headless_renderer_cpus` passes, and fails on plain main ("the module saw the pinned thread's mask"); `test_display_startup_failure` passes 12 of 12. - `test_cursor_hidden_linux` fails there exactly as it does on plain main (`esc_had_capture` set but not used). #3121 fixes it. - **Farm errors:** main's `tools.lock` problem, reported before. I'll check again once main's CI has run.
Author
Member

Measured again on current main (main 6318f405 with this PR's changes, Steam Deck OLED, stock 15 W, Market child, steady state, 3 pairs, all admitted).

  • Result: fps +3.4 % (diagnostic), CPU ms −0.1 %: no cost.
  • Also: a headless start with no core reserved measured +4.1 % on main and −0.1 % with this PR, so that gain was this bug's.
  • The numbers are in the description's Measurements.
**Measured again on current main** (main 6318f405 with this PR's changes, Steam Deck OLED, stock 15 W, Market child, steady state, 3 pairs, all admitted). - **Result:** fps +3.4 % (diagnostic), CPU ms −0.1 %: no cost. - **Also:** a headless start with no core reserved measured +4.1 % on main and −0.1 % with this PR, so that gain was this bug's. - The numbers are in the description's Measurements.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012MibRabbL9JhKKrsNVaBfg
The headless start's own thread (mkw_vk_start) can start and end between two of HOS_SAMPLE_ALL's thread lists,
5 s apart, so its samples could be missing where the game's thread had them before (BeanBot L1). Once named, the
thread moves a generation on (hos_prof_relist, host/posix/prof.c); a sampler that has not listed since lists again
at its next 2 ms sweep.

tests: display_startup_failure_test.cpp requires the ask once, on the start's thread, after its name and before
the start (negative controls: the call dropped, the call before the name: both fail); test_headless_renderer_cpus
stubs it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012MibRabbL9JhKKrsNVaBfg
sol review of 207652d8: the generation was read before the sampler's wait (2 ms, or HOS_SLOW_FRAMES_EVERY_MS), so an
ask made during it was seen one sweep late, and a thread living less than two sweeps could be listed only after it
ended. The wait now comes first, then the list's check, then the sweep.

tests: test_slow_frames checks that order in host/posix/prof.c (negative control: 207652d8's prof.c fails it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012MibRabbL9JhKKrsNVaBfg
sol review of 067fb88f: the .go file was checked before the wait, so a sweep could follow its removal (and take a thread
named in the wait); and test_slow_frames' order check passed with only the generation's load moved above the wait. The
wait is now the loop's first step, then the .go file's check, the list's and the sweep; the check requires that order,
one wait and one read of the generation (negative controls: 207652d8's and 067fb88f's samplers, and the load above
the wait with its compare below, each fail it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012MibRabbL9JhKKrsNVaBfg
sol review of c60a5f82: with hos_prof_relist made an empty call every test still passed. The check requires its one
atomic step of relist_gen (negative control: an empty hos_prof_relist fails it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012MibRabbL9JhKKrsNVaBfg
test(host): test_slow_frames runs hos_prof_relist as cut from prof.c, and allows one .go check
Some checks reported errors
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Successful in 13s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 17s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 13m38s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m19s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 11m6s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 13m35s
CI / Website build and checks (pull_request) Failing after 41s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 49m14s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1h0m4s
PR description / Title and description (pull_request_target) Waiting to run
beanstalk/approval approved by klimovich008 (reviewed)
beanstalk/linux+nvidia 0/1 pass, 2 error
9c71d05a41
sol review of bbe4e625: the text match passed with the old definition kept under #if 0 and an empty one active, and
the order check with a second .go check before the wait. hos_prof_relist is now compiled from its cut and must move
the generation by one a call; the sampler has one .go check (negative controls, each failing: the #if 0 copy, an
empty function, a step of 2, an early .go check).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012MibRabbL9JhKKrsNVaBfg
Author
Member

L1 (the all-thread sampler and the start's short thread): fixed, head 9c71d05a (main f8b54338 merged in first, da3bb0a7: display_sdl.c and the fixtures merged clean).

  • host/posix/prof.c: hos_prof_relist() moves a generation on. The start's thread calls it right after naming itself mkw_vk_start. sample_all_thread (HOS_SAMPLE_ALL, and HOS_SLOW_FRAMES's ring) lists the threads again at its next sweep when the generation moved, besides every 5 s.
  • The sampler's wait is now the first step of its loop, then the .go check, the list's check and the sweep. So an ask made during the wait reaches the very next sweep (2 ms; HOS_SLOW_FRAMES_EVERY_MS in the ring), and no sweep follows a .go file taken away in the wait.
  • Tests, each with negative controls:
    • display_startup_failure_test.cpp requires the ask once, on the start's thread, after its name and before rx_start.
    • test_slow_frames.py checks the sampler's order, and compiles and runs hos_prof_relist from its cut.
    • The description's Testing lists the controls.
  • gpt-6.2-sol: five rounds, each finding fixed in its own commit; the last found none.
  • A listed thread is still sampled only when it runs at its turn in a sweep, as any thread. A start of a few milliseconds can give no sample; the Deck's start is much longer.

L3 (Auto's thread choice with mirrored pools on RADV, 4 cores / 8 threads): the Steam Deck is that system once RX_VK_MIRROR=1 gives it mirrored pools. Queued there, with the results to follow here:

  • main f8b54338 and this head, headless, Threaded rendering left to Auto;
  • one long Market run each: the CPU and Auto lines, and any GPU ring timeout or reset (#2446);
  • one HOS_SAMPLE_ALL start of this head, to see mkw_vk_start in the samples (L1 in the game).

L4 (NVIDIA's Linux driver): no NVIDIA Linux machine here, so I'm asking the farm below.

@Beanstalk on an NVIDIA GPU with the Linux driver (any Linux PC of the farm with one): a headless start (HOS_HEADLESS=1) of main and of this head, each in the game for a few minutes (the Market or Hyrule Field). Report from each log the CPUs N (M usable, K cores) line, the Threaded rendering: Auto: ... line, whether it rendered (fps lines, no device lost), and the run's end. Uncapped (frame_rate_cap = 6, vsync = 2, frame_generation = 0). One run a side is enough; this is a startup and driver check, not a measurement.

🤖 Generated with Claude Code

**L1** (the all-thread sampler and the start's short thread): fixed, head 9c71d05a (main f8b54338 merged in first, da3bb0a7: `display_sdl.c` and the fixtures merged clean). - `host/posix/prof.c`: `hos_prof_relist()` moves a generation on. The start's thread calls it right after naming itself `mkw_vk_start`. `sample_all_thread` (`HOS_SAMPLE_ALL`, and `HOS_SLOW_FRAMES`'s ring) lists the threads again at its next sweep when the generation moved, besides every 5 s. - The sampler's wait is now the first step of its loop, then the `.go` check, the list's check and the sweep. So an ask made during the wait reaches the very next sweep (2 ms; `HOS_SLOW_FRAMES_EVERY_MS` in the ring), and no sweep follows a `.go` file taken away in the wait. - Tests, each with negative controls: - `display_startup_failure_test.cpp` requires the ask once, on the start's thread, after its name and before `rx_start`. - `test_slow_frames.py` checks the sampler's order, and compiles and runs `hos_prof_relist` from its cut. - The description's Testing lists the controls. - gpt-6.2-sol: five rounds, each finding fixed in its own commit; the last found none. - A listed thread is still sampled only when it runs at its turn in a sweep, as any thread. A start of a few milliseconds can give no sample; the Deck's start is much longer. **L3** (Auto's thread choice with mirrored pools on RADV, 4 cores / 8 threads): the Steam Deck is that system once `RX_VK_MIRROR=1` gives it mirrored pools. Queued there, with the results to follow here: - main f8b54338 and this head, headless, Threaded rendering left to Auto; - one long Market run each: the CPU and Auto lines, and any GPU ring timeout or reset (#2446); - one `HOS_SAMPLE_ALL` start of this head, to see `mkw_vk_start` in the samples (L1 in the game). **L4** (NVIDIA's Linux driver): no NVIDIA Linux machine here, so I'm asking the farm below. @Beanstalk on an NVIDIA GPU with the Linux driver (any Linux PC of the farm with one): a headless start (`HOS_HEADLESS=1`) of main and of this head, each in the game for a few minutes (the Market or Hyrule Field). Report from each log the `CPUs N (M usable, K cores)` line, the `Threaded rendering: Auto: ...` line, whether it rendered (fps lines, no device lost), and the run's end. Uncapped (`frame_rate_cap = 6`, `vsync = 2`, `frame_generation = 0`). One run a side is enough; this is a startup and driver check, not a measurement. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Member

Beanstalk test farm · ⚠️ couldn't be judged on linux+nvidia

Commit 9c71d05 · approved by klimovich008 (reviewed) · dashboard

⚠️ Note: The draws probe reports rendering FPS rather than checking for FPS log lines; the logs retain the CPU and Auto lines for both sides.
⚠️ Note: This run does not independently verify the process affinity mask or exercise the all-thread sampler.

Done (started 01:35 UTC). Comment @Beanstalk to run it again.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
linux+nvidia ⚠️ couldn't be judged 0 of 1 — — —
What was tested

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

Run main and the PR headlessly on a Linux NVIDIA PC for three minutes each in the Market, with the frame cap and V-Sync off. Record the CPU-count and threaded-rendering Auto log lines, rendering FPS, and each run’s outcome. The PR fails if it crashes, reports device loss, omits either startup line, or produces no measurable rendering. No tester online now matches linux+nvidia: that target waits for one.

  • Where: linux+nvidia (1-2 reports).
  • headless-market: from the repository's save market-entrance (settings vsync=2, frame_rate_cap=6, frame_generation=0), then measure market for 3 min (after 10 s warm-up); 1 run on each side.
  • Measured: crashes, draws and frame rate, the game's log.
  • The PR fails if: it crashes; or frame rate is below 0.01; or forbidden log lines is above 0; or expected log lines missing is above 0.
  • Time: about 17 min of game runs per tester (2 game starts), plus the two builds.
<!-- beanstalk:sticky --> ### Beanstalk test farm · ⚠️ couldn't be judged on linux+nvidia Commit `9c71d05` · approved by klimovich008 (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/2784) ⚠️ **Note:** The draws probe reports rendering FPS rather than checking for FPS log lines; the logs retain the CPU and Auto lines for both sides. ⚠️ **Note:** This run does not independently verify the process affinity mask or exercise the all-thread sampler. Done (started 01:35 UTC). Comment `@Beanstalk` to run it again. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `linux+nvidia` | ⚠️ couldn't be judged | 0 of 1 | — | — | — | <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) Run main and the PR headlessly on a Linux NVIDIA PC for three minutes each in the Market, with the frame cap and V-Sync off. Record the CPU-count and threaded-rendering Auto log lines, rendering FPS, and each run’s outcome. The PR fails if it crashes, reports device loss, omits either startup line, or produces no measurable rendering. No tester online now matches linux+nvidia: that target waits for one. - **Where:** linux+nvidia (1-2 reports). - **headless-market:** from the repository's save `market-entrance` (settings vsync=2, frame_rate_cap=6, frame_generation=0), then measure market for 3 min (after 10 s warm-up); 1 run on each side. - **Measured:** crashes, draws and frame rate, the game's log. - **The PR fails if:** it crashes; or frame rate is below 0.01; or forbidden log lines is above 0; or expected log lines missing is above 0. - **Time:** about 17 min of game runs per tester (2 game starts), plus the two builds. </details>
Author
Member

L3 and L1 have run on the Steam Deck (OLED, SteamOS 3.9.5, Mesa 26.2.0-devel RADV, 4 cores / 8 threads, AC power, stock 15 W): this head 9c71d05a against main f8b54338, each built from source there, headless, Market as a child. Both are now in Tested; L4 is queued on the Test Farm.

L3, mirrored pools (RX_VK_MIRROR=1), Threaded rendering left to Auto, one long run each (--lead 600):

main f8b54338 this head
CPU line CPUs 8 (6 usable, 3 cores) CPUs 8 (8 usable, 4 cores)
Auto off (3 cores of 6 logical processors) on, the render thread and the recorder thread (4 cores of 8 logical processors)
GPU ring timeouts, resets, device loss (game log; kernel's amdgpu lines) none none
frames over 100 ms in the window 0 0

The fps (38.38 and 41.53) are one run each with a different thread choice, so they are not a measurement of this PR.

L1, one start of this head with HOS_SAMPLE_ALL from the boot: 19,487 of 734,776 sample lines are mkw_vk_start's, from the sampler's first sweep (0 ms) on, inside longshot_vk.so's load. The sampler began with 2 threads listed, so the renderer's start is now sampled after its relist.

L3 and L1 have run on the Steam Deck (OLED, SteamOS 3.9.5, Mesa 26.2.0-devel RADV, 4 cores / 8 threads, AC power, stock 15 W): this head 9c71d05a against main f8b54338, each built from source there, headless, Market as a child. Both are now in Tested; L4 is queued on the Test Farm. **L3**, mirrored pools (`RX_VK_MIRROR=1`), Threaded rendering left to Auto, one long run each (`--lead 600`): | | main f8b54338 | this head | |---|---|---| | CPU line | `CPUs 8 (6 usable, 3 cores)` | `CPUs 8 (8 usable, 4 cores)` | | Auto | off (3 cores of 6 logical processors) | on, the render thread and the recorder thread (4 cores of 8 logical processors) | | GPU ring timeouts, resets, device loss (game log; kernel's amdgpu lines) | none | none | | frames over 100 ms in the window | 0 | 0 | The fps (38.38 and 41.53) are one run each with a different thread choice, so they are not a measurement of this PR. **L1**, one start of this head with `HOS_SAMPLE_ALL` from the boot: 19,487 of 734,776 sample lines are `mkw_vk_start`'s, from the sampler's first sweep (0 ms) on, inside `longshot_vk.so`'s load. The sampler began with 2 threads listed, so the renderer's start is now sampled after its relist.
Owner
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The headless affinity fix and sampler relist are demonstrated on the Steam Deck, including the changed Auto selection with mirrored pools. The requested NVIDIA Linux driver run is still pending. Recommend approval; not approved on the forge.

Linux headless starts load the renderer with the process affinity used by windowed starts, making their renderer configuration comparable. The sampler now refreshes its thread list for the short-lived startup thread; headless runs may consequently use different worker counts or rendering threads than before.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L4 host/posix/display_sdl.c:376: Exercise the changed headless startup with the NVIDIA Linux driver as well. When: The new thread initializes the real Vulkan renderer and its workers on a different affinity mask, but the reported checks use a stand-in module and do not exercise this driver. Do: Run a headless game start on an NVIDIA Linux system and check startup, rendering, CPU count and Auto thread selection.

Since the last review (on d9876f0fc9)
Resolved: L1 (Moving startup to a short-lived thread can make the all-thread sampler miss renderer start…); L3 (Check the changed Auto thread selection on a RADV system with mirrored pools.)
Still open: L4 (Exercise the changed headless startup with the NVIDIA Linux driver as well.)

Checks: Failing on this head, which is behind its base, where they pass: CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request), CI / Host C for Windows (llvm-mingw, compile only) (pull_request), CI / Website build and checks (pull_request), CI / Game-free checks (run_all.py, part 2/2) (pull_request), CI / Game-free checks (run_all.py, part 1/2) (pull_request). @rebase (or @fix) brings it up to date and runs them again; not held against it.

Also noticed (2; not asked for, not blocking)
  • The ready-to-merge checklist says everything in Still to test has run, although the NVIDIA Linux run is still queued.
  • The CI summary says several checks need rerunning after the branch is brought up to date.
More: does it help, other systems, switches, what was read

Does it help: Yes. On the Steam Deck, nine starts reported 8 usable logical processors and 4 cores on the PR versus 6 and 3 on main. The reported performance comparisons show no established speed gain, which is not the goal of the fix.

Other systems: Windowed starts and Windows are unchanged. RADV was exercised on the Deck with mirrored pools and Auto selecting both threads, without a reported hang or reset; NVIDIA Linux remains untested. The relist also affects the Linux slow-frame sampler.

Switches: None added, changed or removed.

Reviewed: 9c71d05a41 against f8b543384d: Read the repository rules, the startup and sampler changes, and the associated test changes; the full combined output for the changed files and diff was truncated, so portions were only skimmed. Reviewed the supplied comments, test reports and CI summary.; nothing run (a code review).

Checked and fine:

  • The relist request follows thread naming and precedes renderer startup.
  • The sampler checks the generation after its wait in both normal and slow-frame modes.
  • The reported affinity test includes a negative control using the old startup path.

Testing: No commands that build or run project code were executed. The supplied reports describe passing game-free checks and Deck game runs; the NVIDIA Linux run is pending.

Overlaps and merge order: None found in the supplied review context.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The headless affinity fix and sampler relist are demonstrated on the Steam Deck, including the changed Auto selection with mirrored pools. The requested NVIDIA Linux driver run is still pending. Recommend approval; not approved on the forge. Linux headless starts load the renderer with the process affinity used by windowed starts, making their renderer configuration comparable. The sampler now refreshes its thread list for the short-lived startup thread; headless runs may consequently use different worker counts or rendering threads than before. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4** `host/posix/display_sdl.c:376`: Exercise the changed headless startup with the NVIDIA Linux driver as well. *When:* The new thread initializes the real Vulkan renderer and its workers on a different affinity mask, but the reported checks use a stand-in module and do not exercise this driver. **Do:** Run a headless game start on an NVIDIA Linux system and check startup, rendering, CPU count and Auto thread selection. **Since the last review** (on d9876f0fc9bf) Resolved: L1 (Moving startup to a short-lived thread can make the all-thread sampler miss renderer start…); L3 (Check the changed Auto thread selection on a RADV system with mirrored pools.) Still open: L4 (Exercise the changed headless startup with the NVIDIA Linux driver as well.) **Checks:** Failing on this head, which is behind its base, where they pass: `CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)`, `CI / Host C for Windows (llvm-mingw, compile only) (pull_request)`, `CI / Website build and checks (pull_request)`, `CI / Game-free checks (run_all.py, part 2/2) (pull_request)`, `CI / Game-free checks (run_all.py, part 1/2) (pull_request)`. `@rebase` (or `@fix`) brings it up to date and runs them again; not held against it. <details> <summary>Also noticed (2; not asked for, not blocking)</summary> - The ready-to-merge checklist says everything in Still to test has run, although the NVIDIA Linux run is still queued. - The CI summary says several checks need rerunning after the branch is brought up to date. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. On the Steam Deck, nine starts reported 8 usable logical processors and 4 cores on the PR versus 6 and 3 on main. The reported performance comparisons show no established speed gain, which is not the goal of the fix. **Other systems:** Windowed starts and Windows are unchanged. RADV was exercised on the Deck with mirrored pools and Auto selecting both threads, without a reported hang or reset; NVIDIA Linux remains untested. The relist also affects the Linux slow-frame sampler. **Switches:** None added, changed or removed. **Reviewed:** 9c71d05a41ab against f8b543384dd0: Read the repository rules, the startup and sampler changes, and the associated test changes; the full combined output for the changed files and diff was truncated, so portions were only skimmed. Reviewed the supplied comments, test reports and CI summary.; nothing run (a code review). **Checked and fine:** - The relist request follows thread naming and precedes renderer startup. - The sampler checks the generation after its wait in both normal and slow-frame modes. - The reported affinity test includes a negative control using the old startup path. **Testing:** No commands that build or run project code were executed. The supplied reports describe passing game-free checks and Deck game runs; the NVIDIA Linux run is pending. **Overlaps and merge order:** None found in the supplied review context. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
HumanBean changed title from WIP: fix(linux): a start with no window loads the renderer with the process's affinity, as a windowed start does to fix(linux): a start with no window loads the renderer with the process's affinity, as a windowed start does 2026-12-05 20:25:14 +00:00
HumanBean deleted branch perf/linux-core-count 2026-12-05 20:25:29 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 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!2784
No description provided.