Repository navigation
RR runtime: give the pipeline compile thread a 64 MB stack; log failed pipelines - #196
Merged
phantoslayer21 merged 1 commit intoNov 14, 2026
Conversation
…d pipelines Under Proton, vkd3d-proton translates each kernel on the thread that calls CreateComputePipelineState. The structurizer in current dxil-spirv recurses about once per branch (HansKristian-Work/dxil-spirv#366), so the opt-in kernels stage.IN0 and stage.D4-F overflowed the std::thread's default stack (1 MB in rr_test_host, 2 MB in Cyberpunk 2077). The thread died without setting compile_failed and the opt-in variants never became ready. - CompileThread (CreateThread, 64 MB with STACK_SIZE_PARAM_IS_A_RESERVATION: address space only) replaces std::thread; it keeps joinable() and join(), so the call sites do not change. - make_pso logs the kernel name, its size and the HRESULT when CreateComputePipelineState fails. - set-device logs and fails (WG_E_D3D_API) if the thread cannot start. Verified with a llvm-mingw build only (no MSVC build, no Windows run): rr_test_host under GE-Proton 11-11, vkd3d-proton 5b1089c8 + dxil-spirv #362, RX 9070 XT, verification head (perf ... exact). Before: the log stops at "pso 0 stage.IN0: start", Wine reports a stack overflow, 0 of 30 frames ok. After: "opt-in variant kernels prepared", no overflow, 30 of 30 frames ok. Fixes phantoslayer21#149 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
j0nsh1n
added a commit
to j0nsh1n/wronggpu
that referenced
this pull request
Nov 15, 2026
Brings the launcher branch up to upstream main (217 commits: phantoslayer21#47, phantoslayer21#105, phantoslayer21#196, phantoslayer21#197, phantoslayer21#209, Model K/L, frame generation, ...). Changes beyond resolving the three conflicts (CMakeLists.txt project(), util.h's includes, the restorer test): - POSIX layer: the Win32 calls main's handle-based restore uses (SetFileInformationByHandle with FileBasicInfo, FileDispositionInfo and FileDispositionInfoEx's POSIX delete, GetFileInformationByHandleEx FileBasicInfo, SetEndOfFile, ExitProcess, GetProcessHeap/HeapFree, CDECL, ERROR_TOO_MANY_LINKS/FILE_CORRUPT/READ_FAULT), with posix-layer tests. - run_launcher_tests.py stays below the 256 KB source limit: the edition section moves unchanged to launcher_edition_cases.py and the Linux run's plumbing to native_linux.NativeT. - launcher-native runs only in a -DWRONGGPU_PRESET_K=OFF build (like CI's launcher build: the suite expects no seeded wronggpu-asi.ini); its two checks that fail on main's own launcher too (phantoslayer21#219) are skipped while they fail (native_linux.KNOWN_ON_MAIN). Verified: fresh build, ctest 22/22 (launcher-native 365 passed, 0 failed, 6 skipped: 4 Windows-only sections, the 2 phantoslayer21#219 checks); reuse lint passes. Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes and why
Fixes #149.
Under Proton, the Ray Reconstruction runtime's background thread that compiles the kernels' pipelines dies of a stack overflow on the opt-in verification kernels (
WG_RR_HEAD=exact/strict/debug,WG_RR_BODY=X/Z,WG_RR_PATHS=verified). vkd3d-proton translates each kernel on the thread that callsCreateComputePipelineState, and the structurizer in current dxil-spirv recurses about once per branch (reported as HansKristian-Work/dxil-spirv#366). Astd::threadgets the game's default stack: 1 MB inrr_test_host(stage.IN0overflows), 2 MB in Cyberpunk 2077 (stage.D4-Foverflows). Nothing was logged, andcompile_failedwas never set, so the opt-in variants stayed "still being prepared". The menu modes (Exact, Accurate, Fast) are compiled in earlier passes and are not affected. Windows with AMD's driver is not affected either.One file,
clean/rr_f/runtime/src/rr_runtime.cpp:CompileThreadclass replaces thestd::thread. It usesCreateThreadwith a 64 MB stack reservation (STACK_SIZE_PARAM_IS_A_RESERVATION: address space only, pages are committed as they are used). It hasjoinable()andjoin(), so the call sites stay as they are.make_psologs the kernel name, its size and the HRESULT whenCreateComputePipelineStatefails, so a failed pipeline shows inwronggpu-rr.log.WG_E_D3D_API) if the thread cannot start, as its other failures do.This changes how the compile thread starts for every player, on Windows too. The maintainer said an MSVC build and a Windows run will be done before merge.
What each new or substantially changed file is based on (public document, test result or own design)
rr_runtime.cpponly. Own design, using Microsoft's documented Win32CreateThreadandSTACK_SIZE_PARAM_IS_A_RESERVATION. The stack sizes come from my own measurements of the translation on Linux (stage.D4-Fneeds 2 MB,stage.IN01 MB), with synthetic data.How it was tested (CI runs the CPU tests; say what else you ran: GPU or game tests, with synthetic data)
Built with llvm-mingw only (the Linux route of
clean/linux/README.md). No MSVC build and no Windows run here.Test:
rr_test_hostunder GE-Proton 11-11, vkd3d-proton5b1089c8+ dxil-spirv #362, RX 9070 XT (RADV), theperfjob at 1706x960 -> 2560x1440 with the verification head (exact),WG_RR_COMPILE_WAIT_ALL=1, a new prefix and Mesa cache for each run, on currentmain(6622148) with and without this change.main)pso 0 stage.IN0: start (808528 bytes)pso 0 stage.IN0: 1047 ms, thenopt-in variant kernels prepared after 113311 mserr:virtual:virtual_setup_exception stack overflowpython3 tools/ci/check_line_endings.py,python3 clean/installer/tools/check_source_size.pyandreuse lintpass.Checklist
CONTRIBUTING.md
for this and all my contributions (required once, in my first pull request).
Signed-off-by:line (git commit -s; Developer Certificate of Origin 1.1).REUSE.toml. (No new files.)binaries; no paths, user or machine names of my PC.
🤖 Generated with Claude Code