GPU: a skipped pipeline is not started early either #172

Closed
github-bot wants to merge 1 commit from gh-pr/172/head into gh-pr/172/base
Owner

@⁠ericomeehan on GitHub · 2026-11-24 22:07 UTC · original
team/skip-early → main · +11 −4 · 2 files · 1 commits · closed without merging

VICTORY_SKIP_PIPELINES is only checked when a draw or dispatch runs (draw.rs, via is_skipped). A pipeline is started earlier than that when the title creates it, if an earlier run drew with it: hand_out → make::early → wanted_early → start(p, EARLY). The early list is saved to disk (library::save, every 20 s while workers finish pipelines, and on a normal exit) and only grows. So if a pipeline gets on the list before its host compile crashes the driver, every later run compiles it again at creation, skipped or not, and crashes the same way. The skip doesn't help, and only a fresh cache directory does.

Seen in the field: on #145 (#145), a tester on an RX 9070 XT reports that VICTORY_SKIP_PIPELINES alone did not stop the driver compiler crashes, because the skipped pipeline is still created, early since d279e69. With a local change that doesn't create pipelines whose shader is skipped, plus VICTORY_SHADER_OPT=11 and their two remaining crashing hashes skipped, they had no compiler crash in three runs. Credit to them for finding the gap. Their change sounds broader than this one, which covers only the early start. @⁠hashdev512, if your local version also covers other paths (rectangle draws, say), it may be the better fix, and I'm happy to close this in its favour.

This change:

  • pipeline.rs: skipped_shader takes the pipeline's shaders (&[Arc<Shader>]) instead of the Pipeline, so it can be asked about a Pending too. Matching, its cfg and its two callers' behaviour are unchanged. No new gated item.
  • make.rs: early returns at once when one of the pipeline's shaders is skipped. The check is under #[cfg(feature = "diagnostics")], which (inside the Windows-only make module) is the skip list's current gate.

For dispatches, mesh dispatches and non-rectangle draws, the skip check already returns before host_pipeline is asked, so early was the path left for skipped compute programs. A rectangle-topology draw still asks host_pipeline through completes_rects() before or regardless of the skip check. This PR doesn't change that.

Notes for merging:

  • With #91 or #106 (both move the skip helpers from all(windows, feature = "diagnostics") to windows): one small textual conflict at the skipped_shader signature, in either order. Keep their doc comment and #[cfg(windows)] with this PR's signature. Every way of resolving it builds: skipped_shader stays one function under one gate, and the check in early is diagnostics-only, which falls inside either gate. After both merge, release builds still won't check the skip list in early. Removing that #[cfg] line then would make the check apply there too.
  • With #147 (worker queue rework in make.rs): git merge-tree merges it cleanly, and #147 doesn't change early.

Checked: CI on a copy of this branch (clippy with and without --all-features, tests). There's no new test: the change is one early return, and early needs a device. The race itself comes from reading the code. I haven't reproduced a crash with it, and I couldn't run the title.

Written with an AI assistant (Claude).

🤖 Generated with Claude Code

**@⁠ericomeehan** on GitHub · 2026-11-24 22:07 UTC · [original](https://github.com/fxceless/victory-fork/pull/172) `team/skip-early` → `main` · +11 −4 · 2 files · 1 commits · closed without merging `VICTORY_SKIP_PIPELINES` is only checked when a draw or dispatch runs (`draw.rs`, via `is_skipped`). A pipeline is started earlier than that when the title creates it, if an earlier run drew with it: `hand_out` → `make::early` → `wanted_early` → `start(p, EARLY)`. The early list is saved to disk (`library::save`, every 20 s while workers finish pipelines, and on a normal exit) and only grows. So if a pipeline gets on the list before its host compile crashes the driver, every later run compiles it again at creation, skipped or not, and crashes the same way. The skip doesn't help, and only a fresh cache directory does. Seen in the field: on #145 (https://git.gtahub.st/github/fxceless--victory-fork/issues/145), a tester on an RX 9070 XT reports that `VICTORY_SKIP_PIPELINES` alone did not stop the driver compiler crashes, because the skipped pipeline is still created, early since d279e69. With a local change that doesn't create pipelines whose shader is skipped, plus `VICTORY_SHADER_OPT=11` and their two remaining crashing hashes skipped, they had no compiler crash in three runs. Credit to them for finding the gap. Their change sounds broader than this one, which covers only the early start. @⁠hashdev512, if your local version also covers other paths (rectangle draws, say), it may be the better fix, and I'm happy to close this in its favour. This change: - `pipeline.rs`: `skipped_shader` takes the pipeline's shaders (`&[Arc<Shader>]`) instead of the `Pipeline`, so it can be asked about a `Pending` too. Matching, its cfg and its two callers' behaviour are unchanged. No new gated item. - `make.rs`: `early` returns at once when one of the pipeline's shaders is skipped. The check is under `#[cfg(feature = "diagnostics")]`, which (inside the Windows-only `make` module) is the skip list's current gate. For dispatches, mesh dispatches and non-rectangle draws, the skip check already returns before `host_pipeline` is asked, so `early` was the path left for skipped compute programs. A rectangle-topology draw still asks `host_pipeline` through `completes_rects()` before or regardless of the skip check. This PR doesn't change that. Notes for merging: - With **#91 or #106** (both move the skip helpers from `all(windows, feature = "diagnostics")` to `windows`): one small textual conflict at the `skipped_shader` signature, in either order. Keep their doc comment and `#[cfg(windows)]` with this PR's signature. Every way of resolving it builds: `skipped_shader` stays one function under one gate, and the check in `early` is diagnostics-only, which falls inside either gate. After both merge, release builds still won't check the skip list in `early`. Removing that `#[cfg]` line then would make the check apply there too. - With **#147** (worker queue rework in `make.rs`): `git merge-tree` merges it cleanly, and #147 doesn't change `early`. Checked: CI on a copy of this branch (clippy with and without `--all-features`, tests). There's no new test: the change is one early return, and `early` needs a device. The race itself comes from reading the code. I haven't reproduced a crash with it, and I couldn't run the title. Written with an AI assistant (Claude). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
VICTORY_SKIP_PIPELINES was only checked at draw and dispatch time. A
pipeline an earlier run drew with is on the persisted early list and
make::early starts its host compile when the title creates it, so a
skipped pipeline whose driver compile crashes still crashed the run.
skipped_shader now takes the pipeline's shaders, and make::early returns
for a pipeline with a skipped shader.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:37:32 +00:00
github-bot closed this pull request 2026-11-26 03:37:32 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.