GPU: 512 MiB pipeline-worker stacks #28

Open
meeyao wants to merge 1 commit from upstream-pr/28 into main
meeyao commented 2026-11-24 20:28:11 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by meeyao on 2026-11-24T20:28:11Z.


The pipeline workers run on Rust's default 2 MiB stack. On the world's largest mesh programs the translator's recursion overflowed it, the worker died, and the title waited forever for a pipeline that was never made: the log stops after host pipeline: making shaders=["mesh …"], CPU stays busy, no frame is presented.

The workers are half the logical processors, capped at 8, so a 512 MiB stack reserves at most 4 GiB of address space. Windows reserves stack, it does not commit it.

  • 2 MiB (default): overflowed on the world's mesh programs.
  • 32 MiB: still overflowed.
  • 128 MiB: four compute programs still overflowed (55679a0547649d0b, afeea48bbb9913ad, e8c962358d862e3f, 44a9625f01769f33).
  • 512 MiB: the rest fit. Those four recurse without bound and are skipped per run.

This is not Linux-only: on Windows, @Peppacodes saw the overflow inside NVIDIA's own shader compiler (nvgpucomp64.dll) on a pipeline worker, which is why the value is well above their 64 MiB.

This is the stacks part of the original #28, split as asked. The DXC fallback belongs to #20, the watchdog hooks to the loader PR, and the copy/pipeline-library work to its own PR.

Checked with cargo xwin check --all-targets -p victory-gpu --target x86_64-pc-windows-msvc. Not run in the title: no game files here.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6590770759 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/28). Originally posted by [meeyao](https://github.com/meeyao) on 2026-11-24T20:28:11Z. --- The pipeline workers run on Rust's default 2 MiB stack. On the world's largest mesh programs the translator's recursion overflowed it, the worker died, and the title waited forever for a pipeline that was never made: the log stops after `host pipeline: making shaders=["mesh …"]`, CPU stays busy, no frame is presented. The workers are half the logical processors, capped at 8, so a 512 MiB stack reserves at most 4 GiB of address space. Windows reserves stack, it does not commit it. - 2 MiB (default): overflowed on the world's mesh programs. - 32 MiB: still overflowed. - 128 MiB: four compute programs still overflowed (`55679a0547649d0b`, `afeea48bbb9913ad`, `e8c962358d862e3f`, `44a9625f01769f33`). - 512 MiB: the rest fit. Those four recurse without bound and are skipped per run. This is not Linux-only: on Windows, @Peppacodes saw the overflow inside NVIDIA's own shader compiler (`nvgpucomp64.dll`) on a pipeline worker, which is why the value is well above their 64 MiB. This is the stacks part of the original #28, split as asked. The DXC fallback belongs to #20, the watchdog hooks to the loader PR, and the copy/pipeline-library work to its own PR. Checked with `cargo xwin check --all-targets -p victory-gpu --target x86_64-pc-windows-msvc`. Not run in the title: no game files here.
Peppacodes commented 2026-11-24 22:07:41 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Peppacodes on 2026-11-24T22:04:04Z.


Both the watchdog hook and the bigger worker stacks are needed on native Windows too. Data from an RTX 5080 (Windows 11, driver 621.24, 32.0.16.2124, Ryzen 7 5700X3D, 32 GB) running this repo at d279e69 with VICTORY_RELAY=2:

  • Watchdog: here it fired much earlier than 6–8 minutes in.
    • As published, the title killed itself during loading, at +0x23cf683, on the first cold pipeline compile.
    • With upstream's #454 hook (the same change as part 2 here), that compile showed up as a single 122-second frame instead.
    • Then the lit opening scene rendered, at about 310 ms per frame.
  • Stacks: on this card the overflow is in NVIDIA's own shader compiler (nvgpucomp64.dll), which also runs on the pipeline workers, not only in the translator.
    • It recursed past 2 MB while creating a world compute pipeline (c7d7a6283fad3cd6).
    • The driver then refused the pipeline with E_OUTOFMEMORY and its dispatches were dropped.
    • I used 64 MB (upstream Marvisak/VIctory#966) and haven't tried 32 MiB against that program.

AI-assisted (Claude Code). Counts and hashes only; nothing from the game attached.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7145757961 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/28#issuecomment-7145757961). Originally posted by [Peppacodes](https://github.com/Peppacodes) on 2026-11-24T22:04:04Z. --- Both the watchdog hook and the bigger worker stacks are needed on native Windows too. Data from an RTX 5080 (Windows 11, driver 621.24, 32.0.16.2124, Ryzen 7 5700X3D, 32 GB) running this repo at `d279e69` with `VICTORY_RELAY=2`: - **Watchdog:** here it fired much earlier than 6–8 minutes in. - As published, the title killed itself during **loading**, at `+0x23cf683`, on the first cold pipeline compile. - With upstream's #454 hook (the same change as part 2 here), that compile showed up as a single 122-second frame instead. - Then the lit opening scene rendered, at about 310 ms per frame. - **Stacks:** on this card the overflow is in **NVIDIA's own shader compiler** (`nvgpucomp64.dll`), which also runs on the pipeline workers, not only in the translator. - It recursed past 2 MB while creating a world compute pipeline (`c7d7a6283fad3cd6`). - The driver then refused the pipeline with `E_OUTOFMEMORY` and its dispatches were dropped. - I used 64 MB (upstream Marvisak/VIctory#966) and haven't tried 32 MiB against that program. AI-assisted (Claude Code). Counts and hashes only; nothing from the game attached.
upstream-sync changed title from [PR #28] Linux/Proton: DXC fallback for the argument clamp, watchdog hooks, and 32 MiB pipeline-worker stacks to [PR #28] GPU: 512 MiB pipeline-worker stacks 2026-11-25 00:09:17 +00:00
ErRusso commented 2026-11-25 00:09:18 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ErRusso on 2026-11-24T23:46:40Z.

Review: CHANGES_REQUESTED


Reviewed at aabca38 against 90228a7 (six commits behind current main).

This is a 1,334-line bundle of three separate changes (DXC fallback, watchdog hooks, 32 MiB pipeline stacks) from an old base. The DXC part overlaps #20/#174/#127 and does not include #20's missing-RTS0 check, so the twins' root-signature failure is not covered. The other two changes are unrelated to the DXC fallback and should be separate PRs.

Please split this into focused changes, rebase onto current main, and coordinate the DXC part with #20; as one PR it conflicts with the Linux/Proton work already in review.

<!-- greyfinch-sync:fxceless/victory-fork:review:6049270699 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/28#pullrequestreview-6049270699). Originally posted by [ErRusso](https://github.com/ErRusso) on 2026-11-24T23:46:40Z. **Review:** CHANGES_REQUESTED --- Reviewed at `aabca38` against `90228a7` (six commits behind current `main`). This is a 1,334-line bundle of three separate changes (DXC fallback, watchdog hooks, 32 MiB pipeline stacks) from an old base. The DXC part overlaps #20/#174/#127 and does not include #20's missing-`RTS0` check, so the twins' root-signature failure is not covered. The other two changes are unrelated to the DXC fallback and should be separate PRs. Please split this into focused changes, rebase onto current `main`, and coordinate the DXC part with #20; as one PR it conflicts with the Linux/Proton work already in review.
meeyao commented 2026-11-25 00:10:12 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by meeyao on 2026-11-24T23:57:06Z.


Split as asked. This PR is now only the 512 MiB pipeline-worker stacks (one file, six lines):

  • DXC: left to #20, which also covers the card compare, the in-place probe and the twins' missing RTS0.
  • Watchdog: #364, carrying upstream #454 unchanged.
  • Copy and pipeline-library work: #363.
  • Notes, wrapper and supervisor: #365.

The old head is kept at meeyao/victory-gta6:linux-findings-backup-2026-11-25.

On the value: the branch had already gone past 32 MiB before this was opened — 128 MiB still overflowed on four compute programs, which is why the diff says 512 MiB. @Peppacodes' data from NVIDIA's compiler on Windows is why it is well above 64 MiB; those four recurse without bound and are skipped per run.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7147974276 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/28#issuecomment-7147974276). Originally posted by [meeyao](https://github.com/meeyao) on 2026-11-24T23:57:06Z. --- Split as asked. This PR is now only the 512 MiB pipeline-worker stacks (one file, six lines): - DXC: left to #20, which also covers the card compare, the in-place probe and the twins' missing `RTS0`. - Watchdog: #364, carrying upstream #454 unchanged. - Copy and pipeline-library work: #363. - Notes, wrapper and supervisor: #365. The old head is kept at `meeyao/victory-gta6:linux-findings-backup-2026-11-25`. On the value: the branch had already gone past 32 MiB before this was opened — 128 MiB still overflowed on four compute programs, which is why the diff says 512 MiB. @Peppacodes' data from NVIDIA's compiler on Windows is why it is well above 64 MiB; those four recurse without bound and are skipped per run.
gingertonik commented 2026-11-25 06:06:35 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by gingertonik on 2026-11-25T05:08:58Z.


An addition on the programs that "recurse without bound and are skipped per run".

We had 4 such compute programs: 559d9f0184e15fe3, a1b20bc47e3c9597, e8c962358d862e3f and fdd56d97a806bcca. 4 workers overflowed in each of 4 runs, 2 with the default stack and 2 with 64 MiB. One is in your list (e8c962358d862e3f); the other three differ from yours.

All four are dxil-spirv failing on two control-flow shapes that we emit:

  • a loop header with two back edges (the first three);
  • a block with back edges to two different loop headers (fdd56d97a806bcca).

A Debug build of dxil-spirv 114e664e (the version inside vkd3d-proton 2576c0b4a) asserts on them at cfg_structurizer.cpp:3492 and :3486. In Release the recursion never ends:

stack (native dxil-spirv, fdd56d97a806bcca as our one-latch change emits it) result
8 MiB SIGSEGV after 0 s
512 MiB SIGSEGV after 1 s
4,096 MiB SIGSEGV after 7 s

With #257, all four convert, and they need not be skipped. In game that gave 0 overflows and 0 pipelines left "being made", with 64 MiB stacks.

This says nothing about the reason this PR gives for 512 MiB: the translator's recursion on the largest mesh programs, and NVIDIA's compiler on Windows. We did not test anything below 64 MiB with #257 applied, so we do not know whether those still need the larger stack.

Environment: CachyOS, kernel 7.3.5, NVIDIA 620.73.04, RTX 4080; GE-Proton11-12 (Wine) with vkd3d-proton 2576c0b4a; offline dxil-spirv 114e664e.

AI-assisted (Hermes).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7153494825 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/28#issuecomment-7153494825). Originally posted by [gingertonik](https://github.com/gingertonik) on 2026-11-25T05:08:58Z. --- An addition on the programs that "recurse without bound and are skipped per run". We had 4 such compute programs: 559d9f0184e15fe3, a1b20bc47e3c9597, e8c962358d862e3f and fdd56d97a806bcca. 4 workers overflowed in each of 4 runs, 2 with the default stack and 2 with 64 MiB. One is in your list (e8c962358d862e3f); the other three differ from yours. All four are dxil-spirv failing on two control-flow shapes that we emit: - a loop header with two back edges (the first three); - a block with back edges to two different loop headers (fdd56d97a806bcca). A Debug build of dxil-spirv 114e664e (the version inside vkd3d-proton 2576c0b4a) asserts on them at `cfg_structurizer.cpp:3492` and `:3486`. In Release the recursion never ends: | stack (native dxil-spirv, fdd56d97a806bcca as our one-latch change emits it) | result | |---|---| | 8 MiB | SIGSEGV after 0 s | | 512 MiB | SIGSEGV after 1 s | | 4,096 MiB | SIGSEGV after 7 s | **With #257, all four convert, and they need not be skipped.** In game that gave 0 overflows and 0 pipelines left "being made", with 64 MiB stacks. This says nothing about the reason this PR gives for 512 MiB: the translator's recursion on the largest mesh programs, and NVIDIA's compiler on Windows. We did not test anything below 64 MiB with #257 applied, so we do not know whether those still need the larger stack. Environment: CachyOS, kernel 7.3.5, NVIDIA 620.73.04, RTX 4080; GE-Proton11-12 (Wine) with vkd3d-proton 2576c0b4a; offline dxil-spirv 114e664e. AI-assisted (Hermes).
ErRusso commented 2026-11-25 12:06:42 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ErRusso on 2026-11-25T11:15:14Z.

Review: APPROVED


Reviewed at bd212f9 against current main. The split is done: the diff is the single stack_size(512 << 20) line on the pipeline workers plus its rationale, and the DXC/watchdog/copy work is no longer carried here. That satisfies my earlier request.

The comment correctly bounds the claim: 512 MiB covers the translator's and NVIDIA's recursion on the measured programs, while the four unbounded-recursion programs still fail. The reservation is address space only. @gingertonik's result that #257 removes those four programs does not invalidate this PR for the recursion that remains.

LGTM.

<!-- greyfinch-sync:fxceless/victory-fork:review:6056597724 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/28#pullrequestreview-6056597724). Originally posted by [ErRusso](https://github.com/ErRusso) on 2026-11-25T11:15:14Z. **Review:** APPROVED --- Reviewed at `bd212f9` against current `main`. The split is done: the diff is the single `stack_size(512 << 20)` line on the pipeline workers plus its rationale, and the DXC/watchdog/copy work is no longer carried here. That satisfies my earlier request. The comment correctly bounds the claim: 512 MiB covers the translator's and NVIDIA's recursion on the measured programs, while the four unbounded-recursion programs still fail. The reservation is address space only. @gingertonik's result that #257 removes those four programs does not invalidate this PR for the recursion that remains. LGTM.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/28:upstream-pr/28'
git switch 'upstream-pr/28'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/28'
git switch 'upstream-pr/28'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/28'
git switch 'upstream-pr/28'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/28'
git switch 'main'
git merge --squash 'upstream-pr/28'
git switch 'main'
git merge --ff-only 'upstream-pr/28'
git switch 'main'
git merge 'upstream-pr/28'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!28
No description provided.