WIP: feat(proc): the renderer and the sound out of the game's process, on by default (phases 0 to 7; Linux and Windows) #3116
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3116
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:feat/renderer-split-phase0-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Defaults are the final state for testers: the split ON on Linux and Windows (
LONGSHOT_RENDER_PROCESS=0turns it off; any failure before the game starts falls back in-process with the reason logged); the builder plays the game's sound (LONGSHOT_AUDIO_BROKER=0turns that off), so with the game's sandbox on (HOS_SANDBOX=1; off by default since #3132) it has no sound devices or servers; the headset's OpenXR runtime goes to the renderer's box (on Windows a headset run keeps the renderer at medium integrity, as SteamVR/Oculus/WMR need).The renderer (
gpu/vk,longshot_vk) in a process of its own, phases 0 to 7 in one pull request (#3176 folded in). By default, on Linux and Windows, the builder starts the renderer as its own sandboxed process, the window and input move into it, and the game's own sandbox loses the GPU, the display, the shader caches and the add-ons. On by default on Linux and Windows;LONGSHOT_RENDER_PROCESS=0turns it off. With it off, players get the in-process hardening and fixes below.firstinNOP_VIEWPORTS/NOP_BIND_VBUFwrote before the renderer's arrays; a handle count over 32 read past the record; a zero op size never ended a walk), the interface closed (MKWVK_API_VERSION96 on today's main), the render arena (gpu/render/render_arena.h),gpu/vk/rp_calls.defheld tovk_api.h.gpu/proc/rp_transport.c, twin threads, nesting, death detection, hostile-input checks, Linux and Windows.renderer-role(Landlock + seccomp profile of its own, no player files, no network), the import self-test before the game starts (fallback in-process before the game, never after), a two-child supervisor, the renderer's crash record and crash window,longshot_render.soin the build, fonts handed to the renderer by the builder (never from the game).scripts/gen_rp_calls.pygenerates both proxies fromgpu/vk/rp_calls.def, every argument checked on arrival; one-way batches, published values, the GPU lookups andnvn_invalidate_quickanswered in the game.Profile::GameSplitnarrows the game's Landlock profile.longshot_render.dll.gpu/vk/record_bounds.h);draw_meshindex wrap (out-of-bounds read), a texture size that looped over 128 M pages, a rectangle check overflow;tests/test_fuzz_checks.py,tests/test_shader_fuzz.py), which found translator bugs fixed here: a local-memory size wrapping an array to length 0, 64 KB of shared memory taking a constant buffer's ArrayStride (invalid without an extension: AMD and Intel allow 64 KB), wrong barrier scope outside compute, missing 1D declarations, zero-vertex mesh programs.Read first:
gpu/proc/rp_role.h,builder/crates/build-core/src/render_proc.rs,gpu/proc/rp_custom.c,host/rp_game.c,gpu/vk/record_bounds.h,docs/dev/reference/sandbox.md.Testing
Tested: Linux (CachyOS, kernel 7.3), RTX 3090, NVIDIA driver 0x9b118180, headless through the queue:
dev.py smoke, the split on): the renderer in its own process, play reached from kokiri-start, 1,500 frames, the Insert menu opened, 3 of the game's fonts given to the UI, the renderer ends cleanly with the game;17054a6a), played by hand: it generally worked as in-process;d7465ba0with this PR's defaults (split on, the builder playing the sound, the game's sound closed: "sandbox: sound closed: the builder plays it"), played and listened to by hand: no issues;f359e262(after #3132 made the game's sandbox off by default), at8c79d1e9, windowed smoke runs: the defaults (split on, the builder playing the sound, sandbox off as main has it) PASS; withHOS_SANDBOX=1PASS, "sandbox: sound closed: the builder plays it";--window): PASS, the window in the renderer's process;c52a7778: the split's smoke run PASS ("the import self-test passed on AMD Radeon RX 580 Series (RADV POLARIS10): dma-bufs (udmabuf)", the renderer in its own process, no fallback, no crash, 3 of the game's menu fonts given), and the in-process smoke run PASS;hos_key_asynccalling itself on Linux,c52a7778) fixed, withtests/test_key_async_posix.py.Game-free: test_rp_marshal (75 checks, ASan, llvm-mingw), test_rp_sides_link, test_rp_input, test_rp_calls, test_rp_transport (172, Wine), test_render_arena, test_stream_bounds, test_record_bounds, test_record_pointers, test_registration_host_copies, test_invalidate_quick, test_rp_font_pack, test_fuzz_checks, test_shader_fuzz, test_core_filter, test_sandbox_linux, test_sandbox_profile, test_switch_table, test_translator_stamp_inputs, test_drawn_page_map, test_doc_anchors; cargo build-core (229), build-compile, synthetic-game render_process (50 runs in a row), crash; check_host_compile Linux. Windows: the role chain end to end under Wine.
Still to test:
Measurements
Final defaults against main, after the answer-spin fix (
0f4db10c: no futex wake when the peer is awake; the game's thread spins up to 300 µs for an answer when the twins spin; RTX 3090, Wayland, windowed, Market, 3 timed runs each): main 123.7 / 125.0 / 127.6 fps (median 7.93 / 7.89 / 7.72 ms), this PR 122.6 / 126.8 / 125.1 fps (median 8.01 / 7.76 / 7.86 ms): 0.4% apart, within run-to-run noise; 1% low 90.4 / 97.6 / 104.6 vs 97.2 / 105.4 / 103.1, p99 11.07 / 10.25 / 9.56 vs 10.28 / 9.49 / 9.70 ms.Before that fix (
d7465ba0), on a quieter run, the PR was 1.6% behind: (d7465ba0: split on, the builder playing the sound; RTX 3090, Wayland, windowed, Market, 3 timed runs each, quiet PC): main 127.3 / 127.0 / 128.6 fps (1% low 104.4 / 105.4 / 104.9), this PR 126.8 / 124.7 / 125.2 fps (1% low 102.7 / 100.8 / 104.3): 1.6% behind main on fps, 1.6% on 1% lows, p99 9.5-9.9 ms on both. The audio broker alone, same build, off vs on: 125.8 / 125.5 vs 125.0 / 125.1 fps (noise).Verdict: with this PR's defaults (the split on, the builder playing the sound), the same as main in the Market on this PC (0.4% apart, within the spread); with the split off, no change against main.
Split on against off, the same runtime (Market, windowed, 1080p uncapped, Render resolution 67 %;
dev.py ab --env LONGSHOT_RENDER_PROCESS=1 --scene market --runs 2), at17054a6a:Baseline: the split's own cost, the same runtime with the split off and on (main against this PR's defaults is the table above).
17054a6a, split off17054a6a, split onHow it got there (same scene, split on): about 600 round trips a frame at first; then values published in shared memory, one-way bookkeeping,
nvn_invalidate_quickand the slow invalidate answered in the game where the renderer has nothing to do (render thread included), the fence table in place, the game's write marks shared (aligned at build-compile, no re-lift), and the renderer's twin threads spinning while their slot is hot (LONGSHOT_RP_HOT_SPIN: on with 8 or more logical CPUs left to the renderer, off below, where any spin measured worse). About 24 crossings a frame remain (slow invalidates the renderer must act on, submits whose capture is taken at the call, presents, waits not met).Switch off, against main (windowed, Market,
dev.py ab --scene market --runs 2), at17054a6a:a98cf28a17054a6a(
dev.py abwrote no write-up only because the builder's crash-block descriptor number differs between runs, 10 and 11.)Risks
LONGSHOT_RENDER_PROCESS=0): the hardening and the translator fixes change what the renderer refuses and some compiled shaders (refused programs are logged); the shader stamp moves, so caches are rebuilt once.LONGSHOT_RENDER_PROCESS=0(the split),LONGSHOT_AUDIO_BROKER=0(the game opens its own sound). A revert is enough; nothing persists.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (Touched checks pass run directly; the whole suite in CI.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.gpu/vk/switches.def.tests/that reads changed source is updated, not weakened.MKWVK_API_VERSIONbumped (MkwVkHostorMkwVkRendereringpu/vk/vk_api.hchanged).8c79d1e9: Linux 89 units, llvm-mingw 86, 0 failed; the renderer's .so and .dll link.)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8e45R4CfYVK3VeGVd2h
gpu/proc/rp_shared.h (the control arena's layout and its hash), gpu/proc/rp_transport.{h,c}: slots, twin threads with nesting, futex/event wake-ups, peer death and clean shutdown, hostile-peer checks (copy, check, use), with a per-op check hook for the checks rp_calls.def will generate. tests/test_rp_transport.py drives tests/rp_transport_test.c: two processes, gcc and clang, ASan fuzzer, llvm-mingw under Wine. Co-Authored-By: Claude Opus 5.5 <[email protected]>Tested in game: Linux (CachyOS, kernel 7.3), RTX 3090, NVIDIA driver 0x9b118180: four timed runs in the Market via dev.py ab (main, this PR, main, this PR), each a start, teleport and 60 s of play-in-place; frame rates the same as main within the spread, no recording or descriptor refused, the same memory import, no new errors in the logs.
Possibly related, for context:
@Beanstalk
Beanstalk test farm · an earlier run: commit
b94770d(the newer results are in a comment below)Commit
b94770d· approved by HumanBean (reviewed) · dashboard⚠️ Note: Gameplay cannot inject hostile recordings or exercise the unwired process transport, so it cannot establish their safety properties.
⚠️ Note: The Linux RADV target does not guarantee an RX 580 or udmabuf import; the farm cannot force that import path.
Started at 21:03 UTC.
windows+nvidiawindows+amdlinux+nvidialinux+radvinteligpuCouldn't be judged: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own.
windows+nvidia, report 1:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'swindows+nvidia, report 2:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'swindows+amd, report 1:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'swindows+amd, report 2:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'slinux+nvidia, report 1:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'slinux+radv, report 1:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'slinux+radv, report 2:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'sintel, report 1:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'sWhat was tested
What will be tested · AI plan (
gpt-6.1-terra)The farm will compare main and the PR on Windows and Linux across the named GPU families, with additional Intel and integrated-GPU coverage. Three starts per side will capture still images and measure uncapped frame times for 60 seconds each in the Market and Hyrule Field, with build timing measured separately. Crashes, refused recordings, substantial picture differences, or regressions beyond the plan’s frame-time and memory limits will fail the PR.
market-entrance(settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0; switchesHOS_OUTPUT_RES=1280x720,RX_VK_AUTO_TUNE=0), then teleport to Market, take the picture market to compare with main, measure market for 60 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field to compare with main, measure field for 60 s (after 10 s warm-up); 3 runs on each side.Measurements on `windows+nvidia`, for the PR description
Verdict: could not be judged on windows+nvidia (2 reports).
Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess
NVIDIA GeForce RTX 4090, 621.40.013th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu+window+xessNVIDIA GeForce GTX 980, 582.78.0Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz, 32 GB RAMScene: renderer-gameplay, 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); renderer-gameplay: 3 game starts a side, market 60 s after 10 s warm-up, field 60 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))
a98cf28b94770dFlags and settings
None: the plan varied no setting, switch or build option.
As Markdown for the PR description:
Measurements on `windows+amd`, for the PR description
Verdict: could not be judged on windows+amd (2 reports).
Hardware: 1: windows+amd+amd-proprietary+igpu+window+xess
AMD Radeon(TM) Graphics, 2.0.279AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM; 2: windows+amd+amd-proprietary+dgpu+window+fsr4+xessAMD Radeon RX 9060 XT, 2.0.416AMD Ryzen 5 5600 6-Core Processor, 32 GB RAMScene: renderer-gameplay, 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); renderer-gameplay: 3 game starts a side, market 60 s after 10 s warm-up, field 60 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))
a98cf28b94770dFlags and settings
None: the plan varied no setting, switch or build option.
As Markdown for the PR description:
Measurements on `linux+nvidia`, for the PR description
Verdict: queued on linux+nvidia (1 report).
Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu
NVIDIA GeForce RTX 5070, 620.73.4AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMScene: renderer-gameplay, 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); renderer-gameplay: 3 game starts a side, market 60 s after 10 s warm-up, field 60 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))
a98cf28b94770dFlags and settings
None: the plan varied no setting, switch or build option.
As Markdown for the PR description:
Measurements on `linux+radv`, for the PR description
Verdict: could not be judged on linux+radv (2 reports).
Hardware: 1: linux+amd+radv+igpu
AMD Radeon 760M Graphics (RADV PHOENIX), 26.0.8AMD Ryzen 5 230 w/ Radeon 760M Graphics, 16 GB RAM; 2: linux+amd+radv+dgpuAMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAMScene: renderer-gameplay, 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); renderer-gameplay: 3 game starts a side, market 60 s after 10 s warm-up, field 60 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))
a98cf28b94770dFlags and settings
None: the plan varied no setting, switch or build option.
As Markdown for the PR description:
Measurements on `intel`, for the PR description
Verdict: could not be judged on intel (2 reports).
Hardware: 1: linux+intel+anv+igpu
Intel(R) Graphics (RKL GT1), 26.2.411th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM; 2: windows+intel+intel-proprietary+igpu+windowIntel(R) UHD Graphics 630, 0.404.2115Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAMScene: renderer-gameplay, 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); renderer-gameplay: 3 game starts a side, market 60 s after 10 s warm-up, field 60 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))
a98cf28b94770dFlags and settings
None: the plan varied no setting, switch or build option.
As Markdown for the PR description:
Measurements on `igpu`, for the PR description
Verdict: could not be judged on igpu (2 reports).
Hardware: 1: linux+intel+anv+igpu
Intel(R) Graphics (RKL GT1), 26.2.411th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM; 2: linux+amd+radv+igpuAMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAMScene: renderer-gameplay, 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); renderer-gameplay: 3 game starts a side, market 60 s after 10 s warm-up, field 60 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))
a98cf28b94770dFlags and settings
None: the plan varied no setting, switch or build option.
As Markdown for the PR description:
The testers' hardware
windows+nvidiaNVIDIA GeForce RTX 4090, 621.40.013th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAMwindows+nvidiaNVIDIA GeForce GTX 980, 582.78.0Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz, 32 GB RAMwindows+amdAMD Radeon(TM) Graphics, 2.0.279AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAMwindows+amdAMD Radeon RX 9060 XT, 2.0.416AMD Ryzen 5 5600 6-Core Processor, 32 GB RAMlinux+nvidiaNVIDIA GeForce RTX 5070, 620.73.4AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMlinux+radvAMD Radeon 760M Graphics (RADV PHOENIX), 26.0.8AMD Ryzen 5 230 w/ Radeon 760M Graphics, 16 GB RAMlinux+radvAMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAMintelIntel(R) Graphics (RKL GT1), 26.2.411th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAMintelIntel(R) UHD Graphics 630, 0.404.2115Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAMigpuIntel(R) Graphics (RKL GT1), 26.2.411th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAMigpuAMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAMBeanstalk test farm
Commit
8c79d1e· approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.1575479dd10b77577081scripts/gen_rp_calls.py writes gpu/proc/rp_calls_gen.{h,c} from gpu/vk/rp_calls.def (checked in; tests/test_rp_marshal.py fails when they are not current): the game's proxy MkwVkRenderer and the renderer's proxy MkwVkHost, each member written into the transport and its answer read back; the ops each side serves, whose decoder is also the transport's per-op check (copy, then check, then use; every length bounded); the blobs for the game side's lists (UI frames, world layer models and draws, effects, program hooks, settings rows, texture replacements, renderer actions), packed in one canonical order and rebuilt with every region checked to be the next and every count bounded; RP_CALLS_HASH, so two builds whose calls differ refuse each other. rp_calls.def gets a crossing column (T, S, L, I, R: the plan's 4.1 and 4.2 'First') and its blocking and thread columns corrected. Pointers into the guest window or the render arena pass as their address and are range-checked where they arrive; anything else is copied. Payloads past a slot's 64 KB go in pieces (gpu/proc/rp_marshal.c). The S counters (fence, replayed, the maps generation) live in the control arena's state page; nvn_wait is answered from replayed when it can be. gpu/proc/rp_custom.c writes by hand what no shape says: function pointers as tickets (shot's done, the trial's apply, nested on the caller), texels, page lists, RomFS files, pack pictures, translations by identity, and the R members (GPU address lookups over the render arena, the clocks). The game (host/rp_game.c): reserve_guest and the render arena map the builder's memfds when given; rx_start takes the split's renderer when the control arena is in the environment and the run is headless, else loads longshot_vk here as before. The renderer (gpu/proc/rp_stub.c): rp_render_serve, rp_role.h's contract, loads longshot_vk and runs mkwvk_init with the proxy host when the game asks. Tests: tests/test_rp_marshal.py runs a game and a renderer process over one control arena with the real generated proxies, a fake renderer and a fake host: every generated call and callback round-trips (a conformance suite written from the generator's shapes), nested and from a renderer thread; the hand-written members; the blobs; hostile payloads refused. gcc, clang, ASan and UBSan; the Windows build compiled with llvm-mingw. Co-Authored-By: Claude Opus 5.5 <[email protected]>The waiter drains the channel after the renderer's end, looking for a death notice. During the handshake it raced the handshake for the same channel: it took a refusal the handshake was waiting for, and the handshake then read the channel as closed. a_refusal_a_death_or_silence_before_ready_falls_back failed in about 1 of 20 to 50 runs, on selftest:refuse ("closed its channel before ready") and once on start:crash ("did not answer ready"). Watch.talking is set until the handshake ends; the waiter drains only after it (the handshake handles a death notice itself). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8e45R4CfYVK3VeGVd2hWIP: feat(vk): the renderer process split, phases 0 and 1: the op stream checked, the interface closed, the render arena, the transportto WIP: feat(proc): the renderer in a process of its own (phases 0 to 7; Linux, Windows unverified; off by default)Now holds everything: #3176 (phases 2 to 7) is folded into this branch, at
17054a6a. Description updated with both.@review
Recommendation: Request changes. The description gives contradictory instructions for disabling the default-on renderer split, and the new sound-broker switch is missing from the required switch table. The default-on paths also need the hardware runs already identified by the author; this review is incomplete because most of the 198 changed files were not read in full.
The change moves rendering and, by default, audio into separate processes, narrows the game sandbox, and adds renderer validation and shader fixes. It adds substantial platform, transport, and synchronization code whose compatibility and performance costs are not yet established across supported systems.
Blocking (1): must change before merging.
@fixor@rebasetry first). (for the author)Should fix (2): not blocking, but worth doing before merging.
gpu/vk/switches.def: The new LONGSHOT_AUDIO_BROKER switch has no row in the required switch table. When: The builder reads LONGSHOT_AUDIO_BROKER and defaults the broker on, but the switch is absent from switches.def, so the project's switch inventory does not describe its default or kill switch. Do: Add a sorted row describing the default and the effect of setting it to 0.tests/test_key_async_posix.py:39: Running this regression test directly ignores CC and requires a command named gcc. (more on the line) Do: Choose the default from CC using the repository's compiler helper, while retaining --cc as an override.Nits (1): optional.
Testing before merging (3) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1, L2 and L3.Questions (1) (not confirmed from the code; they don't hold the recommendation)
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven across supported systems. On the author's RTX 3090 Linux setup, three Market runs measured main at 123.7–127.6 fps and this PR at 122.6–126.8 fps, within run-to-run noise. The Linux AMD smoke test passed, but Windows, Intel, headsets, and lower-core systems remain untested as described in the PR.
Other systems: The split changes windowing, input, GPU memory imports, overlays, audio, and headset runtime placement on both Windows and Linux. The supplied evidence covers visible Linux NVIDIA play and a Linux AMD smoke test; it does not establish behavior for the other systems listed in Still to test.
Switches: LONGSHOT_RENDER_PROCESS defaults on; LONGSHOT_AUDIO_BROKER defaults on; LONGSHOT_RP_HOT_SPIN defaults to 1000 µs when at least eight logical CPUs remain and otherwise 0. The change also adds LONGSHOT_RP_ARENA, CHANNEL, CONTROL, GUEST, IMPORT, LIB, PEER and WAKE diagnostic variables, and LONGSHOT_QUEUE_PRIO defaults to normal. The defaults need the outstanding platform testing. LONGSHOT_AUDIO_BROKER has no switches.def row.
Reviewed:
0f4db10cbfagainsta98cf28a27: Read AGENTS.md, CONTRIBUTING.md, the pull request template, gpu/proc/rp_role.h, gpu/vk/record_bounds.h, gpu/vk/stream_check.h, gpu/render/render_arena.h, gpu/render/render_arena_lookup.h, host/render_arena.c, tests/test_key_async_posix.py and tests/test_fuzz_checks.py in full. Skimmed the diff statistics, portions of the commit log, switches, replay, builder references and test scripts. Most changed files, generated code, translations, and recorded runs were not read in full; a complete first review is still needed.; nothing run (a code review).Checked and fine:
Testing: No code, tests, builds or project scripts were run. All CI checks were still running in the supplied status.
Overlaps and merge order: The description says #3176 was folded into this branch; other overlapping pull requests could not be checked with the network closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -0,0 +36,4 @@def main():p = argparse.ArgumentParser(description=__doc__)p.add_argument("--cc", default="gcc")L3 (should fix): Running this regression test directly ignores CC and requires a command named gcc.
When: On a Linux development machine with only Clang, or with CC set to a different compiler, the documented direct invocation attempts to execute gcc instead of the selected compiler.
Do: Choose the default from CC using the repository's compiler helper, while retaining --cc as an override.
WIP: feat(proc): the renderer in a process of its own (phases 0 to 7; Linux, Windows unverified; off by default)to WIP: feat(proc): the renderer and the sound out of the game's process, on by default (phases 0 to 7; Linux and Windows)0f4db10cbf8c79d1e9ac@review
Recommendation: Approve. The code is ready: only testing is left. The renderer and audio split works in the reported Linux runs, but its default-on Windows path, lower-core Linux performance, Intel compatibility and headset placement still need the requested runs. Forgejo also reports the pull request as not mergeable. Recommend approval; not approved on the forge.
Moves rendering and sound out of the game process by default, narrows the game's sandbox and adds renderer input checks. It adds substantial process, transport and platform code; the reported Linux NVIDIA run shows no measurable Market frame-rate cost.
Nits (1): optional.
Testing before merging (3) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1.Questions (1) (not confirmed from the code; they don't hold the recommendation)
Since the last review (on
0f4db10cbf)Resolved: L2 (The new LONGSHOT_AUDIO_BROKER switch has no row in the required switch table.); L3 (Running this regression test directly ignores CC and requires a command named gcc.); L7 (It conflicts with its base branch: bring it up to date (
@fixor@rebasetry first).)Still open: L1 (The description contradicts the shipped default and gives an ineffective rollback instruct…); L4 (The default-on Windows renderer and audio paths have not been exercised on real Windows ha…); L5 (The performance and compatibility of the default split remain unmeasured on lower-core Lin…); L6 (The changed headset process placement has no reported headset run.)
Checks: Still running: 11 checks.
Also noticed (1; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven across supported systems. On the reported RTX 3090 Market runs, main averaged about 125.4 fps across three runs and this PR about 124.8 fps, a 0.4% difference within run-to-run noise. Visible Linux play and smoke runs passed; real Windows, lower-core Linux, Intel and headset runs remain outstanding.
Other systems: The split changes Windows and Linux rendering, input, audio, overlays and headset runtime placement. Linux NVIDIA and an AMD smoke run are reported; Windows hardware, Intel GPUs, lower-core Linux systems and headsets remain untested.
Switches: LONGSHOT_RENDER_PROCESS and LONGSHOT_AUDIO_BROKER default on, with 0 disabling each. LONGSHOT_RP_HOT_SPIN defaults to 1000 microseconds when at least eight logical CPUs remain and otherwise 0. Their defaults need the outstanding platform and lower-core runs; diagnostic transport and audio switches are listed in switches.def.
Reviewed:
8c79d1e9acagainstf359e26213: Read AGENTS.md, CONTRIBUTING.md, the pull request template, tests/test_key_async_posix.py and tests/compiler_command.py in full. Inspected the relevant switch rows, rebase history, selected transport and input code and portions of the diff; the large remaining diff and changed files were not read in full. docs/review-checklist.md is absent.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The supplied CI checks are still running; the author's reported Linux play and smoke runs are noted above.
Overlaps and merge order: No overlap information was available beyond the stated folding of #3176.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
On BeanBot's question: Forgejo reports #3116 as not mergeable only because it is WIP (Forgejo merges no WIP PR); a test merge of
8c79d1e9with today's main (3a0f7d8f) has no conflicts. The description's stale default/rollback text and the interface version (now 96) are fixed. What's left is the hardware testing in Still to test.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.