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

Closed
ericomeehan wants to merge 1 commit from upstream-pr/172 into main
ericomeehan commented 2026-11-24 22:07:41 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ericomeehan on 2026-11-24T22:07:41Z.


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://github.com/fxceless/victory-fork/issues/145#issuecomment-7145624647), 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

<!-- greyfinch-sync:fxceless/victory-fork:issue:6592372572 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/172). Originally posted by [ericomeehan](https://github.com/ericomeehan) on 2026-11-24T22:07:41Z. --- `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://github.com/fxceless/victory-fork/issues/145#issuecomment-7145624647), 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)
upstream-sync closed this pull request 2026-11-25 01:11:20 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!172
No description provided.