GPU diagnostics: a pipeline whose creation faults is refused and the title goes on (opt-in, on #491) #2290
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2292"
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?
Imported from Marvisak/VIctory. Originally posted by desplmfao on 2026-11-25T10:03:57Z.
Stacked on #491 (the pipeline journal). Its commits come first here; the change is the last commit,
a690518.Problem
Under Wine/vkd3d-proton, creating a host pipeline runs dxil-spirv and then the driver's compiler inside the title's process. On some translated shaders, one of them faults. Examples here: dxil-spirv recursing about 100k frames on #439's loop shapes, and NVIDIA's compiler crashing on others. A single bad pipeline ends the run. #491 then refuses it from the next run on, but that is one restart per bad pipeline.
Change
Opt-in, with
VICTORY_PIPELINE_SOFT_CRASH=1:pipeline/soft_crash.rs). That covers bothLoad*PipelineandCreate*PipelineState.0xC0000374) and stack-buffer overrun (0xC0000409) are left alone.crashed.txtimmediately, in the existing format plus(fault 0x…), so later runs refuse it too.SetThreadStackGuarantee(64 KiB)so the handler has stack left after an overflow. Pipeline workers get a 256 MiB stack, which is reserved, not committed.Risks
This is why it is opt-in:
virtual_setup_exception stack overflow). The guard can't catch that one; the bigger stack makes it less likely.Related
make.rs(256 and 64 MiB). Expect a one-line conflict; I can drop the stack part here if #1885 lands.VICTORY_SKIP_PIPELINES) have the same goal by different means.Tested
RTX 5080, Linux, Proton with vkd3d-proton 3.2.0:
cargo test -p victory-gpu --lib soft_crash: 6 passed. They cover an access violation (0xC0000005), an illegal instruction (0xC000001D), a deep-recursion stack overflow on a 1 MiB thread (0xC00000FD), values and panics passing through, threads that aren't armed staying unguarded, and the fault-kind filter.cargo test -p victory-gpu --lib journal: 8 passed, includinga_pipeline_whose_creation_faulted_is_refused_now_and_in_later_runs.cargo clippy -p victory-gpu --all-targets -- -D warnings, with and without--features diagnostics: clean.In the title. The build was our stack with #439 but without #2309. There, vkd3d-proton's dxil-spirv recurses until the stack runs out on two of #439's programs, and before this change that ended the process. Run under Proton, with vkd3d-proton 3.2.0,
VICTORY_PIPELINE_SOFT_CRASH=1andVICTORY_PIPELINE_JOURNAL=1:Both are stack overflows (
0xc00000fd) inside vkd3d-proton under Wine, caught 10 s into the run. 383 more pipelines were created after the second one, so no host lock was lost. The title kept running until I stopped it 90 s later.crashed.txtlists both, each with a# compute-… (fault 0xc00000fd)comment.AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T10:19:10Z.
Review: COMMENTED
GPU diagnostics: VICTORY_PIPELINE_JOURNAL crash journal — a pipeline whose creation faults is refused next run, suspects isolated one-by-one (+1034 incl. README). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Ambitious self-healing for driver crashes; the 'quit during single creation looks like a crash' caveat is honest. Windows-only path.
Imported from Marvisak/VIctory. Originally posted by desplmfao on 2026-11-25T11:21:21Z.
Out of draft: it has now caught real faults in the title. Our stack with #439 but without #2309 has two programs on which vkd3d-proton's dxil-spirv recurses until the stack runs out (
32ed072b9f845048,fdd56d97a806bcca); before, the process ended there. WithVICTORY_PIPELINE_SOFT_CRASH=1, both were caught as0xc00000fd10 s into the run, refused, and listed incrashed.txt. 383 more pipelines were created after them, so no lock was lost, and the title kept running until I stopped it. Log lines are in the description.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T13:32:53Z.
Automated triage for the maintainers.
Needs work: needs the maintainer's decision (re-checked on
f33dd8b). The merge ofmainresolves the earlier conflicts, so this merges cleanly again. The PR's own part is unchanged:pipeline/soft_crash.rs: an opt-in (VICTORY_PIPELINE_SOFT_CRASH=1) vectored exception handler plus aglobal_asm!frame with SEH unwind data, which resumes a pipeline worker after a fault in the host compiler;make.rs: thespawn_workerreplacement thread with a 256 MiB reserved stack;The faulted pipeline is refused and the worker is replaced. Handler and frame are scoped to armed workers inside the guarded call, fault-kind codes only, at most 8 faults per run. Whether VIctory should carry this unsafe surface (locks held at the fault stay held, abandoned frames leak) is the maintainer's call, as noted before.
The PR is still stacked on #491 (open), so
journal.rsand its README row belong to that review. Once #491 lands, this PR should shrink tosoft_crash.rs, themake.rsworker changes and one README row.CI: passing (
check).Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by desplmfao on 2026-11-25T13:39:56Z.
Merged #491's new head (
3d6521b) inba6356c.crashed.txtnow names the translator its pipelines crashed under, so a pipeline listed here after a fault is tried again, alone, once the translator changes. The only conflict wasjournal.rs: I kept both module notes, and the soft-crash test now passes the translator toJournal::openand expects the header line.I checked the merged code in Grand Theft Auto VI on Linux (RTX 5080) with two runs:
CS_Prop_BatchNoCullandCS_LaserLightShadowRaytracinglisted under an old translator: both were tried again alone and made, and the list was reset to the current translator.pipeline::journalpasses under Wine.pipeline::library::tests::a_rejected_blob_gives_an_empty_libraryfails under vkd3d-proton on this head and one543c44alike, so that one isn't from this merge.Imported from Marvisak/VIctory. Originally posted by desplmfao on 2026-11-25T14:42:44Z.
Thanks for the triage.
17a48d9. The two paragraphs are now one row in the variables table.main, its diff shows #491'sjournal.rstoo. Once #491 is in, this PR comes down tosoft_crash.rs, the worker spawn inmake.rs, and the README row.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.