GPU: a panic while making a host pipeline refuses it instead of ending the worker #2980
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2980
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2980"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Ingenioeren on GitHub · 2026-11-26 02:08 UTC · original
Ingenioeren:fix/pipeline-worker-panic→main· +32 −1 · 1 files · 1 commits · openWhat
Catch unwinding panics from host pipeline creation. Log each caught panic once with its shaders and the message when the payload is a string, then record the pipeline as refused. Add a device-free regression test.
Why
A panic during pipeline creation could end the worker, leave the queued count inflated, and keep the pipeline pending. Later draws could then consume the frame's wait budget on the same pipeline. Recording the refusal wakes waiters and lets the worker decrement the queued count and continue.
Reported in Belobug/VIctory-Belobug-AMD#217 (second item); the first item, a per-pipeline waited-time cap, is a behaviour change left out of this PR.
How tested
cargo test --locked --offline -p victory-gpu pipeline::make::tests::panicking_pipeline_is_refused -- --exactfailed with the helper calling creation directly (pipeline creation panicked, 0 passed, 1 failed). The same command passed with the panic guard (1 passed, 0 failed).cargo test --locked --offline -p victory-gpupassed with 232 passed, 0 failed, and 1 ignored. There were 0 doctests.cargo clippy --locked --offline -p victory-gpu --all-targetspassed with no warnings in the changed lines.cargo fmt --check -p victory-gpuexited 1 on existing formatting drift. Rustfmt reported no changes to the edited lines.cargo test --locked --offline -p victory-gpu --features diagnostics pipeline::make::tests::panicking_pipeline_is_refused -- --exactpassed with 1 passed and 0 failed.cargo run --locked --offline -p xtask -- policy --stagedpassed for the single staged file.Not tested
No hardware run of a real panicking pipeline and no game run.
AI assistance: prepared with OpenAI Codex under Claude Code's direction, reviewed by Ingenioeren.
@oni-swr on GitHub · 2026-11-26 02:33 UTC · original
Independent test report for head
38c1ddf00fba74018cb1611956407909e071bdd8(parent63bcca43c6a00a758510398fa43096ce7e4f7df0), per the claim in #1633.Environment: Windows 11 Pro 10.0.26200, rustc/cargo 1.98.1, clean detached checkouts.
CARGO_TARGET_DIR=D:\victory-2983-2980-warp-target,VICTORY_D3D12_WARP=1,VICTORY_WARP=1,VICTORY_DXIL=C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\dxil.dll.VICTORY_D3D12_WARPonly selects WARP in builds withdiagnostics, so I ran the device-creating crate suite only with--features diagnostics. There,host::creategoes throughwarp_adapter(), which refuses non-software adapters.host::tests::warp_adapter_accepts_only_softwareprintedEnumWarpAdapter: vendor=0x1414, flags=0x2, and the compositor test created its device there. No physical GPU was used. The machine has one, but no test ran on it. Synthetic tests only, no game data.Focused test (head):
cargo test -j 4 --locked -p victory-gpu [--features diagnostics] pipeline::make::tests::panicking_pipeline_is_refused -- --exact: 1 passed, 0 failed, both with default features and withdiagnostics. The test needs no device.Parent control (scratch, test-only): the test calls
make_with, which is new in this PR. So my control was parent63bcca4plus the PR's test plus a scratchmake_withthat callscreate()directly, with nocatch_unwind. This tree is not a commit. The same command failed in both feature sets (1 failed):panicked at crates\victory-gpu\src\pipeline\make.rs:368:24: pipeline creation panicked. That matches the author's negative control.Crate suite (head):
cargo test -j 4 --locked --no-fail-fast -p victory-gpu --features diagnostics -- --nocapture: 247 passed, 0 failed, 1 ignored; doctests 0. I did not run the default-features suite. Withoutdiagnostics,host::createuses the default adapter, which is the physical GPU here.Lint:
cargo clippy -j 4 --locked -p victory-gpu --all-targetsshowed no warnings, with default features and with--features diagnostics.rustfmt --check --edition 2024onpipeline/make.rsreports 6 diffs on both the parent and the head, so the PR adds none.Not run: any hardware GPU, a real panicking
HostPipeline::new, the title, CI. The test checks the refusal (made == Some(None)). It does not exercise the worker loop's queued-count decrement or waking waiters.Result: on Windows, the panic guard turns a panicking pipeline creation into a refusal. The same test fails on the parent without the guard. The diagnostics crate suite passes on WARP.
AI use: Claude Code (Claude Opus 5.5), coordinated by Codex (gpt-6.2-sol). I ran the commands above and report their real output.
@Marvisak on GitHub · 2026-11-26 05:44 UTC · original
Automated triage for the maintainers.
Verdict: merge candidate. This is a small robustness fix in
crates/victory-gpu/src/pipeline/make.rs.Pending::makenow runsHostPipeline::newinsidecatch_unwind(through a newmake_with). A panic is logged and recorded as a refused pipeline (made = Some(None)). Before, a panic insideOnceLock::get_or_initwould end the pipeline worker thread and leave the pipeline pending, and draws waiting on it would wait for nothing.I checked that the loader's panic hook (
victory-loader/src/crash.rs,log_crashes_to) only logs and doesn't abort, so the panic is still written to the crash log and the worker carries on. The workspace doesn't setpanic = "abort". The diagnostics-onlylibrary::LAST.take()it clears exists onmain. After the refusal,makestill notifiesDONE, so waiting draws wake up. The new testpanicking_pipeline_is_refusedneeds no device. A tester above reports it failing without the guard and passing with it.CI: passing (
check). Recommending a look, not approving.Generated by Claude Code
@kotekompotek on GitHub · 2026-11-26 02:22 UTC · original · reviewed
Verified: a panic inside HostPipeline::new on a worker thread previously took the process down; catching it and returning None makes the pending pipeline refused (made=Some(None)), which is the established failure shape callers already handle. Payload extraction covers both &str and String, and the diagnostics LAST.take() keeps the library state from being trusted after a panic.
@fuzeofficlal on GitHub · 2026-11-26 02:41 UTC · original · reviewed
Reviewed
38c1ddf0againstmain(63bcca43) — clean panic containment and ready to merge:crates/victory-gpu/src/pipeline/make.rs:92-123recordsSome(None)on caught unwind, clears the thread-local diagnostic marker, and wakes waiters; the worker releasesQUEUESbefore invokingmakeand still decrementsWAITINGafterward (320-347).Held::drop(library.rs:105-124, 262-293), state mutex acquisition recovers from poison, shader translation precedes disk-cache staging creation, and the new test verifies refusal cleanly.@kotekompotek on GitHub · 2026-11-26 02:44 UTC · original · approved these changes
LGTM — semantics verified. Before this, a panic inside get_or_init left the OnceLock unset: any waiter would retry the same panicking build (and the worker dies on unwind). Some(None) makes the refusal deterministic and lets the caller fall back. LAST.take() under diagnostics is the right hygiene — no stale in-progress record for a build that never finished. The test asserts exactly the discriminating state (made set, value None).
@Dukestar69 on GitHub · 2026-11-26 07:09 UTC · original · approved these changes
Tested locally merged onto
origin/main(63bcca4) on Windows 11 x64:cargo test -p victory-gpu --features diagnostics pipeline::make::tests -- --test-threads=1: 4 passed, 0 failed (includingpanicking_pipeline_is_refused).cargo clippy -p victory-gpu --features diagnostics --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@futurepro62 on GitHub · 2026-11-26 10:31 UTC · original
NVIDIA full-suite run, to go with the reports above by Dukestar69, oni-swr, since none of them names a GPU run. Tested exact head
38c1ddf(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.panicking_pipeline_is_refused.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.