launcher: give Proton's syscall stack room for the driver's pipeline compiles #564
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/564"
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?
Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-30T02:21:28Z.
Refs #472 (@1093i3511 reported this crash there on an RX 6600 and worked around it with
TUXBOX_SKIP_SHADERS=35af8e6d,e5fbc632).Problem
On current
main(f482572a, with #557 so it starts and #389), ProjectScarlett 1.0.2.1 crashed twice during loading on my RX 9060 XT (RADV, Mesa 26.2.6, GE-Proton11-14). Both times it was the driver compiling the same compute pipeline,CS e5fbc632(1.96 MB of DXIL), and35af8e6dis the other program 1093i3511 had to skip:Cause
kernel_stack_size = 0x100000indlls/ntdll/unix/loader.c), and the Vulkan driver compiles pipelines on it.big_stack.rs's 64 MiB thread stack covers vkd3d-proton's DXIL to SPIR-V conversion, which runs on the PE side, but not this.structured_post_order_traversal()insrc/compiler/spirv/vtn_structured_cfg.c), about 96 bytes per block in a sequence. The translated program is mostly one long run ofifs: 15,521 selection constructs, 49,875 blocks, nesting depth 4.structured_post_order_traversal, with the recursive call at+0x71fcd5, the same address as the game's crash. 2 MiB and more compile it in 4.7 s.WINE_KERNEL_STACK_SIZE(KiB). Valve'sproton_10.0,proton_11.0,experimental_10.0,experimental_11.0andbleeding-edgeall have it, and so does GE-Proton11-14'sntdll.so. Upstream Wine has a fixed 1 MiB.Change
WINE_KERNEL_STACK_SIZE=16384for Proton launches, so forrun,verifyandcheck. A value set in the environment is kept, and thewinebackend is left alone.branch-chain: a compute program of 14,000ifs in a row, generated at build time bybranch_chain_fixture.py. Each branch tests its own multiple of a per-lane key, and each of 64 lanes stores its total, which the CPU checks. It's compiled with-Od, because DXC's optimizer is quadratic in the number of branches (minutes and about 10 GiB at 20,000). It has its own gate,lanes-selftest-branch-chain, which raisesTUXBOX_PIPELINE_DEADLINEto 600 s and the gate's timeout to 240 s, because vkd3d-proton's conversion alone takes about 30 s (31 s natively, 38 s for the whole scenario here). It isn't part ofall.winebackend, plus a source check that the scenario is registered and has its own gate. Docs:docs/ENVIRONMENT.mdand the Lanes README.Measured
On an RX 9060 XT (
1002:7590), RADV / Mesa 26.2.6, GE-Proton11-14, Linux 6.18:branch-chainthroughtuxbox.py run,WINE_KERNEL_STACK_SIZE=1024(Proton's default)Syscall stack overruninvkCreateComputePipelines, exit 3 after 41 sbranch-chainthroughtuxbox.py run, this changelanes-selftest PASS ... scenario=branch-chain passed=1, 38 sverify --only lanes-selftest, this changelanes-selftest-branch-chainincluded (67 s for the suite)verify --only lanes-selftest,WINE_KERNEL_STACK_SIZE=1024lanes-selftest-branch-chainfails with exit code 3 and no report35af8e6d(155 s),8ae931bd(119 s) ande5fbc632(118 s) compiled, no overrun; the run got past the point where it crashed beforeifs, 1 MiB stackThe ProjectScarlett run that got furthest with this setting ended later, at the intro start, on the title's heartbeat watchdog, during a stall with compute-queue label waits that nothing had submitted a writer for. That's a separate problem, and I'm looking into it on its own.
Not covered
--backend wine) has no such setting, so the crash stays there, and with a Mesa driver the newlanes-selftest-branch-chaingate fails on that backend on purpose: the title would crash there too. A real fix belongs in Mesa (the walk would have to be iterative; I have a game-free reproducer, a generated SPIR-V of N sequentialifs) or in the translator: fewer blocks per program would also cut vkd3d's conversion, which takes 95 s fore5fbc632.Checks
python tuxbox.py check --no-gpu: 9 passed, 1 failed. The failure istest_stage_baseline.GuestWatch.test_a_guest_that_died_stops_the_sandbox_instead_of_waiting_out_the_timeout(0 != 'guest gone'), the only failing test of 763. It fails the same way on unchangedmain(f482572a) on this machine and passes in CI here, and #560 changes that test. The new tests (tests/test_lanes_branch_chain.py,KernelStackintests/test_host.py) pass.python tuxbox.py verify --only lanes-selftest --backend proton --adapter 1002:7590(RX 9060 XT, RADV / Mesa 26.2.6, GE-Proton11-14): 29 of 29 passed.Full
python tuxbox.py check --backend proton --adapter 1002:7590on this PR's head (RX 9060 XT, RADV / Mesa 26.2.6, Proton Experimentalexperimental-11.0-20261112): 13 passed, 1 failed. Every GPU step passed (build, Lanes and fixtures on the GPU with 201 gates andlanes-selftest-branch-chainamong them, the D3D12 regression controls, the shader translator on the GPU). The one failure is the sameGuestWatchPython test as above.NVIDIA: not run.
AI use
I made this branch with an AI coding agent (Claude Code), following
AGENTS.md. It traced the crash from the game logs to the pipeline with a per-thread compile log, reproduced it offline (dxil-spirv CLI, a small native Vulkan harness, gdb), read the Wine and Mesa sources, and wrote the launcher change, the Lanes scenario, the tests and this description. The measurements above ran on my machine.Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-30T06:00:57Z.
Confirmed on NVIDIA: RTX 3080 Ti, driver 620.73.04, GE-Proton11-14, main
f482572a+ #557 + #501 (private views). With WINE_KERNEL_STACK_SIZE=16384, CS 35af8e6d compiled in 1015 s and e5fbc632 in 979 s with no stack overrun. In an earlier run without it, 8ae931bd sat in pipeline creation for over two hours and never finished; with it, that program now comes from the cache.Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-30T07:09:36Z.
Same machine, a cold cache this time: CS 8ae931bd finished in 210 s with WINE_KERNEL_STACK_SIZE=16384. Without it, the same program sat in pipeline creation for over two hours and never finished.
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T11:44:58Z.
Merged, thanks. This is a model bug report and fix: you traced the crash through Wine and Mesa, built a reproducer that runs without the game, and added a gate that fails without the change.
NVIDIA, the one gap you listed:
verify --only lanes-selftestpasses 29 of 29 on an RTX 4070 Ti SUPER (10de:2705, GE-Proton11-14),lanes-selftest-branch-chainincluded. @ReverendOzmund's game runs on the 3080 Ti cover the in-game side, including8ae931bd, which never finished without it.Your
GuestWatchfailure was #560, merged just before this.