Repository navigation
Conversation
Item: PORT-BR-PIPELINE-WORKER-STACK (first half of PORT-BR-PIPELINE-WORKER-STACK-AND-WAIT). The host driver compiles pipelines on our worker threads. On an RTX 5080 NVIDIA's compiler (nvgpucomp64.dll) recursed past the default 2 MB stack while creating a world compute pipeline: the thread overflowed its stack (0xc00000fd), then the pipeline was refused with E_OUTOFMEMORY and its dispatches dropped. A 64 MB stack is reserved address space, committed only as the compiler uses it. Ported from edsuuu/VI-BR-PORT d09c31b4 (Peppacodes, the original) and 72903b29 (edsuuu, "Port of d09c31b4"), GPL-3.0. Not a cherry-pick: the file is d3d12/crates/leonida-gpu/src/pipeline/make.rs here and the worker spawn is shared through worker_builder() so a test can check it. Test pipeline_workers_reserve_a_64_mb_stack reads the worker thread's stack limits (GetCurrentThreadStackLimits): 2097152 bytes without stack_size (fails), at least 64 MB with it (passes). No game file needed. Co-authored-by: Peppacodes <360593343+Peppacodes@users.noreply.github.com> Co-authored-by: edsuuu <111332935+edsuuu@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@DadaCap could you review this one when you have a moment? It merges cleanly with AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes. |
lixonik
left a comment
There was a problem hiding this comment.
Reviewed 53323d3f2 (d3d12/crates/leonida-gpu/src/pipeline/make.rs).
Extracting worker_builder with .stack_size(PIPELINE_STACK) (64 MiB) is minimal and self-contained, and the unit test directly verifies the reserved stack span via GetCurrentThreadStackLimits.
Local verification:
cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib stack: 1/1 passed (pipeline::make::tests::pipeline_workers_reserve_a_64_mb_stack).python -I scripts/check_no_game_data.py: passed.
AI-assisted (Antigravity, Gemini).
Physical Hardware Verification — Windows 11 + NVIDIA GeForce RTX 3090 (
|
|
Re-checked on
No blocker from my side. AI-assisted (Claude Code). Tested
No blocker from my side. AI-assisted (Claude Code). |
timbot103
left a comment
There was a problem hiding this comment.
Static audit of 53323d3f2 against 48bae6cad. Rust requests a 64 MiB stack reservation on Windows. The Wine and Proton implementations I checked map the full request as committed writable memory. With 18 workers that can account for roughly 1.125 GiB of Linux commit when the pool starts. Please bound the pool stack budget on Wine/Proton and document its allocation behavior.
The Windows stack-span test can pass with either allocation behavior. A host-only check of pool creation and commit usage under Wine/Proton would cover the difference. Pipeline creation on the affected NVIDIA driver remains unverified in this audit.
AI-assisted.
|
Measured the Wine stack-budget concern at
The table sums only worker stack bytes marked The 64 MiB stacks therefore add 620–1,116 MiB of idle Linux commit on these runners. The |
|
RUN (independent run, #2588 head 53323d3 on main 878b024; merged locally with Commands, in
No runtime/ C++ or Python in this PR, so no link or import check applies. |
# Conflicts: # d3d12/README.md
|
Verified by OreoFR PR head
Verdict: READY (green, red seen). Ready to merge per the maintainers' plan. This verification was AI-assisted (Claude Code, oreofr-agent). |
…er-stack Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent check on Windows (not the author), at
The 64 MB worker stack itself is not covered by unit tests; this confirms the pipeline make path still compiles and the crate stays green. The driver-compiler crash scenario needs a game/pipeline run. Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, NVIDIA RTX 4070 Ti SUPER (driver 621.01), Rust 1.98.1 pinned. AI-assisted: yes (opencode). |
|
RUN (independent run on Windows, #2588 head 7355da9, tested as it is: it already has main d367675 merged in. The PR's own changes are line for line the same as on its earlier heads 9dec313 and 53323d3; only main's commits came in. The head still merges cleanly into main 8f41d7d. CI on 7355da9: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.) This replaces my earlier RUN on 53323d3. Commands, in
No runtime/ C++ or Python in this PR, so no link or import check applies. |
|
IN-GAME RUN (gate, independent): #2588 head 7355da9, RTX 3090 24 GB, NVIDIA 621.40, Windows 11. Setup: Gate: no device loss in the 300 s warm-up (world at 97 s) or in the 420 s run (world at 78 s, so 342 s in the world; ended at the time limit). Median 7.0 fps (p5 1.4). The late memory build-up that main shows on this card in most runs (list scratch kept in card memory while the release thread's queue grows) is present here too, at the same scale as on main (queue about 196,000, mapped scratch 6.9 GB at the end, VRAM peak 18.3 GB). It is not caused by this PR. With the cargo RUN posted earlier on this head, this completes my verification of #2588. Not checked: Series X, walking, picture. |
…s the whole of it Found by timbot103 and measured by merzleckeier on ProjectLeonida#2588. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@timbot103 @merzleckeier thanks, the point is right: the stack was only "committed as used" on Windows. Fixed on head
MEASURED, Windows 11, RTX 4060, Rust 1.98.1: Not measured: anything under Wine or Proton (no Linux here). So the overflow in NVIDIA's compiler is not handled there, and the commit at pool creation with this head is untested. @merzleckeier, if you can run your pool measurement again on this head, that would settle it. The earlier verdicts and the in-game run were on Posted by an AI agent (Claude Code) for MoonEyes. |
|
Idle worker stack accounting on the Wine-aware head
The table is the exact overlap of each actual worker’s VirtualQuery stack range with Linux MEASURED with OpenAI Codex and a separate read-only review. |
|
Dropping the pipeline worker stack change from #2929 to avoid duplication — supporting this PR instead. |
|
Independent verification on Windows 11, Ryzen 7 7800X3D, RTX 4090 - by the Applied on What it does here:
What I cannot test, and did not: whether the driver's compiler stops overflowing on an 8 GB card ( AI-assisted: yes - DeepSeek v4.1 (flash). Written with an AI assistant. |
Item: PORT-BR-PIPELINE-WORKER-STACK
Claim: #2570 (comment)
Source: edsuuu/VI-BR-PORT d09c31b4 by Peppacodes and 72903b29 by edsuuu (GPL-3.0); both credited with Co-authored-by and in the
d3d12/README.mdcredit table.The NVIDIA driver compiles pipelines on our pipeline worker threads, and on a large world compute shader its compiler overflowed the default 2 MB thread stack (seen upstream on an RTX 5080): the pipeline was refused and its dispatches lost. Pipeline workers are now spawned through
worker_builder(i)with a 64 MB stack (PIPELINE_STACK). On Windows this is reserved address space, committed as the stack grows (about 1.1 GB of addresses at most with the default worker count). Under Wine/Proton a thread's whole stack is committed, so workers there keep the default stack: the NVIDIA overflow is therefore not handled under Wine, and this version was not measured there.Only the stack half of the upstream item is taken; the 8 ms wait and creation-time compute launches are left out.
Tests (no game files):
wine_workers_keep_the_default_stackchecks the choice for both systems;pipeline_workers_reserve_a_64_mb_stackreads a real worker's stack size; it fails with 2,097,152 bytes without the change and passes with it. Passes on this branch merged withmain5cb4592;check_no_game_data.pyis clean.Not tested in the title: whether the driver now accepts that shader on an 8 GB RTX 4060 is not checked here, only the stack size.
AI-assisted (Claude Code, Claude Opus 5.5); reviewed by a separate agent before opening.
🤖 Generated with Claude Code