GPU: catch driver shader compiler crashes in pipeline workers and skip bad keys #3292
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!3292
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3292"
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?
@pushkarreddyy on GitHub · 2026-11-26 16:10 UTC · original
pushkarreddyy:fix/gpu-pipeline-compiler-veh→main· +405 −57 · 2 files · 1 commits · openSummary
Adds a lock-free vectored exception handler (VEH) guard and bad-pipeline skip list (
warm-bad.txt) for background pipeline compilation workers, preventing process-wide deadlocks and crashes when a GPU driver's shader compiler (such asamdxc64.dllon RDNA4) faults insideHostPipeline::new(addresses #2124, #2517).Root Cause
Pending::makeusedOnceLock::get_or_init, so if a worker thread faulted inside the driver's shader compiler, any caller waiting on thatPendingpipeline deadlocked forever.WAITINGcount and worker slot with it, starving the pipeline queue.Changes
crates/victory-gpu/src/pipeline/make.rs:OnceLock::get_or_initwithmade.get().is_none()+made.set(...)so waiters are never stuck behind a faulted worker.guard_start/compiler_crashedVEH +victory-pipeline-watchthread (VICTORY_COMPILER_GUARD=0to disable) that records the faulting pipeline key inwarm-bad.txt(VICTORY_WARM_BAD=0to ignore), publishesNone, decrementsWAITING, and spawns a replacement worker (spawn_worker).a_pipeline_on_the_bad_list_is_not_compiledunit test.crates/victory-gpu/src/pipeline/library.rs:folder()forwarm-bad.txtlookup/persistence.Testing & Verification
a_pipeline_on_the_bad_list_is_not_compiledincrates/victory-gpu/src/pipeline/make.rs.No game files used.
AI-assisted: yes (Gemini 4 Neon)
@Aniseto on GitHub · 2026-11-26 16:27 UTC · original
Ran the pipeline-worker guard tests at
5a8b4d7on an NVIDIA Blackwell desktop part:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by
rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build.The three tests that ran are
draws_go_ahead_of_early_starts,first_use_is_made_by_a_workeranda_pipeline_on_the_bad_list_is_not_compiled; all pass here. The PR has no comments yet, so this is the first datapoint in the thread. These are CPU-side tests of the worker and bad-key logic; I did not inject a real fault inside a driver shader compiler, so the vectored exception handler path itself was not exercised.Not tested: an actual crash inside a driver shader compiler, the VEH guard under a real fault, the full workspace suite, a paired smoke run, AMD hardware (the reported
amdxc64.dllcase), Intel GPUs, native wave64 hosts, Wine, release profile, game data.AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@oni-swr on GitHub · 2026-11-26 16:55 UTC · original
Independent verification of #3292 (claimed on #1633). Test report only, no code changes. AI use: Claude Code (Claude Sonnet 5.5), run on behalf of oni-swr.
5a8b4d714b149048763053d13ad30d32f54b1409. Control:main=63bcca43c6a00a758510398fa43096ce7e4f7df0(the PR's merge base).VICTORY_WARP=1,VICTORY_D3D12_WARP=1,VICTORY_DXIL= Windows SDK 10.0.26100.0dxil.dll. No game files.cargo test -j 4 -p victory-gpu --lib --locked(also--features diagnosticson head).--features diagnostics--skip waits_end_on_ticks(host at 100% CPU)Claimed test:
pipeline::make::tests::a_pipeline_on_the_bad_list_is_not_compiledexists at head and passes (3/3).Does it catch a bug on main? Not in the form shipped. Copied onto main as is, it does not compile (
SKIPPED_BADandbad_keysexist only in the PR). I then removed its bad-list-only lines (bad_keys(...), theSKIPPED_BADcounter) and ran the rest on main: it passes. The test builds aPendingwith no shaders, so main also ends atSome(None); its only discriminating assertion is theSKIPPED_BADcounter, which is new in the PR. So it checks that the skip list is consulted, not that a crashing compile is survived. It does not writewarm-bad.txt: it only touches the in-memory set and reads the file.Not covered by any test: the VEH guard,
compiler_crashed, the watch thread, the replacement worker, and theOnceLock::get_or_inittoget().is_none()+setchange. I did not reproduce a driver fault, so I did not verify the deadlock fix. The Testing section of the PR asks for testers on RDNA4, NVIDIA and Intel; I had none of these.Flake, not caused by this PR:
frame::tests::waits_end_on_ticks_and_count_frames(frame.rs, untouched here) passed in the first runs (head 4/4, main 1/1). Once other processes pinned the host at 100% CPU it failed every time on both main (7/7) and head (9/9), including run alone (left: 0, right: 1). It is a timing assertion; head and main behave the same.Not verified: any physical GPU, a real compiler crash, clippy and rustfmt.
@Dukestar69 on GitHub · 2026-11-26 17:11 UTC · original · approved these changes
Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090):
warm-bad.txt(opt-out viaVICTORY_WARM_BAD=0), and avoidingOnceLock::get_or_initblocking forever on a crashed worker is clean and well-tested.cargo test -p victory-gpu --lib pipeline:: -- --test-threads=1(RTX 5090): 24 passed, 0 failed (includinga_pipeline_on_the_bad_list_is_not_compiled).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@rpmaster2 on GitHub · 2026-11-26 17:41 UTC · original
RDNA4 (RX 9070 XT) datapoint on
5a8b4d7: the offline pipeline phase, no game run.Host: Radeon RX 9070 XT 16 GB, Adrenalin 26.11.2 (32.0.32029.2010), Ryzen 5 5600, 32 GB RAM, Windows 11 10.0.26100.9974. Head
5a8b4d7(base63bcca4), diagnostics build,--locked.Command:
victory translate --cache --pipelines --jobs 8over the title's shader pack, into a separate cache directory. 28.9 minutes wall clock:Exit code 0, zero first-chance exceptions, zero unhandled exceptions, no panics, and no
warm-bad.txtwas written: the driver's compiler did not fault in this run, so the guard was not exercised.What that means for this PR: this is a negative control, not a VEH test. The same phase faulted reliably on this card on
mainbefore850b66f(the history in #1785 and #2124), and it does not with850b66fin the tree, which this base has. So it is consistent with the reports in #1785 rather than evidence about the handler.To exercise the fault path one would need either a head without
850b66for a pipeline that still faults with it; I did not find one in this pack (28,164 pipelines). The handler did not make anything worse: the run is clean and the library saves.Refusals, for comparison with #1785: 852 rasteriser state not named, 139 depth-stencil state not named, 24 compute shader does not translate, 23 shader not found, 3 blend state not named, 2 stages other than vertex/mesh/pixel, 1 pixel shader does not translate.
AI-assisted: written by DeepSeek (OpenCode harness) from my run log; commits, counts and driver version only, no game files or paths.
@pushkarreddyy on GitHub · 2026-11-26 18:46 UTC · original
@Marvisak Please review and merge this PR. Testers, kindly run on untested GPU models. AI‑assisted ✅ Gemini‑4 Neon
@borosf on GitHub · 2026-11-26 19:03 UTC · original
Independent local verification on Windows 11 x64, Intel Arc B580 12 GB (12 cores), at this PR's head
5a8b4d7:Result: victory-gpu lib: 230 passed / 2 failed (both known baseline); the new a_pipeline_on_the_bad_list_is_not_compiled test passed.
Both clippy runs exit 0 (-D warnings, both feature sets). The B580 baseline failures pristine main also hits are: victory-gpu descriptor::host::tests::dynamic_slots_are_held_until_released + memory::tests::lists_share_a_table_and_copies_keep_their_views (#1744/#1829); victory-shader emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros + emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products. No PR regressions.
Synthetic tests only; no game data used. Full log kept locally. — borosf
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.