fix(gpu): a panicking pipeline build is refused and its worker carries on #249

Open
github-bot wants to merge 1 commit from github-bot/gh-249 into main AGit
Owner

@⁠mutlusinan on GitHub · 2026-11-27 20:08 UTC · original
mutlusinan:fix/pipeline-panic → main · +37 −1 · 1 files · 1 commits · open

Problem

A panic inside a pipeline build (HostPipeline::new, e.g. a translator gap reached through make) unwound out of Pending::make, leaving made: OnceLock empty for ever:

  • every draw or dispatch waiting on that pipeline waited out its frame budget in every frame;
  • the worker thread that hit the panic was gone, shrinking the pool permanently.

Fix

make now delegates to make_with, which runs the build under catch_unwind. A panic is logged and recorded as None — the same state as a failed translation — so the queue entry completes and its waiters wake. A queued pipeline that already failed is never rebuilt (the OnceLock is set), so the test's second call with a panicking closure also observes a completed entry.

Verification

  • cargo check -p victory-gpu --all-targets --target x86_64-pc-windows-msvc --locked — clean.
  • New unit test a_panicking_pipeline_is_refused_and_the_worker_continues (not run here: victory-gpu needs Windows to build).

Ported from fxceless/victory-fork 46da5eec (pull request #1353), GPL-3.0-or-later.

**@⁠mutlusinan** on GitHub · 2026-11-27 20:08 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/249) `mutlusinan:fix/pipeline-panic` → `main` · +37 −1 · 1 files · 1 commits · open ### Problem A panic inside a pipeline build (`HostPipeline::new`, e.g. a translator gap reached through `make`) unwound out of `Pending::make`, leaving `made: OnceLock` empty **for ever**: - every draw or dispatch waiting on that pipeline waited out its frame budget in every frame; - the worker thread that hit the panic was gone, shrinking the pool permanently. ### Fix `make` now delegates to `make_with`, which runs the build under `catch_unwind`. A panic is logged and recorded as `None` — the same state as a failed translation — so the queue entry completes and its waiters wake. A queued pipeline that already failed is never rebuilt (the `OnceLock` is set), so the test's second call with a panicking closure also observes a completed entry. ### Verification - `cargo check -p victory-gpu --all-targets --target x86_64-pc-windows-msvc --locked` — clean. - New unit test `a_panicking_pipeline_is_refused_and_the_worker_continues` (not run here: `victory-gpu` needs Windows to build). Ported from fxceless/victory-fork `46da5eec` (pull request #1353), GPL-3.0-or-later.
A panic inside `HostPipeline::new` (a translator gap, an unexpected shader
form) unwound out of `make`, leaving `made` empty for ever: every draw or
dispatch waiting on that pipeline waited to its budget in every frame, and
the worker thread that hit it was gone.

The build now runs under `catch_unwind`; a panic is logged and recorded as
"no host pipeline" like a failed translation, so the queue entry completes
and its waiters wake.

Ported from fxceless/victory-fork 46da5eec (pull request #1353), GPL-3.0-or-later.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 20:10:02 +00:00
Author
Owner

@⁠mutlusinan on GitHub · 2026-11-27 20:21 UTC · original

Risk assessment (porting review)

  • A panic in the build is now logged (host pipeline build panicked) and recorded as "no host pipeline", so the entry completes and waiters wake. The visible effect of a translator bug changes from "stuck queue and a dead worker thread" to "missing pipeline" (a rendering hole).
  • catch_unwind only applies with panic = "unwind"; the workspace profiles leave the default, so it does apply. A panic = "abort" build would make the guard inert.
  • AssertUnwindSafe is deliberate: a panicking build may leave shared state inconsistent, but losing the worker and never completing the entry is worse.
  • Compatibility: merges cleanly and type-checks against main at e69e39c.
**@⁠mutlusinan** on GitHub · 2026-11-27 20:21 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/249#issuecomment-7227423311) ### Risk assessment (porting review) - A panic in the build is now logged (`host pipeline build panicked`) and recorded as "no host pipeline", so the entry completes and waiters wake. The visible effect of a translator bug changes from "stuck queue and a dead worker thread" to "missing pipeline" (a rendering hole). - `catch_unwind` only applies with `panic = "unwind"`; the workspace profiles leave the default, so it does apply. A `panic = "abort"` build would make the guard inert. - `AssertUnwindSafe` is deliberate: a panicking build may leave shared state inconsistent, but losing the worker and never completing the entry is worse. - **Compatibility:** merges cleanly and type-checks against `main` at `e69e39c`.
Author
Owner

@⁠1tsethan on GitHub · 2026-11-27 23:00 UTC · original

Independent Windows validation of PR #249.

Tested commit: 52331a3b95ab28d21820cc187bfe8e8842062090.

cargo test --locked -p victory-gpu a_panicking_pipeline -- --nocapture --test-threads=1

Exit: 0.

  • test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 455 filtered out; finished in 0.00s

Independent verification with OpenAI Codex assistance. Windows 11 Pro build 26200; Rust 1.98.1 MSVC; Windows SDK libraries from Microsoft.Windows.SDK.CPP.x64 10.0.28000.2957. Test harness used an RTX 3070 Ti / AMD integrated-GPU host; adapter identity was not captured for every test. These are focused checks on the stated PR commit, not gameplay, FPS, or a merged-main integration result.

**@⁠1tsethan** on GitHub · 2026-11-27 23:00 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/249#issuecomment-7229793418) Independent Windows validation of PR #249. Tested commit: `52331a3b95ab28d21820cc187bfe8e8842062090`. `cargo test --locked -p victory-gpu a_panicking_pipeline -- --nocapture --test-threads=1` Exit: **0**. - test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 455 filtered out; finished in 0.00s Independent verification with OpenAI Codex assistance. Windows 11 Pro build 26200; Rust 1.98.1 MSVC; Windows SDK libraries from Microsoft.Windows.SDK.CPP.x64 10.0.28000.2957. Test harness used an RTX 3070 Ti / AMD integrated-GPU host; adapter identity was not captured for every test. These are focused checks on the stated PR commit, not gameplay, FPS, or a merged-main integration result. <!-- victory-native-validation-20261128 -->
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-28 01:07 UTC · original

Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):

  • PR #249 at head 52331a3b95ab28d21820cc187bfe8e8842062090, base (PR parent) 0cef07e9d766df48f0e95f13ce3bbbe2290fe9d3.
  • cargo test --locked -p victory-gpu --lib -- pipeline::make::tests::a_panicking_pipeline_is_refused_and_the_worker_continues --exact --test-threads=1 --quiet → 1 passed, 0 failed, 455 filtered, exit 0.
  • git grep -F for the test name on the PR parent returned no hits (test is new on this PR); git diff --check 0cef07e9 HEAD clean (1 file, +37/-1).
  • Used a per-worktree CARGO_TARGET_DIR and CARGO_BUILD_JOBS=2.
  • Only the named synthetic test was replayed; full workspace suite and clippy were not run locally (no clippy component on this toolchain). Pre-existing compiler warnings only.
  • GPU/driver: N/A (CPU-only pipeline-make test). No game data, assets, extracted shaders, DRM or decrypt involved.

AI-assisted (Hy4 flash).

**@⁠cloph-dsp** on GitHub · 2026-11-28 01:07 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/249#issuecomment-7231434242) Independent local verification (Windows, Rust 1.100.0/MSVC, no game data): - PR #249 at head `52331a3b95ab28d21820cc187bfe8e8842062090`, base (PR parent) `0cef07e9d766df48f0e95f13ce3bbbe2290fe9d3`. - `cargo test --locked -p victory-gpu --lib -- pipeline::make::tests::a_panicking_pipeline_is_refused_and_the_worker_continues --exact --test-threads=1 --quiet` → 1 passed, 0 failed, 455 filtered, exit 0. - `git grep -F` for the test name on the PR parent returned no hits (test is new on this PR); `git diff --check 0cef07e9 HEAD` clean (1 file, +37/-1). - Used a per-worktree `CARGO_TARGET_DIR` and `CARGO_BUILD_JOBS=2`. - Only the named synthetic test was replayed; full workspace suite and clippy were not run locally (no clippy component on this toolchain). Pre-existing compiler warnings only. - GPU/driver: N/A (CPU-only pipeline-make test). No game data, assets, extracted shaders, DRM or decrypt involved. AI-assisted (Hy4 flash).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/249/head:github-bot/gh-249'
git switch 'github-bot/gh-249'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-249'
git switch 'github-bot/gh-249'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-249'
git switch 'github-bot/gh-249'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-249'
git switch 'main'
git merge --squash 'github-bot/gh-249'
git switch 'main'
git merge --ff-only 'github-bot/gh-249'
git switch 'main'
git merge 'github-bot/gh-249'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.