Repository navigation
GPU: read VICTORY_SKIP_PIPELINES in release builds too - #91
omeuniercombet wants to merge 1 commit into
Conversation
|
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 #106 makes the same I only read the diffs; I didn't build or run either branch. Written with an AI assistant (Claude). |
A card's shader compiler that crashes or stalls on one program (AMD, issue fxceless#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.
a141049 to
c7ece02
Compare
|
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.) |
|
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. The patch below goes on top of this PR's head Checked on an RTX 3090 (Windows 11):
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). |
|
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 AI-assisted (Claude Code); no game data. |
What
VICTORY_SKIP_PIPELINESwas compiled only with thediagnosticsfeature, 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.is_skippedchecks indraw.rsand the list parsing inpipeline.rslose theirdiagnosticsgate. The list is read once (OnceLock); with the variable unset the check returns at once.note_drop) stay diagnostics-only.skip_hashes_accepts_full_hashes_onlynow 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).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.