GPU: read VICTORY_SKIP_PIPELINES in release builds too #91

Open
github-bot wants to merge 1 commit from github-bot/gh-91 into main AGit
Owner

@⁠omeuniercombet on GitHub · 2026-11-24 21:24 UTC · original
omeuniercombet:pr/skip-pipelines-release → main · +10 −8 · 3 files · 1 commits · open

What

VICTORY_SKIP_PIPELINES was compiled only with the diagnostics feature, so a player whose card's shader compiler crashes or stalls on one program had to run the diagnostics build just to skip it. This reads the list in release builds too.

  • The three is_skipped checks in draw.rs and the list parsing in pipeline.rs lose their diagnostics gate. The list is read once (OnceLock); with the variable unset the check returns at once.
  • The per-reason drop counts (note_drop) stay diagnostics-only.
  • README: the table row says it is also read by a release build.
  • skip_hashes_accepts_full_hashes_only now runs without the feature.

Why

Issue #3 (RX 9070 XT) needs three kinds of skips on AMD, and I hit the same on an RX 6600 XT: one 71 KB compute program kept AMD's compiler busy for 164 s and its private commit grew by about 10 GB, until Windows ran out of commit and the device was removed at the end of the opening cutscene. Skipping that program let the run reach the prologue checkpoint.

Checked

  • cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features: clean.
  • cargo test --workspace --locked: passes (the asset-policy test only complains about an untracked local launcher script in my working copy, nothing in the commit).
  • In game (release build, Series X profile, RX 6600 XT 8 GB, 16 GB RAM): the title reaches and plays the prologue with a skip list set. I did not measure any frame-rate difference, and this change is not meant to give one.

Not done

Early-pipeline prewarming still queues a skipped program's pipeline if its key is in early-pipelines.txt; I worked around that locally by removing the key. Making prewarm honour the skip list would be a separate change.

AI-assisted (Claude): written and checked on my machine with my own copy of the game. Hashes and counts only; no game data.

**@⁠omeuniercombet** on GitHub · 2026-11-24 21:24 UTC · [original](https://github.com/fxceless/victory-fork/pull/91) `omeuniercombet:pr/skip-pipelines-release` → `main` · +10 −8 · 3 files · 1 commits · open ## What `VICTORY_SKIP_PIPELINES` was compiled only with the `diagnostics` feature, so a player whose card's shader compiler crashes or stalls on one program had to run the diagnostics build just to skip it. This reads the list in release builds too. - The three `is_skipped` checks in `draw.rs` and the list parsing in `pipeline.rs` lose their `diagnostics` gate. The list is read once (`OnceLock`); with the variable unset the check returns at once. - The per-reason drop counts (`note_drop`) stay diagnostics-only. - README: the table row says it is also read by a release build. - `skip_hashes_accepts_full_hashes_only` now runs without the feature. ## Why Issue #3 (RX 9070 XT) needs three kinds of skips on AMD, and I hit the same on an RX 6600 XT: one 71 KB compute program kept AMD's compiler busy for 164 s and its private commit grew by about 10 GB, until Windows ran out of commit and the device was removed at the end of the opening cutscene. Skipping that program let the run reach the prologue checkpoint. ## Checked - `cargo clippy --workspace --all-targets --locked -- -D warnings`, with and without `--all-features`: clean. - `cargo test --workspace --locked`: passes (the asset-policy test only complains about an untracked local launcher script in my working copy, nothing in the commit). - In game (release build, Series X profile, RX 6600 XT 8 GB, 16 GB RAM): the title reaches and plays the prologue with a skip list set. I did not measure any frame-rate difference, and this change is not meant to give one. ## Not done Early-pipeline prewarming still queues a skipped program's pipeline if its key is in `early-pipelines.txt`; I worked around that locally by removing the key. Making prewarm honour the skip list would be a separate change. _AI-assisted (Claude): written and checked on my machine with my own copy of the game. Hashes and counts only; no game data._ </Content>
A card's shader compiler that crashes or stalls on one program (AMD, issue #3 and similar) needed a diagnostics build just to skip it. The skip list is read once, and the check is a lookup that costs nothing when the list is empty. Drop counts per reason stay diagnostics-only.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:36:02 +00:00
Author
Owner

@⁠ericomeehan on GitHub · 2026-11-24 22:01 UTC · original

Before merging: this branch is based on 4e17478 ("The game is no longer named in the tree"), but its commit puts the full name back in place of "the title" on six comment lines. Four are in crates/victory-gpu/src/draw.rs: the stride note, the scissor/target note, the "draws what it sees" note and the indirect-rectangles note. Two are in crates/victory-gpu/src/pipeline.rs: the module doc and the stream-layout test doc. On the PR head, git grep -c finds the name 4 times in draw.rs and 2 times in pipeline.rs; main and #106 have none. It looks like those files were copied from before 4e17478. With those six lines reverted, the PR is just the cfg changes and the README row.

#106 makes the same VICTORY_SKIP_PIPELINES change and goes a little further. The four cfg changes in pipeline.rs are identical. In draw.rs, #106 gates the same three places with #[cfg(windows)] where this PR removes the gate, and it also counts skipped dispatches in DROPPED in release builds. The two PRs conflict on the same lines, so only one can be merged. #106 doesn't have the naming problem and also adds the separate texture-queue settings.

I only read the diffs; I didn't build or run either branch.

Written with an AI assistant (Claude).

**@⁠ericomeehan** on GitHub · 2026-11-24 22:01 UTC · [original](https://github.com/fxceless/victory-fork/pull/91#issuecomment-7145692469) Before merging: this branch is based on 4e17478 ("The game is no longer named in the tree"), but its commit puts the full name back in place of "the title" on six comment lines. Four are in `crates/victory-gpu/src/draw.rs`: the stride note, the scissor/target note, the "draws what it sees" note and the indirect-rectangles note. Two are in `crates/victory-gpu/src/pipeline.rs`: the module doc and the stream-layout test doc. On the PR head, `git grep -c` finds the name 4 times in `draw.rs` and 2 times in `pipeline.rs`; `main` and #106 have none. It looks like those files were copied from before 4e17478. With those six lines reverted, the PR is just the `cfg` changes and the README row. #106 makes the same `VICTORY_SKIP_PIPELINES` change and goes a little further. The four `cfg` changes in `pipeline.rs` are identical. In `draw.rs`, #106 gates the same three places with `#[cfg(windows)]` where this PR removes the gate, and it also counts skipped dispatches in `DROPPED` in release builds. The two PRs conflict on the same lines, so only one can be merged. #106 doesn't have the naming problem and also adds the separate texture-queue settings. I only read the diffs; I didn't build or run either branch. Written with an AI assistant (Claude).
Author
Owner

@⁠omeuniercombet on GitHub · 2026-11-24 22:25 UTC · original

Thanks for catching that! Rebased onto latest \main\ and cleaned up the six pre-\4e17478\ comment lines, gated the three \draw.rs\ checks with #[cfg(windows)], and kept \DROPPED\ counting on skipped dispatches in release builds. (Also happy if the maintainer prefers merging #106 instead if they want the texture-queue settings bundled with it.)

**@⁠omeuniercombet** on GitHub · 2026-11-24 22:25 UTC · [original](https://github.com/fxceless/victory-fork/pull/91#issuecomment-7146205117) Thanks for catching that! Rebased onto latest \main\ and cleaned up the six pre-\4e17478\ comment lines, gated the three \draw.rs\ checks with \#[cfg(windows)]\, and kept \DROPPED\ counting on skipped dispatches in release builds. (Also happy if the maintainer prefers merging #106 instead if they want the texture-queue settings bundled with it.)
Author
Owner

@⁠JFIREonFIRE on GitHub · 2026-11-24 22:25 UTC · original

A follow-up for the "not done" part. With this PR the skip list is read in release builds, but a skipped pipeline is still started at the title's creation call. hand_out calls make::early whenever the pipeline library lists the pipeline as used early, and that path never asks the skip list. So a program skipped because it crashes the host's shader compiler (#145, #120) still reaches that compiler while loading. The draw-time checks in draw.rs are fine; only this early start bypasses them.

The patch below goes on top of this PR's head a141049. It splits the lookup into skip_hashes() / first_skipped(), so hand_out can leave skipped pipelines out of the early start, and adds a test of the lookup.

Checked on an RTX 3090 (Windows 11):

  • cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features: clean.
  • cargo test --workspace --locked: passes. victory-gpu gives 112 passed, 1 ignored.
  • Not run on an AMD card, where the compiler crash happens.

Take it into this PR if you like; that's simpler than a separate PR.

patch (git apply)
 crates/victory-gpu/src/pipeline.rs | 48 ++++++++++++++++++++++++------
 1 file changed, 39 insertions(+), 9 deletions(-)

diff --git a/crates/victory-gpu/src/pipeline.rs b/crates/victory-gpu/src/pipeline.rs
index a1a4f12..62fe5d4 100644
--- a/crates/victory-gpu/src/pipeline.rs
+++ b/crates/victory-gpu/src/pipeline.rs
@@ -426,20 +426,33 @@ fn parse_skip_hashes(value: &str) -> Vec<String> {
         .collect()
 }
 
+/// The hashes `VICTORY_SKIP_PIPELINES` names, read once.
 #[cfg(windows)]
-fn skipped_shader(p: &Pipeline) -> Option<&str> {
+fn skip_hashes() -> &'static [String] {
     static HASHES: OnceLock<Vec<String>> = OnceLock::new();
-    let hashes = HASHES.get_or_init(|| {
+    HASHES.get_or_init(|| {
         let value = std::env::var("VICTORY_SKIP_PIPELINES").unwrap_or_default();
         parse_skip_hashes(&value)
-    });
-    if hashes.is_empty() {
+    })
+}
+
+/// The first of `hashes` that `skip` names.
+#[cfg(windows)]
+fn first_skipped<'a>(
+    hashes: impl IntoIterator<Item = &'a str>,
+    skip: &[String],
+) -> Option<&'a str> {
+    if skip.is_empty() {
         return None;
     }
-    p.shaders
-        .iter()
-        .find(|shader| hashes.contains(&shader.hash))
-        .map(|shader| shader.hash.as_str())
+    hashes
+        .into_iter()
+        .find(|hash| skip.iter().any(|s| s == hash))
+}
+
+#[cfg(windows)]
+fn skipped_shader(p: &Pipeline) -> Option<&str> {
+    first_skipped(p.shaders.iter().map(|s| s.hash.as_str()), skip_hashes())
 }
 
 #[cfg(windows)]
@@ -503,8 +516,15 @@ fn hand_out(
     tracing::trace!(?shaders, "pipeline state");
     #[cfg(windows)]
     let host = Arc::new(make::Pending::new(shaders.clone(), graphics));
+    // A skipped pipeline is never drawn with, so it is not made early
+    // either: a program that crashes or stalls the host's shader compiler
+    // is skipped to keep that compiler away from it.
     #[cfg(windows)]
-    make::early(&host);
+    if let Some(hash) = first_skipped(shaders.iter().map(|s| s.hash.as_str()), skip_hashes()) {
+        tracing::debug!(hash, "VICTORY_SKIP_PIPELINES: not made early");
+    } else {
+        make::early(&host);
+    }
     #[cfg(windows)]
     let builder = of_builder(&shaders);
     #[cfg(windows)]
@@ -724,6 +744,16 @@ pub fn save_pipeline_cache() {
 
 #[cfg(test)]
 mod tests {
+    #[cfg(windows)]
+    #[test]
+    fn skipped_pipelines_are_found_by_any_of_their_shaders() {
+        let skip = super::parse_skip_hashes("0011223344556677");
+        let vs_ps = ["8899aabbccddeeff", "0011223344556677"];
+        assert_eq!(super::first_skipped(vs_ps, &skip), Some("0011223344556677"));
+        assert_eq!(super::first_skipped(["8899aabbccddeeff"], &skip), None);
+        assert_eq!(super::first_skipped(vs_ps, &[]), None);
+    }
+
     #[cfg(windows)]
     #[test]
     fn skip_hashes_accepts_full_hashes_only() {

AI-assisted (Claude Code).

**@⁠JFIREonFIRE** on GitHub · 2026-11-24 22:25 UTC · [original](https://github.com/fxceless/victory-fork/pull/91#issuecomment-7146221112) A follow-up for the "not done" part. With this PR the skip list is read in release builds, but a skipped pipeline is still **started at the title's creation call**. `hand_out` calls `make::early` whenever the pipeline library lists the pipeline as used early, and that path never asks the skip list. So a program skipped because it crashes the host's shader compiler (#145, #120) still reaches that compiler while loading. The draw-time checks in `draw.rs` are fine; only this early start bypasses them. The patch below goes on top of this PR's head `a141049`. It splits the lookup into `skip_hashes()` / `first_skipped()`, so `hand_out` can leave skipped pipelines out of the early start, and adds a test of the lookup. Checked on an RTX 3090 (Windows 11): - `cargo clippy --workspace --all-targets --locked -- -D warnings`, with and without `--all-features`: clean. - `cargo test --workspace --locked`: passes. `victory-gpu` gives 112 passed, 1 ignored. - Not run on an AMD card, where the compiler crash happens. Take it into this PR if you like; that's simpler than a separate PR. <details><summary>patch (git apply)</summary> ```diff crates/victory-gpu/src/pipeline.rs | 48 ++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/crates/victory-gpu/src/pipeline.rs b/crates/victory-gpu/src/pipeline.rs index a1a4f12..62fe5d4 100644 --- a/crates/victory-gpu/src/pipeline.rs +++ b/crates/victory-gpu/src/pipeline.rs @@ -426,20 +426,33 @@ fn parse_skip_hashes(value: &str) -> Vec<String> { .collect() } +/// The hashes `VICTORY_SKIP_PIPELINES` names, read once. #[cfg(windows)] -fn skipped_shader(p: &Pipeline) -> Option<&str> { +fn skip_hashes() -> &'static [String] { static HASHES: OnceLock<Vec<String>> = OnceLock::new(); - let hashes = HASHES.get_or_init(|| { + HASHES.get_or_init(|| { let value = std::env::var("VICTORY_SKIP_PIPELINES").unwrap_or_default(); parse_skip_hashes(&value) - }); - if hashes.is_empty() { + }) +} + +/// The first of `hashes` that `skip` names. +#[cfg(windows)] +fn first_skipped<'a>( + hashes: impl IntoIterator<Item = &'a str>, + skip: &[String], +) -> Option<&'a str> { + if skip.is_empty() { return None; } - p.shaders - .iter() - .find(|shader| hashes.contains(&shader.hash)) - .map(|shader| shader.hash.as_str()) + hashes + .into_iter() + .find(|hash| skip.iter().any(|s| s == hash)) +} + +#[cfg(windows)] +fn skipped_shader(p: &Pipeline) -> Option<&str> { + first_skipped(p.shaders.iter().map(|s| s.hash.as_str()), skip_hashes()) } #[cfg(windows)] @@ -503,8 +516,15 @@ fn hand_out( tracing::trace!(?shaders, "pipeline state"); #[cfg(windows)] let host = Arc::new(make::Pending::new(shaders.clone(), graphics)); + // A skipped pipeline is never drawn with, so it is not made early + // either: a program that crashes or stalls the host's shader compiler + // is skipped to keep that compiler away from it. #[cfg(windows)] - make::early(&host); + if let Some(hash) = first_skipped(shaders.iter().map(|s| s.hash.as_str()), skip_hashes()) { + tracing::debug!(hash, "VICTORY_SKIP_PIPELINES: not made early"); + } else { + make::early(&host); + } #[cfg(windows)] let builder = of_builder(&shaders); #[cfg(windows)] @@ -724,6 +744,16 @@ pub fn save_pipeline_cache() { #[cfg(test)] mod tests { + #[cfg(windows)] + #[test] + fn skipped_pipelines_are_found_by_any_of_their_shaders() { + let skip = super::parse_skip_hashes("0011223344556677"); + let vs_ps = ["8899aabbccddeeff", "0011223344556677"]; + assert_eq!(super::first_skipped(vs_ps, &skip), Some("0011223344556677")); + assert_eq!(super::first_skipped(["8899aabbccddeeff"], &skip), None); + assert_eq!(super::first_skipped(vs_ps, &[]), None); + } + #[cfg(windows)] #[test] fn skip_hashes_accepts_full_hashes_only() { ``` </details> AI-assisted (Claude Code).
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-25 10:59 UTC · original

Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head c7ece02 into main f85101b in a throwaway tree (no conflict). cargo clippy --workspace --all-targets --locked -- -D warnings fails with exactly the errors main itself has on this machine (placed_filler_twins, depth_written, a sort; PR #841 fixes them); with --all-features it fails with the same number of errors as main (4). This PR adds none and removes none. cargo test --workspace --locked: run 1: 556 passed, 0 failed, 11 ignored (main alone: 555 passed). Run 2: one failure. The failure is indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields, which fails on main itself most runs here (PR #849 fixes its assertion; see issue #850). The title was not run, so this says nothing about in-game effect. No game data.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-25 10:59 UTC · [original](https://github.com/fxceless/victory-fork/pull/91#issuecomment-7160437793) Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head `c7ece02` into `main` `f85101b` in a throwaway tree (no conflict). `cargo clippy --workspace --all-targets --locked -- -D warnings` fails with exactly the errors `main` itself has on this machine (`placed_filler_twins`, `depth_written`, a sort; PR #841 fixes them); with `--all-features` it fails with the same number of errors as `main` (4). This PR adds none and removes none. `cargo test --workspace --locked`: run 1: 556 passed, 0 failed, 11 ignored (`main` alone: 555 passed). Run 2: one failure. The failure is `indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields`, which fails on `main` itself most runs here (PR #849 fixes its assertion; see issue #850). The title was not run, so this says nothing about in-game effect. No game data. AI-assisted (Claude Code); no game data.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/draw.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-91'
git switch 'github-bot/gh-91'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-91'
git switch 'github-bot/gh-91'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-91'
git switch 'main'
git merge --squash 'github-bot/gh-91'
git switch 'main'
git merge --ff-only 'github-bot/gh-91'
git switch 'main'
git merge 'github-bot/gh-91'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.