gpu: rescue dead pipeline workers on a 4 GiB stack and fingerprint refused pipelines #400

Open
Kikoarl wants to merge 1 commit from upstream-pr/400 into main
Kikoarl commented 2026-11-27 21:55:10 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Kikoarl on 2026-11-27T21:55:10Z.


Summary

Ports dead pipeline-worker rescue on a 4 GiB stack, out-of-OnceLock completion signaling (building/failed/DONE), and fingerprinted refused-pipelines.txt from Hasusmogus/cool_fox (#39, 5e7faabe) and DoubleGhosty/cool_fox (42b95b99) (GPL-3.0-or-later), rebased onto main (63b902f).

Relation to PR #249

PR #249 (merged into main) catches Rust panics inside a pipeline build using catch_unwind in make.rs. However, hard worker thread terminations (such as stack overflows during shader translation or NVIDIA driver compilation) unwind or abort past catch_unwind, leaving callers stuck waiting on an empty OnceLock and shrinking the worker pool permanently.

Changes

  • crates/victory-gpu/src/pipeline/make.rs:
    • Moves build execution outside OnceLock::get_or_init (using building/failed flags and DONE condvar signaling around catch_unwind + self.made.set(...)) so stalled or terminated builds release waiters instead of staying unpopulated forever.
    • Detects ended worker threads (reap()) during 1 s waits, respawns replacement workers, and rescues affected pipelines once on a dedicated 4 GiB stack (VICTORY_PIPELINE_RESCUE=0 disables rescue).
  • crates/victory-gpu/src/pipeline/library.rs:
    • Stores refused pipeline keys in refused-pipelines.txt scoped by translator/driver fingerprint so builds are retried automatically after a translator or driver change (and manually with VICTORY_REFUSED_RETRY=1).

Verification

Verified on Windows (x86_64-pc-windows-msvc) after rebasing onto main (63b902f):

  • git diff --check origin/main..HEAD — clean
  • cargo test -p xtask --locked — 6 passed, 0 failed (repository_passes_policy ok)
  • cargo clippy -p victory-gpu --all-targets --locked — exit 0, 0 warnings in changed files (main has pre-existing clippy warnings in untouched shadow.rs:1708)
  • cargo test -p victory-gpu --locked pipeline:: — 28 passed, 0 failed
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5533586970 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/400). Originally posted by [Kikoarl](https://github.com/Kikoarl) on 2026-11-27T21:55:10Z. --- ### Summary Ports dead pipeline-worker rescue on a 4 GiB stack, out-of-`OnceLock` completion signaling (`building`/`failed`/`DONE`), and fingerprinted `refused-pipelines.txt` from `Hasusmogus/cool_fox` (#39, `5e7faabe`) and `DoubleGhosty/cool_fox` (`42b95b99`) (`GPL-3.0-or-later`), rebased onto `main` (`63b902f`). ### Relation to PR #249 PR #249 (merged into `main`) catches Rust panics inside a pipeline build using `catch_unwind` in `make.rs`. However, hard worker thread terminations (such as stack overflows during shader translation or NVIDIA driver compilation) unwind or abort past `catch_unwind`, leaving callers stuck waiting on an empty `OnceLock` and shrinking the worker pool permanently. ### Changes - **`crates/victory-gpu/src/pipeline/make.rs`**: - Moves build execution outside `OnceLock::get_or_init` (using `building`/`failed` flags and `DONE` condvar signaling around `catch_unwind` + `self.made.set(...)`) so stalled or terminated builds release waiters instead of staying unpopulated forever. - Detects ended worker threads (`reap()`) during 1 s waits, respawns replacement workers, and rescues affected pipelines once on a dedicated 4 GiB stack (`VICTORY_PIPELINE_RESCUE=0` disables rescue). - **`crates/victory-gpu/src/pipeline/library.rs`**: - Stores refused pipeline keys in `refused-pipelines.txt` scoped by translator/driver fingerprint so builds are retried automatically after a translator or driver change (and manually with `VICTORY_REFUSED_RETRY=1`). ### Verification Verified on Windows (`x86_64-pc-windows-msvc`) after rebasing onto `main` (`63b902f`): - `git diff --check origin/main..HEAD` — clean - `cargo test -p xtask --locked` — 6 passed, 0 failed (`repository_passes_policy` ok) - `cargo clippy -p victory-gpu --all-targets --locked` — exit 0, 0 warnings in changed files (`main` has pre-existing clippy warnings in untouched `shadow.rs:1708`) - `cargo test -p victory-gpu --locked pipeline::` — 28 passed, 0 failed
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/400:upstream-pr/400'
git switch 'upstream-pr/400'

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/400'
git switch 'upstream-pr/400'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/400'
git switch 'upstream-pr/400'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/400'
git switch 'main'
git merge --squash 'upstream-pr/400'
git switch 'main'
git merge --ff-only 'upstream-pr/400'
git switch 'main'
git merge 'upstream-pr/400'
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
trustno1-coder/VIctory-NVIDIA!400
No description provided.