Repository navigation
Link victory.exe with a 16 MiB default thread stack - #151
ItsYusei99 wants to merge 1 commit into
Conversation
Threads created without a stack size take the executable's default reserve, 1 MiB from the linker. vkd3d-proton's and the driver's own threads compiling the title's large world shaders overflowed it under Wine on an RTX 4070 (four threads at one driver address during the world load). Reserve 16 MiB for MSVC targets; pages are committed only as used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
An A/B test on Linux, with both runs on Setup: Arch (kernel 7.3.5), Proton Experimental
So the PR moves the failure from a silent exit to #144's driver fault. One caveat: the second run started with saved settings, so the two runs didn't take exactly the same path. AI use: Claude Code (Claude Opus 5.5) ran the builds and runs and wrote this comment. The results come from the runs described above. |
mercuryVM
left a comment
There was a problem hiding this comment.
Tested d77408b on Windows 11, RTX 5070, MSVC: cargo build -p victory succeeds. The built victory.exe has SizeOfStackReserve = 0x1000000 (16 MiB) in its optional header, so the linker argument takes effect. On this branch, cargo test --workspace fails to compile with E0428: the name tests is defined multiple times in crates/victory-gpu/src/host.rs. That is the duplicate test module #129 fixed on main after this branch was cut, not this change. Merged onto current main, the workspace tests pass.
- Safety screen: the new
build.rsonly printscargo:rustc-link-arg-bins=/STACK:16777216, gated onCARGO_CFG_TARGET_ENV == "msvc". It runs nothing, reads nothing and touches no network. -binskeeps it to binaries, so test harnesses and libraries are unaffected. As you say, it is a reservation, so only threads created with a 0 stack size get the larger default.- The reservation also applies to the title's own threads that pass 0. That is 16 MiB of address space each on 64-bit, which is harmless.
No issues found. A rebase onto main would let the branch test cleanly by itself.
AI-assisted (Claude Code).
…t thread stack Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merges Marvisak#115 Marvisak#151 Marvisak#238 Marvisak#353 Marvisak#378 Marvisak#476 Marvisak#482 Marvisak#535 Marvisak#649 Marvisak#664 Marvisak#1177 onto main (ffe310e), each head unchanged, no conflicts. One change of mine: Marvisak#378 turns the duplicate check in translate.rs into a nested `if !seen.insert(..) { if !list { .. } }`, which clippy::collapsible_if rejects under -D warnings; it is now one `if !seen.insert(..) && !list` (clippy --fix, same behaviour). cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features, is clean and cargo test --workspace --locked passes (354 passed, 6 ignored; main has 342 passed, 6 ignored). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Automated triage for the maintainers. Needs work: needs the maintainer's decision. This adds a new CI: no check runs on the head commit. Generated by Claude Code |
Threads that are created without a stack size get the size the executable's header names, and the linker's default is 1 MiB. The host graphics stack creates such threads: vkd3d-proton's own threads and the driver's. When they compile the title's large world shaders, 1 MiB is not always enough.
Under Wine with vkd3d-proton on an RTX 4070 (driver 620.70.06), loading into the world overflowed the stack of four of those threads at once, all at the same Unix-side address in the driver. One of them was vkd3d-proton's pipeline-library disk thread:
apps/victory/build.rsnow passes/STACK:16777216to the linker for MSVC targets only. That is a reservation: pages are committed as they are used, so threads that stay shallow cost nothing extra. Threads that ask for an explicit size, such as Rust'sstd::threadwith its 2 MiB default, are unaffected.Tested
Linux, Wine 11.22, RTX 4070, Ryzen 7 9800X3D, title loaded by hand into the world. I checked the header field of the built exe (
SizeOfStackReserve= 16777216, release and diag).Caveat: the "after" run was on a newer
mainthat also includes #43. That PR fixes a stack overflow inside VIctory's shader lowering, which is a different place from the driver address above. I have not yet isolated the two with an A/B run on the same commit. The run then hit a separate driver fault invkCreateComputePipelines(0xc0000005), reported in #144.Not tested on native Windows. On Windows the same thread pools exist, so a larger reserve should be harmless there.
🤖 Generated with Claude Code