Repository navigation
GPU diagnostics: a pipeline whose creation faults is refused and the title goes on (opt-in, on #491) - #2292
GPU diagnostics: a pipeline whose creation faults is refused and the title goes on (opt-in, on #491)#2292desplmfao wants to merge 20 commits into
Conversation
Some host drivers crash while compiling a translated shader. Under Wine the fault inside vkCreate*Pipelines ends the process with exit code 3 before any handler runs, so nothing names the shader and the same crash comes back on every run. With VICTORY_PIPELINE_JOURNAL=1, each host pipeline is noted in pipeline-journal/pending/ while it is created, and the note is removed when creation returns. A note left at the next start names the pipeline that was being created when the process ended: it goes into pipeline-journal/crashed.txt and is refused from then on, its draws and dispatches dropped like those of any refused pipeline. Pipelines are created one at a time while the journal is on, so a crash names only the pipeline that caused it. Off by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A crash with one pipeline in creation names it (crashed.txt) as before. A crash with several in creation makes them suspects (suspects.txt): they are not refused, but each is created alone until its creation returns, so a repeat crash leaves one note and names it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # README.md # crates/victory-gpu/src/pipeline/host.rs
…refused pipelines drop draws Suggested by YaBulochka in Marvisak#491: - A note in pending/ is named <key>@<stages and sizes>@<pid>-<n>, for example 4e296b1885c37b29@compute-2232@32-23, so pending/ can be read without the log. The same goes as a comment above the pipeline's line in crashed.txt. - At start-up, the refused pipelines are listed with a warning that every draw and dispatch using one is dropped. How many is only known once the title asks for them; each is still logged once when first skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fromthemoonx found in Marvisak#491 that a second instance opening the journal refused the pipeline the first one was creating. Notes name their process id; one whose process is still running is now skipped and kept. The README says how to undo the refusal a quit during creation causes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(VICTORY_PIPELINE_SOFT_CRASH) The pipeline journal learns of a pipeline that crashes the host's compilers (dxil-spirv's deep recursion, the driver's compiler) only after the process has died, one restart per pipeline. With VICTORY_PIPELINE_SOFT_CRASH=1, pipeline workers survive such a fault: - loads and creations in `library::pipeline` run through a small assembly frame (`soft_crash::guarded`) with unwind data. A vectored handler, on an armed thread inside such a call, points the faulting context back at that frame, which returns the exception code. Faults of the error kind only (not C++ or other software exceptions; not heap corruption); - the pipeline is refused for the rest of the run and appended to the journal's crashed.txt at once (with its stages, sizes and the code), logged once with the code and address; - the worker that faulted hands its place to a fresh thread (its stack may have lost its guard page); - after 8 faults, faults are left alone and end the process as before. Pipeline workers also get a 256 MiB stack (reserved only), and armed threads keep 64 KiB for handling an overflow. Nothing between the fault and the frame is unwound: locks and memory the host held then are lost, which is why it is opt-in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
catminou4
left a comment
There was a problem hiding this comment.
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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 ( |
|
Automated triage for the maintainers. Needs work: needs the maintainer's decision (re-checked on
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 CI: passing ( Generated by Claude Code |
crashed.txt now starts with the translator its pipelines crashed under (# translator <source hash>). When the translator has changed, or the list has no such line, the listed pipelines are not refused: each becomes a suspect, made alone, and is listed again (under the new translator) if it ends the run again. Found in Grand Theft Auto VI on Linux: CS_Prop_BatchNoCull and CS_LaserLightShadowRaytracing overflowed the stack while being made under a morning build, and the journal skipped them in every run after, including builds where they are made fine (checked with a cold pipeline library and vkd3d cache). Their dispatches were dropped for hours for nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…slator they crashed under Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged #491's new head ( I checked the merged code in Grand Theft Auto VI on Linux (RTX 5080) with two runs:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the triage.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # README.md
…ot take it again A run hung at 0 % CPU with 9 suspects listed: pipeline creation holds the gate until it returns, and a pipeline made inside another's creation (a helper) took it again on the same thread. Held alone by a suspect, that waits on itself; held shared while a suspect waits to hold it alone, the second shared take waits behind the suspect (SRW locks give a waiting writer priority). A thread now takes the gate once; nested creations are still noted, so a crash inside one is still named. Found in Grand Theft Auto VI on Linux: pipeline creation stopped at 1,721 pipelines being made, 0 % CPU, for minutes, with suspects.txt holding 9 pipelines from runs stopped mid-creation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… per thread Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A suspect (a pipeline being created when an earlier run ended) is created alone so that a crash in it is pinned on it. But other pipelines then wait as long as it takes: minutes for a large compute shader on a cold driver cache, or for ever if its creation waits on another thread that itself needs the gate. The title waits for the pipelines queued behind it, so the title screen ran at 500 ms per frame. The gate is now a mutex and condition variable instead of an RwLock: a suspect holds it alone (or waits to) for at most 5 s, then the others go ahead. If the run ends after that, the suspect is one of several being created and stays a suspect instead of being refused. Found in Grand Theft Auto VI on Linux: the title screen at 500 ms per frame with 1,714 pipelines being made and none finishing, the journal's only note a suspect (compute-3360) pending since launch at 0 % CPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…waiting for at most 5 s Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s gate time cap Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t's window f4f3364 restarted the window at every return while a suspect waited, so a suspect waiting behind a busy queue held every pipeline up again and again: in the title, 7 pipeline threads slept while 2,200 pipelines waited, and the queue drained at about 80 a minute. Only the suspect's own return now starts the next suspect's window. The new test holds six pipelines, lets a suspect wait, and returns them one by one: a new pipeline waited 601 ms before this change, under the 300 ms window plus scheduling after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t restarted Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # crates/victory-gpu/src/pipeline.rs # crates/victory-gpu/src/pipeline/library.rs
GPU diagnostics: a pipeline whose creation faults is refused and the title goes on (opt-in, on Marvisak#491) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… new base The renderer README of the old branch (5fff8e0, f44ae53, eb4918e, 9a41398, b673d84, f711b62, 9b32e6f), carried over as one change since main's README moved under each of them: the renderer section with the run command (raw access chains off, VICTORY_PIPELINE_JOURNAL=1, VICTORY_LEVELS_ON_DEMAND=1), and the stack's rows after main's. Adapted: upstream base 67e8ae1; no Marvisak#2366 row (main's 8ff7913 replaces it), no Marvisak#67 row (not in this rebuild); Marvisak#1152 and Marvisak#2389 kept. The journal and soft-crash notes (e543c44) and the breadcrumbs row (1f0d6c3) are not repeated: Marvisak#491's and Marvisak#2292's current heads put them in the variables table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous renderer (old upstream base 940d32f) is the first parent and is also kept as the branch renderer-2026-11-25-oldbase; the second parent is the rebuild: fork main (upstream main 63bcca4 + our pull requests) with the renderer stack merged on it: Marvisak#439 (on main: update/439-main's resolution), Marvisak#2309, Marvisak#2167, Marvisak#2118, Marvisak#2311, Marvisak#1722, Marvisak#1751, Marvisak#688, Marvisak#1872, Marvisak#2292, Marvisak#2310, Marvisak#2112 (opt-in), Marvisak#2230 (latch on by default), Marvisak#2389, Marvisak#2088 (small windows opt-in), Marvisak#2099's new head, and tonight's Marvisak#491 journal fixes. Merged upstream since: Marvisak#2143, Marvisak#2162, Marvisak#158, Marvisak#1906, Marvisak#1152; superseded by main: Marvisak#1769, Marvisak#1763, Marvisak#2366. The picture on this base still shows the overlay that plain upstream main shows too; that is being looked into. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 Shaders, GPU: one back edge per loop header, and a large stack for pipeline threads #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 Shaders: one console wave sharing LDS runs in the console flow on 32-lane hosts #439 but without Shaders: one back edge per block, so vkd3d-proton converts #439's loops (stacked on #439) #2309. There, vkd3d-proton's dxil-spirv recurses until the stack runs out on two of Shaders: one console wave sharing LDS runs in the console flow on 32-lane hosts #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