GPU: remember pipelines whose creation crashed the process (VICTORY_PIPELINE_JOURNAL) #491

Open
github-bot wants to merge 11 commits from github-bot/gh-491 into main AGit
Owner

@⁠desplmfao on GitHub · 2026-11-24 04:03 UTC · original
desplmfao:diag/pipeline-journal → main · +776 −0 · 4 files · 11 commits · open

Problem

Some host drivers crash while compiling a translated shader. Under Wine (vkd3d-proton) the fault inside vkCreate*Pipelines ends the process with exit code 3 before any handler runs (err:vulkan:vkCreateComputePipelines Exception 0xc0000005 in Unix call), so crashes.log stays empty, nothing names the shader, and the same crash comes back at the same point on every run (#144, #49).

Change

With VICTORY_PIPELINE_JOURNAL=1, each host pipeline is noted in pipeline-journal/pending/ (next to the pipeline cache) 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 is added to pipeline-journal/crashed.txt and refused from then on, its draws and dispatches dropped like those of any refused pipeline, and the log names it. Pipelines are still created in parallel. A crash that leaves one note names that pipeline. A crash that leaves several makes them suspects (pipeline-journal/suspects.txt): they are not refused, but each is created alone (the other workers wait) until its creation returns, so a repeat crash leaves one note and names it. Deleting a line from crashed.txt lets that pipeline be tried again. Off by default; nothing changes without it.

New pipeline/journal.rs; a hook at the start of host pipeline creation in pipeline/host.rs; the folder set next to the pipeline cache in pipeline.rs; a paragraph in the README.

Tested

RTX 5080, Linux (proton-cachyos, vkd3d-proton 3.2.0), Series X 1.0.2.1, this branch alone (main d2a4bae + this commit, without #259), its own cache folder:

  1. Run 1: vkCreateComputePipelines Exception 0xc0000005 while loading; one note left, pending/ef05293f6107fc99@32-67.
  2. Run 2: at start, the last run ended while creating these host pipelines; they are refused from now on pipelines=["ef05293f6107fc99"], and crashed.txt lists it. The title got past it to the next crash, again with one note: 9938c251a313fe28.

Both are compute programs whose pipeline creation crashes the NVIDIA driver, fixed in #259. Before pipelines were created one at a time, a crash left several notes and the others had to be removed by hand.

Update: the first version created all pipelines one at a time while the journal was on. With the wave64 programs of #233/#439, which take seconds each to compile, the pipeline backlog at the loading screen shrank by about 0.1 per second instead of about 5, with seven of the eight pipeline workers idle. afedb15 creates them in parallel again and only isolates suspects.

Four tests in journal.rs (no GPU): a note left by a crash refuses that pipeline on the next start and lists it; a pipeline whose line was removed is tried again; notes left by pipelines created together become suspects, a suspect is created alone and leaves the list when it succeeds, and a suspect that crashes alone is refused; ordinary pipelines are created together. They pass under Wine; cargo clippy and rustfmt report nothing new.

  • #259: fixes the shaders this caught here.
  • #279: its VICTORY_SHADER_DUMP writes the container and DXIL of a shader by the same hash, for looking at what the journal names.
  • #121: what a GPU failure report should carry; crashed.txt would belong in one for a driver crash under Wine.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠desplmfao** on GitHub · 2026-11-24 04:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/491) `desplmfao:diag/pipeline-journal` → `main` · +776 −0 · 4 files · 11 commits · open ## Problem Some host drivers crash while compiling a translated shader. Under Wine (vkd3d-proton) the fault inside `vkCreate*Pipelines` ends the process with exit code 3 before any handler runs (`err:vulkan:vkCreateComputePipelines Exception 0xc0000005 in Unix call`), so `crashes.log` stays empty, nothing names the shader, and the same crash comes back at the same point on every run (#144, #49). ## Change With `VICTORY_PIPELINE_JOURNAL=1`, each host pipeline is noted in `pipeline-journal/pending/` (next to the pipeline cache) 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 is added to `pipeline-journal/crashed.txt` and refused from then on, its draws and dispatches dropped like those of any refused pipeline, and the log names it. Pipelines are still created in parallel. A crash that leaves one note names that pipeline. A crash that leaves several makes them suspects (`pipeline-journal/suspects.txt`): they are not refused, but each is created alone (the other workers wait) until its creation returns, so a repeat crash leaves one note and names it. Deleting a line from `crashed.txt` lets that pipeline be tried again. Off by default; nothing changes without it. New `pipeline/journal.rs`; a hook at the start of host pipeline creation in `pipeline/host.rs`; the folder set next to the pipeline cache in `pipeline.rs`; a paragraph in the README. ## Tested RTX 5080, Linux (proton-cachyos, vkd3d-proton 3.2.0), Series X 1.0.2.1, this branch alone (`main` `d2a4bae` + this commit, without #259), its own cache folder: 1. Run 1: `vkCreateComputePipelines Exception 0xc0000005` while loading; one note left, `pending/ef05293f6107fc99@32-67`. 2. Run 2: at start, `the last run ended while creating these host pipelines; they are refused from now on pipelines=["ef05293f6107fc99"]`, and `crashed.txt` lists it. The title got past it to the next crash, again with one note: `9938c251a313fe28`. Both are compute programs whose pipeline creation crashes the NVIDIA driver, fixed in #259. Before pipelines were created one at a time, a crash left several notes and the others had to be removed by hand. Update: the first version created all pipelines one at a time while the journal was on. With the wave64 programs of #233/#439, which take seconds each to compile, the pipeline backlog at the loading screen shrank by about 0.1 per second instead of about 5, with seven of the eight pipeline workers idle. `afedb15` creates them in parallel again and only isolates suspects. Four tests in `journal.rs` (no GPU): a note left by a crash refuses that pipeline on the next start and lists it; a pipeline whose line was removed is tried again; notes left by pipelines created together become suspects, a suspect is created alone and leaves the list when it succeeds, and a suspect that crashes alone is refused; ordinary pipelines are created together. They pass under Wine; `cargo clippy` and `rustfmt` report nothing new. ## Related - #259: fixes the shaders this caught here. - #279: its `VICTORY_SHADER_DUMP` writes the container and DXIL of a shader by the same hash, for looking at what the journal names. - #121: what a GPU failure report should carry; `crashed.txt` would belong in one for a driver crash under Wine. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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 <[email protected]>
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 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	README.md
#	crates/victory-gpu/src/pipeline/host.rs
Suggested by YaBulochka in #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 <[email protected]>
fromthemoonx found in #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 <[email protected]>
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 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:05:59 +00:00
Author
Owner

@⁠fromthemoonx on GitHub · 2026-11-24 11:09 UTC · original

Tested 24c419b merged onto current main (ffe310e, merges cleanly) natively on Windows.

Environment: Windows 11 Pro build 26300, AMD Ryzen 7 5700X, 16 GB, NVIDIA GeForce RTX 3060 12 GB (driver 610.88), Rust 1.98.1 x86_64-pc-windows-msvc.

CI's commands, on the merge: both clippy runs (-D warnings, with and without --all-features) clean; cargo test --workspace --locked: 344 passed, 0 failed, 6 ignored. The victory-gpu lib tests also pass with VICTORY_PIPELINE_JOURNAL=1 set (52 passed).

Two ways a pipeline gets refused without having crashed anything. A throwaway test (not pushed) runs the test binary again as a child process against a temporary journal folder:

scenario result
the child calls enter("eeee…") and then exits normally (std::process::exit(0), exit code 0) at the next Journal::open, eeee… is refused and written to crashed.txt
our process holds enter("ffff…") (a pipeline being created) while another process opens the same journal the other process refuses ffff… and writes it to crashed.txt
  • Exit during creation. pending/ can't tell a crash from any other way the process ends while a pipeline is being created. Closing the window while shaders compile, ExitProcess from the title, or a crash elsewhere on another thread all leave the note. With pipelines made by worker threads during loading, quitting mid-load would blacklist whichever pipeline was in flight, permanently and with a "creating it ended an earlier run" warning.
  • Two processes. A second process (two victory instances, or victory translate --pipelines next to a running title) finds the first one's in-flight note and lists it as crashed.

Possible ways to narrow it, none of them tested here:

  • In open, skip notes whose process id (already in the file name) is still running.
  • Remove notes on a clean shutdown, or have the crash reporter confirm the crash.
  • Refuse a pipeline only after its note has been left twice. One extra crash per bad pipeline, but no permanent false refusals.

Since the journal is opt-in and crashed.txt is editable, this is about how much to trust the list rather than a correctness problem for default runs.

Smaller note: the key string (hash+hash) is built for every host pipeline even with the journal off. It's cheap next to pipeline creation, but it could move behind the journal() check.

Not tested: a real driver crash during creation (none reproduces on this GPU), Wine/vkd3d-proton; no game data used.

AI-assisted (Claude Code) ran the checks and drafted this comment.

**@⁠fromthemoonx** on GitHub · 2026-11-24 11:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/491#issuecomment-7129735111) Tested `24c419b` merged onto current `main` (`ffe310e`, merges cleanly) natively on Windows. **Environment:** Windows 11 Pro build 26300, AMD Ryzen 7 5700X, 16 GB, NVIDIA GeForce RTX 3060 12 GB (driver 610.88), Rust 1.98.1 `x86_64-pc-windows-msvc`. **CI's commands, on the merge:** both clippy runs (`-D warnings`, with and without `--all-features`) clean; `cargo test --workspace --locked`: 344 passed, 0 failed, 6 ignored. The `victory-gpu` lib tests also pass with `VICTORY_PIPELINE_JOURNAL=1` set (52 passed). **Two ways a pipeline gets refused without having crashed anything.** A throwaway test (not pushed) runs the test binary again as a child process against a temporary journal folder: | scenario | result | |---|---| | the child calls `enter("eeee…")` and then exits **normally** (`std::process::exit(0)`, exit code 0) | at the next `Journal::open`, `eeee…` is refused and written to `crashed.txt` | | our process holds `enter("ffff…")` (a pipeline being created) while **another process** opens the same journal | the other process refuses `ffff…` and writes it to `crashed.txt` | - **Exit during creation.** `pending/` can't tell a crash from any other way the process ends while a pipeline is being created. Closing the window while shaders compile, `ExitProcess` from the title, or a crash elsewhere on another thread all leave the note. With pipelines made by worker threads during loading, quitting mid-load would blacklist whichever pipeline was in flight, permanently and with a "creating it ended an earlier run" warning. - **Two processes.** A second process (two `victory` instances, or `victory translate --pipelines` next to a running title) finds the first one's in-flight note and lists it as crashed. Possible ways to narrow it, none of them tested here: - In `open`, skip notes whose process id (already in the file name) is still running. - Remove notes on a clean shutdown, or have the crash reporter confirm the crash. - Refuse a pipeline only after its note has been left twice. One extra crash per bad pipeline, but no permanent false refusals. Since the journal is opt-in and `crashed.txt` is editable, this is about how much to trust the list rather than a correctness problem for default runs. Smaller note: the key string (`hash+hash`) is built for every host pipeline even with the journal off. It's cheap next to pipeline creation, but it could move behind the `journal()` check. **Not tested:** a real driver crash during creation (none reproduces on this GPU), Wine/vkd3d-proton; no game data used. AI-assisted (Claude Code) ran the checks and drafted this comment.
Author
Owner

@⁠fromthemoonx on GitHub · 2026-11-24 13:34 UTC · original

Re-tested 027926b merged onto main ffe310e (same RTX 3060 machine). Running pipelines in parallel and isolating only suspects is a good change for loading time.

  • CI's commands, on the merge: both clippy runs (-D warnings, with and without --all-features) clean; cargo test --workspace --locked: 346 passed, 0 failed, 6 ignored. All four journal tests pass.

  • The two cases from my earlier comment, re-run with the same throwaway child-process test:

    scenario result on 027926b
    child calls enter("eeee…") and exits normally (exit code 0) eeee… is refused at the next start and written to crashed.txt
    another process opens the journal while ours is creating ffff… it refuses ffff… and writes it to crashed.txt

    A single note still means "refused", so both still blacklist a pipeline that didn't crash. The suspects path helps when a crash leaves several notes, but quitting during loading with exactly one pipeline in flight, or a second instance, still lands in crashed.txt. Treating a lone note as a suspect too (refusing only after it is left again while created alone), or skipping notes whose process id is still running, would cover both.

AI-assisted (Claude Code); synthetic tests only, no game data.

**@⁠fromthemoonx** on GitHub · 2026-11-24 13:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/491#issuecomment-7133016728) Re-tested `027926b` merged onto `main` `ffe310e` (same RTX 3060 machine). Running pipelines in parallel and isolating only suspects is a good change for loading time. - **CI's commands, on the merge:** both clippy runs (`-D warnings`, with and without `--all-features`) clean; `cargo test --workspace --locked`: 346 passed, 0 failed, 6 ignored. All four `journal` tests pass. - **The two cases from my earlier comment, re-run with the same throwaway child-process test:** | scenario | result on `027926b` | |---|---| | child calls `enter("eeee…")` and exits normally (exit code 0) | `eeee…` is refused at the next start and written to `crashed.txt` | | another process opens the journal while ours is creating `ffff…` | it refuses `ffff…` and writes it to `crashed.txt` | A single note still means "refused", so both still blacklist a pipeline that didn't crash. The suspects path helps when a crash leaves several notes, but quitting during loading with exactly one pipeline in flight, or a second instance, still lands in `crashed.txt`. Treating a lone note as a suspect too (refusing only after it is left again while created alone), or skipping notes whose process id is still running, would cover both. AI-assisted (Claude Code); synthetic tests only, no game data.
Author
Owner

@⁠YaBulochka on GitHub · 2026-11-24 18:45 UTC · original

Confirmed on Linux/RADV, and on this title it is the difference between a hard wall and reaching the intro. Build ffe310e + #994 + this PR; Wine 11.22 in a Proton 11.0 prefix (vkd3d-proton from Proton, DXVK dxgi), RADV from Mesa 26.3.1, RX 7600 XT, VICTORY_PIPELINE_JOURNAL=1.

Three runs of the retail title, cold shader cache:

run refused pending left mesh pipelines outcome
1 1 4e296b1885c37b29@32-23 3 died while creating that compute pipeline
2 2 5 (8bb272e763f76148@32-35 + suspects) 20 past both refused ones, died on the next compute pipeline, 6.8 fps
3 2 1 3 alive, the intro's title cards render, 0.6–1.6 fps, 7.7 GB VRAM

So the mechanics work exactly as described: the note names the pipeline that ended the process, it is refused on the next start, and each run buys one more shader. After two refusals the run no longer dies in vkCreate*Pipelines at all — the remaining stop is the title's own fault at +0x23cf683 during Prestream Metadata, and before that it plays the intro. The cost is visible and honest: 20 draws/dispatches dropped for the two refused pipelines, one line per pipeline in the log.

Two small suggestions, if you want them:

  • the note carries only <hash>@<something>; adding the stage and the container size to the file name (or a sidecar) would make pending/ readable without going back to the log;
  • when a pipeline is refused at start-up, it would help to say up front how many draws/dispatches will be dropped from then on (the run-time victory_gpu::draw line does that, the start-up line does not).

I can rerun with any build you want, or hand over the two hashes with their stage and container size if you'd like to look at the shaders themselves.

**@⁠YaBulochka** on GitHub · 2026-11-24 18:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/491#issuecomment-7141115467) **Confirmed on Linux/RADV, and on this title it is the difference between a hard wall and reaching the intro.** Build `ffe310e` + #994 + this PR; Wine 11.22 in a Proton 11.0 prefix (vkd3d-proton from Proton, DXVK `dxgi`), RADV from Mesa 26.3.1, RX 7600 XT, `VICTORY_PIPELINE_JOURNAL=1`. Three runs of the retail title, cold shader cache: | run | refused | pending left | mesh pipelines | outcome | |---|---|---|---|---| | 1 | 1 | `4e296b1885c37b29@32-23` | 3 | died while creating that compute pipeline | | 2 | 2 | 5 (`8bb272e763f76148@32-35` + suspects) | 20 | past both refused ones, died on the next compute pipeline, 6.8 fps | | 3 | 2 | 1 | 3 | **alive, the intro's title cards render**, 0.6–1.6 fps, 7.7 GB VRAM | So the mechanics work exactly as described: the note names the pipeline that ended the process, it is refused on the next start, and each run buys one more shader. After two refusals the run no longer dies in `vkCreate*Pipelines` at all — the remaining stop is the title's own fault at `+0x23cf683` during `Prestream Metadata`, and before that it plays the intro. The cost is visible and honest: 20 draws/dispatches dropped for the two refused pipelines, one line per pipeline in the log. Two small suggestions, if you want them: - the note carries only `<hash>@<something>`; adding the stage and the container size to the file name (or a sidecar) would make `pending/` readable without going back to the log; - when a pipeline is refused at start-up, it would help to say up front how many draws/dispatches will be dropped from then on (the run-time `victory_gpu::draw` line does that, the start-up line does not). I can rerun with any build you want, or hand over the two hashes with their stage and container size if you'd like to look at the shaders themselves.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:21 UTC · original · edited 2026-11-25 18:41 UTC

Automated triage for the maintainers.

Merge candidate (re-checked on 16200ab). The PR adds an opt-in diagnostic, VICTORY_PIPELINE_JOURNAL=1, in crates/victory-gpu/src/pipeline/journal.rs. While HostPipeline::new creates a pipeline, it writes a note in pipeline-journal/pending/. At the next start, a single leftover note refuses that pipeline: it goes into crashed.txt, which is tied to the translator hash. Several leftover notes become suspects, and each suspect is created alone for at most 5 s. Notes from a process that is still running are skipped. With the variable unset, nothing changes. No dependencies change.

New since the last review (f4f3364): in Journal::release, only a suspect's own return restarts the alone_for window. Before, any shared pipeline returning restarted it. This closes the gap noted last time, where the 5 s bound could stretch while in-flight pipelines drain. The window is still set when a suspect starts waiting (take_alone). It is cleared when no suspect holds or waits. blocks/left bound every wait. By my reading the gate logic in take_shared, take_alone and release is consistent. The new test a_waiting_suspect_does_not_restart_its_window_as_others_return exercises the case.

On your reply: 16200ab addresses the window restart as described.

CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/491#issuecomment-7148417462) · edited 2026-11-25 18:41 UTC <!-- victory-triage v1 head=16200aba750a77cf0f550f9af7259ac9d3964c25 verdict=merge-candidate at=2026-11-25T18:40:47Z --> Automated triage for the maintainers. **Merge candidate (re-checked on `16200ab`).** The PR adds an opt-in diagnostic, `VICTORY_PIPELINE_JOURNAL=1`, in `crates/victory-gpu/src/pipeline/journal.rs`. While `HostPipeline::new` creates a pipeline, it writes a note in `pipeline-journal/pending/`. At the next start, a single leftover note refuses that pipeline: it goes into `crashed.txt`, which is tied to the translator hash. Several leftover notes become suspects, and each suspect is created alone for at most 5 s. Notes from a process that is still running are skipped. With the variable unset, nothing changes. No dependencies change. New since the last review (`f4f3364`): in `Journal::release`, only a suspect's own return restarts the `alone_for` window. Before, any shared pipeline returning restarted it. This closes the gap noted last time, where the 5 s bound could stretch while in-flight pipelines drain. The window is still set when a suspect starts waiting (`take_alone`). It is cleared when no suspect holds or waits. `blocks`/`left` bound every wait. By my reading the gate logic in `take_shared`, `take_alone` and `release` is consistent. The new test `a_waiting_suspect_does_not_restart_its_window_as_others_return` exercises the case. On your reply: `16200ab` addresses the window restart as described. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠desplmfao on GitHub · 2026-11-25 03:53 UTC · original · edited 2026-11-25 03:54 UTC

@⁠YaBulochka thanks for the RADV runs. Both suggestions are in afb8752:

  • A note in pending/ is now named <key>@<stages and sizes>@<pid>-<n>, e.g. 4e296b1885c37b29@compute-2232@32-23. When it becomes a refusal, the same detail goes in as a comment above the pipeline's line in crashed.txt (# compute-2232).
  • At start-up, the refused pipelines are listed with a warning that every draw and dispatch using one is dropped. The count itself can't be known at start-up, since it depends on what the title asks for later. Each pipeline is still logged once when it is first skipped.

The branch is also merged with current main again (577052a), which resolves the pipeline/host.rs conflict from the triage. The journal tests pass: 5 of 5, including a new one for the named note.

@⁠fromthemoonx thanks for the child-process tests. 8f070ad covers the second-instance case: notes carry their process id, and a note whose process is still running is now skipped and kept, so another instance no longer refuses what the first is creating (test: a_note_of_a_process_still_running_is_left_alone). For quitting while exactly one pipeline is in flight, I kept a lone note as a refusal. Making it a suspect first would cost every real crash a second run, which is exactly what a run like YaBulochka's pays for. The README now says to delete that line from crashed.txt to undo it. The comment above the line names the stages, so it's easy to find. Journal tests: 7 of 7 pass.

**@⁠desplmfao** on GitHub · 2026-11-25 03:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/491#issuecomment-7152333711) · edited 2026-11-25 03:54 UTC @⁠YaBulochka thanks for the RADV runs. Both suggestions are in `afb8752`: - A note in `pending/` is now named `<key>@<stages and sizes>@<pid>-<n>`, e.g. `4e296b1885c37b29@compute-2232@32-23`. When it becomes a refusal, the same detail goes in as a comment above the pipeline's line in `crashed.txt` (`# compute-2232`). - At start-up, the refused pipelines are listed with a warning that every draw and dispatch using one is dropped. The count itself can't be known at start-up, since it depends on what the title asks for later. Each pipeline is still logged once when it is first skipped. The branch is also merged with current `main` again (`577052a`), which resolves the `pipeline/host.rs` conflict from the triage. The journal tests pass: 5 of 5, including a new one for the named note. @⁠fromthemoonx thanks for the child-process tests. `8f070ad` covers the second-instance case: notes carry their process id, and a note whose process is still running is now skipped and kept, so another instance no longer refuses what the first is creating (test: `a_note_of_a_process_still_running_is_left_alone`). For quitting while exactly one pipeline is in flight, I kept a lone note as a refusal. Making it a suspect first would cost every real crash a second run, which is exactly what a run like YaBulochka's pays for. The README now says to delete that line from `crashed.txt` to undo it. The comment above the line names the stages, so it's easy to find. Journal tests: 7 of 7 pass.
Author
Owner

@⁠desplmfao on GitHub · 2026-11-25 13:35 UTC · original

Added 3d6521b after finding a weakness of this PR in the title: entries in crashed.txt never expired.

What happened: under a build from this morning, CS_Prop_BatchNoCull and CS_LaserLightShadowRaytracing overflowed the stack while being made (Grand Theft Auto VI on Linux; the overflow was caught by #2292). The journal listed them, and from then on it skipped them in every run, including later builds where they are made without trouble. I checked that with a cold pipeline library, an empty vkd3d cache and the NVIDIA disk cache off. Their dispatches were dropped for hours for no reason. I only noticed because the frame lines kept naming the same two hashes as refused.

The change:

  • crashed.txt now starts with # translator <hash> (victory_shader::SOURCE_HASH), naming the translator its pipelines crashed under.
  • When the translator differs, or the list has no such line (lists written before this change), the listed pipelines are not refused. Each becomes a suspect: made alone, and listed again under the new translator if it ends the run again.
  • Under the same translator nothing changes: a crashed pipeline stays refused.

Three new tests cover these cases, and the existing ones now expect the header line. cargo test -p victory-gpu --lib pipeline::journal gives 10 passed under Wine on an RTX 5080, and clippy is clean.

The trade-off: a driver or vkd3d update doesn't change the translator hash, so it doesn't re-arm the list on its own. Deleting the line still does that, as before.

**@⁠desplmfao** on GitHub · 2026-11-25 13:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/491#issuecomment-7163997995) Added `3d6521b` after finding a weakness of this PR in the title: entries in `crashed.txt` never expired. **What happened:** under a build from this morning, `CS_Prop_BatchNoCull` and `CS_LaserLightShadowRaytracing` overflowed the stack while being made (Grand Theft Auto VI on Linux; the overflow was caught by #2292). The journal listed them, and from then on it skipped them in every run, including later builds where they are made without trouble. I checked that with a cold pipeline library, an empty vkd3d cache and the NVIDIA disk cache off. Their dispatches were dropped for hours for no reason. I only noticed because the frame lines kept naming the same two hashes as `refused`. **The change:** - `crashed.txt` now starts with `# translator <hash>` (`victory_shader::SOURCE_HASH`), naming the translator its pipelines crashed under. - When the translator differs, or the list has no such line (lists written before this change), the listed pipelines are not refused. Each becomes a suspect: made alone, and listed again under the new translator if it ends the run again. - Under the same translator nothing changes: a crashed pipeline stays refused. Three new tests cover these cases, and the existing ones now expect the header line. `cargo test -p victory-gpu --lib pipeline::journal` gives 10 passed under Wine on an RTX 5080, and clippy is clean. The trade-off: a driver or vkd3d update doesn't change the translator hash, so it doesn't re-arm the list on its own. Deleting the line still does that, as before.
Author
Owner

@⁠desplmfao on GitHub · 2026-11-25 16:18 UTC · original

A bug fix found in the title, in 9bcd755: the gate could deadlock.

Pipeline creation holds the gate until it returns. A pipeline made inside another pipeline's creation (a helper made on the same thread) took the gate a second time. If a suspect held it alone, the thread waited on itself. If the gate was held shared while a suspect waited to hold it alone, the second shared take waited behind the suspect, because SRW locks give a waiting writer priority. In Grand Theft Auto VI on Linux, pipeline creation stopped at 1,721 pipelines being made, at 0 % CPU, for minutes, with 9 suspects listed from runs stopped mid-creation.

A thread now takes the gate once. Nested creations are still noted, so a crash inside one is still named. The new test a_nested_pipeline_does_not_take_the_gate_again (a suspect makes a helper pipeline) times out after 5 s without the fix and passes with it. The tests that simulate a crash with mem::forget now go through a small crash() helper that also clears the thread's hold, as a real crash ending the thread would. pipeline::journal gives 11 passed under Wine, and clippy is clean. #2292 has it merged.

**@⁠desplmfao** on GitHub · 2026-11-25 16:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/491#issuecomment-7167766722) A bug fix found in the title, in `9bcd755`: the gate could deadlock. Pipeline creation holds the gate until it returns. A pipeline made inside another pipeline's creation (a helper made on the same thread) took the gate a second time. If a suspect held it alone, the thread waited on itself. If the gate was held shared while a suspect waited to hold it alone, the second shared take waited behind the suspect, because SRW locks give a waiting writer priority. In Grand Theft Auto VI on Linux, pipeline creation stopped at 1,721 pipelines being made, at 0 % CPU, for minutes, with 9 suspects listed from runs stopped mid-creation. A thread now takes the gate once. Nested creations are still noted, so a crash inside one is still named. The new test `a_nested_pipeline_does_not_take_the_gate_again` (a suspect makes a helper pipeline) times out after 5 s without the fix and passes with it. The tests that simulate a crash with `mem::forget` now go through a small `crash()` helper that also clears the thread's hold, as a real crash ending the thread would. `pipeline::journal` gives 11 passed under Wine, and clippy is clean. #2292 has it merged.
Author
Owner

@⁠desplmfao on GitHub · 2026-11-25 16:42 UTC · original

A second fix from the title, in f4f3364: a suspect now holds other pipelines up for at most 5 s.

A suspect is created alone, so a crash in it is pinned on it. But every other pipeline then waited for as long as that took. In Grand Theft Auto VI the title screen ran at 500 ms per frame, with 1,714 pipelines being made and none finishing. The journal's only note was a suspect (compute-3360) pending since launch, at 0 % CPU: it was not compiling at all. Its creation was waiting on another thread that itself needed the gate, which is the cross-thread version of the deadlock fixed in 9bcd755. Even without that, a large compute shader on a cold driver cache takes minutes, and the title waits for the pipelines queued behind it.

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, and then the others go ahead. If the run ends after that, the suspect is one of several pipelines being created and stays a suspect instead of being refused. The new test a_slow_suspect_holds_others_up_only_for_a_while checks the bound. pipeline::journal gives 12 passed under Wine, and clippy is clean. #2292 has it merged.

**@⁠desplmfao** on GitHub · 2026-11-25 16:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/491#issuecomment-7168419880) A second fix from the title, in `f4f3364`: a suspect now holds other pipelines up for at most 5 s. A suspect is created alone, so a crash in it is pinned on it. But every other pipeline then waited for as long as that took. In Grand Theft Auto VI the title screen ran at 500 ms per frame, with 1,714 pipelines being made and none finishing. The journal's only note was a suspect (`compute-3360`) pending since launch, at 0 % CPU: it was not compiling at all. Its creation was waiting on another thread that itself needed the gate, which is the cross-thread version of the deadlock fixed in `9bcd755`. Even without that, a large compute shader on a cold driver cache takes minutes, and the title waits for the pipelines queued behind it. 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, and then the others go ahead. If the run ends after that, the suspect is one of several pipelines being created and stays a suspect instead of being refused. The new test `a_slow_suspect_holds_others_up_only_for_a_while` checks the bound. `pipeline::journal` gives 12 passed under Wine, and clippy is clean. #2292 has it merged.
Author
Owner

@⁠desplmfao on GitHub · 2026-11-25 16:51 UTC · original

A follow-up to f4f3364, in 16200ab: in the title, the 5 s window restarted every time an ordinary pipeline returned while a suspect was waiting. A suspect waiting behind a busy queue therefore held every pipeline up again and again. All 7 pipeline threads slept while 2,200 pipelines waited, and the queue drained at about 80 a minute.

Now only the suspect's own return starts the next suspect's window. The new test a_waiting_suspect_does_not_restart_its_window_as_others_return holds six pipelines, lets a suspect wait, and returns the six one by one. Before this change a new pipeline waited 601 ms; now it waits under 500 ms (a 300 ms window plus scheduling). pipeline::journal gives 13 passed under Wine, and clippy is clean. #2292 has it merged.

**@⁠desplmfao** on GitHub · 2026-11-25 16:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/491#issuecomment-7168638040) A follow-up to `f4f3364`, in `16200ab`: in the title, the 5 s window restarted every time an ordinary pipeline returned while a suspect was waiting. A suspect waiting behind a busy queue therefore held every pipeline up again and again. All 7 pipeline threads slept while 2,200 pipelines waited, and the queue drained at about 80 a minute. Now only the suspect's own return starts the next suspect's window. The new test `a_waiting_suspect_does_not_restart_its_window_as_others_return` holds six pipelines, lets a suspect wait, and returns the six one by one. Before this change a new pipeline waited 601 ms; now it waits under 500 ms (a 300 ms window plus scheduling). `pipeline::journal` gives 13 passed under Wine, and clippy is clean. #2292 has it merged.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 01:27 UTC · original

Code review and RTX 5090 + WARP verification at head 16200aba750a merged cleanly onto main (63bcca43c6a0):

  • Concurrency & recovery audit (crates/victory-gpu/src/pipeline/journal.rs, pipeline/host.rs:464-474):
    • Each in-flight pipeline writes its own pending/{key}@{detail}@{pid}-{next} file (zero cross-thread file contention), and Journal::open skips live sibling processes (OpenProcess + STILL_ACTIVE).
    • Single leftover pending note marks crashed.txt tagged with # translator {SOURCE_HASH} (auto-demoting to suspects if the translator changes); multiple leftover notes move to suspects.txt and serialize under Gate with a 5s alone_for timeout and thread-local HOLDS_GATE reentrancy guard to prevent deadlocks.
  • Verified (Windows 11, NVIDIA RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1, Rust 1.98.1):
    • cargo xtask policy: 192 files ok; cargo clippy -p victory-gpu --all-targets -- -D warnings (default + --features diagnostics): 0 warnings
    • victory-gpu --lib -- pipeline::: 36/36 passed on RTX 5090 (default) and 39/39 passed on WARP (--features diagnostics), including all 11 new journal tests.

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 01:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/491#issuecomment-7179784669) Code review and RTX 5090 + WARP verification at head `16200aba750a` merged cleanly onto `main` (`63bcca43c6a0`): - **Concurrency & recovery audit (`crates/victory-gpu/src/pipeline/journal.rs`, `pipeline/host.rs:464-474`)**: - Each in-flight pipeline writes its own `pending/{key}@{detail}@{pid}-{next}` file (zero cross-thread file contention), and `Journal::open` skips live sibling processes (`OpenProcess` + `STILL_ACTIVE`). - Single leftover pending note marks `crashed.txt` tagged with `# translator {SOURCE_HASH}` (auto-demoting to suspects if the translator changes); multiple leftover notes move to `suspects.txt` and serialize under `Gate` with a 5s `alone_for` timeout and thread-local `HOLDS_GATE` reentrancy guard to prevent deadlocks. - **Verified (Windows 11, NVIDIA RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`, Rust 1.98.1)**: - `cargo xtask policy`: `192 files ok`; `cargo clippy -p victory-gpu --all-targets -- -D warnings` (default + `--features diagnostics`): 0 warnings - `victory-gpu --lib -- pipeline::`: **36/36 passed** on RTX 5090 (default) and **39/39 passed** on WARP (`--features diagnostics`), including all 11 new journal tests. LGTM.
Author
Owner

@⁠mercuryVM on GitHub · 2026-11-24 12:28 UTC · original · approved these changes

Tested 24c419b on Windows 11, RTX 5070, MSVC: cargo test -p victory-gpu -- --test-threads=1 45 passed, including the journal tests. Clippy's 1 warning is the existing one in host.rs. I couldn't reproduce a driver crash here, so the "next run refuses it" path is covered by the unit tests only.

  • Off by default: with VICTORY_PIPELINE_JOURNAL unset, journal() is None, enter is a no-op and creation stays parallel. With it on, the one mutex serialises creation so a leftover note names only one pipeline. That's the right trade for a diagnostic.
  • Notes and crashed.txt live next to the pipeline cache, which already passes ensure_outside_repo, and they hold only shader hashes. No title bytes are written.
  • Small things:
    • A pending note is only turned into a crashed.txt line at the next start. If the user deletes the cache folder between runs, the knowledge is lost, which is acceptable but worth one README sentence.
    • The ? on journal::enter makes a refused pipeline fail like any other refusal, so the existing drop logging covers it.

AI-assisted (Claude Code).

**@⁠mercuryVM** on GitHub · 2026-11-24 12:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/491#pullrequestreview-6039186689) · **approved these changes** Tested 24c419b on Windows 11, RTX 5070, MSVC: `cargo test -p victory-gpu -- --test-threads=1` 45 passed, including the journal tests. Clippy's 1 warning is the existing one in host.rs. I couldn't reproduce a driver crash here, so the "next run refuses it" path is covered by the unit tests only. - Off by default: with `VICTORY_PIPELINE_JOURNAL` unset, `journal()` is `None`, `enter` is a no-op and creation stays parallel. With it on, the `one` mutex serialises creation so a leftover note names only one pipeline. That's the right trade for a diagnostic. - Notes and `crashed.txt` live next to the pipeline cache, which already passes `ensure_outside_repo`, and they hold only shader hashes. No title bytes are written. - Small things: - A pending note is only turned into a `crashed.txt` line at the next start. If the user deletes the cache folder between runs, the knowledge is lost, which is acceptable but worth one README sentence. - The `?` on `journal::enter` makes a refused pipeline fail like any other refusal, so the existing drop logging covers it. AI-assisted (Claude Code).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 15:54 UTC · original · requested changes

Following up on an earlier pass on 16200aba750a77cf0f550f9af7259ac9d3964c25 (merged onto 63bcca43c6a00a758510398fa43096ce7e4f7df0, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1): all pipeline:: tests pass (36/36 on RTX 5090, 39/39 with --features diagnostics on WARP; clippy default & --all-features clean; xtask policy: 192 files ok), but a closer check turned up two bugs that should be fixed before merge:

1. VICTORY_PIPELINE_JOURNAL=0 enables the journal instead of disabling it (crates/victory-gpu/src/pipeline/journal.rs:72, README.md:171,175)

README.md:171 explicitly states "The on/off switches below (...=1) are off when unset or set to 0." and this PR adds VICTORY_PIPELINE_JOURNAL=1 to that table (README.md:175). However, journal() at journal.rs:72 checks:

**@⁠fuzeofficlal** on GitHub · 2026-11-26 15:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/491#pullrequestreview-6077101167) · **requested changes** Following up on an earlier pass on `16200aba750a77cf0f550f9af7259ac9d3964c25` (merged onto `63bcca43c6a00a758510398fa43096ce7e4f7df0`, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`): all `pipeline::` tests pass (`36/36` on RTX 5090, `39/39` with `--features diagnostics` on WARP; `clippy` default & `--all-features` clean; `xtask policy`: `192 files ok`), **but a closer check turned up two bugs that should be fixed before merge**: ### 1. `VICTORY_PIPELINE_JOURNAL=0` enables the journal instead of disabling it (`crates/victory-gpu/src/pipeline/journal.rs:72`, `README.md:171,175`) `README.md:171` explicitly states *"The on/off switches below (`...=1`) are off when unset or set to `0`."* and this PR adds `VICTORY_PIPELINE_JOURNAL=1` to that table (`README.md:175`). However, `journal()` at `journal.rs:72` checks:
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/491/head:github-bot/gh-491'
git switch 'github-bot/gh-491'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-491'
git switch 'github-bot/gh-491'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-491'
git switch 'github-bot/gh-491'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-491'
git switch 'main'
git merge --squash 'github-bot/gh-491'
git switch 'main'
git merge --ff-only 'github-bot/gh-491'
git switch 'main'
git merge 'github-bot/gh-491'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!491
No description provided.