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

Closed
mutlusinan wants to merge 1 commit from upstream-pr/249 into main
mutlusinan commented 2026-11-27 20:08:36 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mutlusinan on 2026-11-27T20:08:36Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5532491347 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/249). Originally posted by [mutlusinan](https://github.com/mutlusinan) on 2026-11-27T20:08:36Z. --- ### 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 commented 2026-11-27 20:21:28 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mutlusinan on 2026-11-27T20:21:28Z.


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.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7227423311 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/249#issuecomment-7227423311). Originally posted by [mutlusinan](https://github.com/mutlusinan) on 2026-11-27T20:21:28Z. --- ### 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`.
1tsethan commented 2026-11-27 23:00:20 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by 1tsethan on 2026-11-27T23:00:20Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7229793418 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/249#issuecomment-7229793418). Originally posted by [1tsethan](https://github.com/1tsethan) on 2026-11-27T23:00:20Z. --- 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 -->
cloph-dsp commented 2026-11-28 01:07:10 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cloph-dsp on 2026-11-28T01:07:10Z.


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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7231434242 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/249#issuecomment-7231434242). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-28T01:07:10Z. --- 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).
trustno1-coder commented 2026-11-28 02:49:31 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T02:49:31Z.


Merged into main (8fc2254) and shipped in v2026.11.27.10. The commit keeps you as its author, so it counts toward the contributors list. GitHub shows this as closed rather than merged only because the commits were applied on top of the newest main (new commit IDs). Thank you!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7232617608 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/249#issuecomment-7232617608). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-11-28T02:49:31Z. --- Merged into main (8fc2254) and shipped in [v2026.11.27.10](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.27.10). The commit keeps you as its author, so it counts toward the contributors list. GitHub shows this as closed rather than merged only because the commits were applied on top of the newest main (new commit IDs). Thank you!

Pull request closed

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!249
No description provided.