Repository navigation
Conversation
A diagnostics switch for 32-lane hosts: VICTORY_SKIP_WAVE64=mesh,compute drops draws and dispatches whose pipeline has a program of a listed stage written for 64-lane waves, so testers can tell whether those programs cause a GPU hang without listing shader hashes one by one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tch) wbkepler's Marvisak#579: in diagnostics builds, VICTORY_SKIP_WAVE64=<stage>,... (mesh, compute, vertex, pixel) omits draws and dispatches whose pipeline has a program of a listed stage written for 64-lane console waves, and counts them as VICTORY_SKIP_PIPELINES does. No conflict. Marvisak#578 (the same author's refusal of such programs on hosts without 64-lane waves) is not merged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Seven more upstream PRs are in (Marvisak#493, Marvisak#483, Marvisak#206, Marvisak#469, Marvisak#459, Marvisak#454, Marvisak#579) and the wave64 stack is at Marvisak#439's head 965ce30. Records how each was combined with what the tree had, that a capped view heap keeps 2^18 dynamic slots and why, Marvisak#189 and Marvisak#578 as left out, and a new section with testers' reports from the title: the set without the world-entry hang on three NVIDIA cards and how this tree differs from it, VICTORY_SKIP_WAVE64 as the switch to try, and Marvisak#136 bisected as making every frame black. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 1658c84 on Windows 11, RTX 5070, MSVC: the workspace passes (195 outside victory-shader; victory-shader --lib single-threaded: 69), and cargo test -p victory-gpu --features diagnostics --lib skip_stages passes.
- Everything is behind
cfg(all(windows, feature = "diagnostics")), including the newwave64field, so release builds are unchanged. - Wave64 is read once per container from
native_programsand cached in aOnceLock, so the per-draw check is a vectorcontainsplus a cached bool. It reusesVICTORY_SKIP_PIPELINES's path, so skipped draws are counted and logged the same way. - Warning on unknown stage names, instead of silently matching nothing, is a good touch for a tester-facing switch.
No issues found. I can't reproduce the NVIDIA world hang here (no game package).
AI-assisted (Claude Code).
…switch for wave64 programs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
3090 / 24 GB confirmation on current main Same title and box as my #468 post: 1.0.2.1, blake3 With
So on a 32-lane Ampere card this does what it says: the hang goes away, and what goes away with it is most of the world's draws. Two follow-ups if useful, each about an hour on this box: |
Follow-up A/B test on RTX 5080 (Wave32, Windows 11) with PRs #334 + #579 + #669(Follow-up to my initial Setup:
Takeaway:
|
|
Automated triage for the maintainers. Needs rebase. This PR does not merge cleanly into current The content has not been reviewed yet; it will be once the branch is rebased onto Generated by Claude Code |
GPU: Upload the resident levels of placed 2D texture views
Rebased onto
|
| result | |
|---|---|
cargo build --profile diag -p victory --features diagnostics |
ok, 18.8 s |
cargo build --release -p victory |
ok, 32.2 s |
cargo test --release -p victory-gpu --features diagnostics --lib |
144 passed, 3 failed |
same command on main 940d32f alone |
143 passed, 3 failed |
The three failures are the same on both trees — descriptor::host::tests::dynamic_slots_are_held_until_released, draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view, memory::tests::lists_share_a_table_and_copies_keep_their_views — so they are pre-existing here and not caused by the rebase. The rebase adds one passing test.
A run with the switch on, RTX 4060 Laptop (Ada), driver 32.0.15.6607
Not a clean measurement of this PR on its own: I had #2121 (view-heap paging) and #1763 (typed-UAV refusal) merged underneath, because without them the run dies at the boot-time UAV removal before the world is reached. Diagnostics build, title 1.0.2.1.
With #2121 + #1763 and no switch, the run ends at 0xC0000005 in title code (+0x23cf683, write 0x0) at frame 1,924. That is the signature in #1118.
| switch | highest frame= |
run | end |
|---|---|---|---|
| none | 1,924 | 142 s | 0xC0000005 at +0x23cf683 (title code) |
VICTORY_SKIP_WAVE64=mesh |
2,254 | 111 s | stopped in a compute-heavy stretch; no device removed, no exception in the log |
VICTORY_SKIP_WAVE64=mesh,compute |
2,792 | 158 s | 0x887A0007 after a submission, GPU not responding |
So on this card mesh alone gets past the +0x23cf683 stop, and mesh,compute gets further again before a different GPU-level failure. That is consistent with @Jitheswar's RTX 3050 Laptop result in #1118 (mesh skip: 0 of 5 runs reached that stop) and with @MD5Visual's and @R0D4X's runs here — three different NVIDIA generations now agree that the stop moves when these stages are skipped.
Caveat on the mesh-only row: the run ended while binding six compute pipelines at frame 2,254 and logged no device removed / no exception, so I cannot say from that log alone whether it hung or was cut off. I have not repeated it.
Not claimed
No frame capture was taken in these runs, so I cannot say whether the picture was the world or a flat colour. pages in use reported 2049 of 3906 (inside the 2,880 pages available to title slots, no exhaustion line) in the runs where #2121 was in play — that number looks deterministic across cards, so it adds little.
Patch
git format-patch 940d32f..HEAD
From 7044040e14425e3312bbe952ad2c155f455d43f1 Mon Sep 17 00:00:00 2001
From: imrealynailong <2275815336@qq.com>
Date: Wed, 25 Nov 2026 16:57:45 +0800
Subject: [PATCH] GPU: VICTORY_SKIP_WAVE64 omits draws of wave64 programs of
listed stages
Rebased onto main 940d32f. The two conflicts were resolved by keeping
main's Shader::new constructor (the wave64 OnceLock is initialised there
instead of inline) and by keeping both sets of Debugging rows in the
README (VICTORY_GPU_TIMING, VICTORY_TRACE_SHADERS from main, and
VICTORY_SKIP_WAVE64 from the original branch).
Original commit: 1658c84 by the author of #579.
---
README.md | 4 +-
crates/victory-gpu/src/pipeline.rs | 68 +++++++++++++++++++++++++++++-
2 files changed, 68 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 4010879..0efc3ec 100644
--- a/README.md
+++ b/README.md
@@ -183,9 +183,9 @@ The on/off switches below (`...=1`) are off when unset or set to `0`.
| `VICTORY_D3D12_GBV=1` | with the above, GPU-based validation (bad descriptor use reported, not faulted; slow) |
| `VICTORY_D3D12_DRED=1` | on a GPU failure, the allocation hit and the commands in flight |
| `VICTORY_SKIP_PIPELINES=<hash>,...` | omit draws and dispatches, including indirect ones, whose pipeline contains a listed 16-digit shader hash |
+| `VICTORY_SKIP_WAVE64=mesh,compute` | omit draws and dispatches whose pipeline has a program of a listed stage written for 64-lane waves (on hosts with 32-lane waves, such as NVIDIA's, these can hang the GPU) |
| `VICTORY_GPU_TIMING=1` | with the above, each list of a submission run and timed on its own; slow lists logged with their slowest commands; a device removal names the list it happened in and lists all its commands |
-| `VICTORY_TRACE_SHADERS=<hash>,...` | with `VICTORY_D3D12_DRED`, every draw and dispatch of a listed shader logged with what it binds (user data, heap slots, root views and their first dwords; the first 500) |
-| `VICTORY_D3D12_WARP=1` | host device on the software adapter (slow; cannot reset the driver) |
+| `VICTORY_TRACE_SHADERS=<hash>,...` | with `VICTORY_D3D12_DRED`, every draw and dispatch of a listed shader logged with what it binds (user data, heap slots, root views and their first dwords; the first 500) || `VICTORY_D3D12_WARP=1` | host device on the software adapter (slow; cannot reset the driver) |
| `VICTORY_PIPELINE_LOG=<file>` | a line per title pipeline created (key, shaders, state), first used, and made or loaded (library name); `translate --cache --pipelines` writes the last kind too |
| `VICTORY_PREBUILD_KEYS=<file>` | `translate --cache --pipelines` makes nothing and lists each pack record's key, shaders and state (or why it is skipped) |
| `VICTORY_SHADER_LOOP_LIMIT=<n>` | translated shader loops stop after `n` iterations per lane instead of 2^20 (own shader cache entries); if a lower `n` makes world frames much faster, loops hitting the limit are what makes them slow |
diff --git a/crates/victory-gpu/src/pipeline.rs b/crates/victory-gpu/src/pipeline.rs
index bd69afe..aa6fa8b 100644
--- a/crates/victory-gpu/src/pipeline.rs
+++ b/crates/victory-gpu/src/pipeline.rs
@@ -63,6 +63,10 @@ pub(crate) struct Shader {
container: Vec<u8>,
#[cfg(windows)]
translated: OnceLock<Option<Translated>>,
+ /// Whether its native program runs in 64-lane console waves
+ /// (diagnostics: `VICTORY_SKIP_WAVE64`).
+ #[cfg(all(windows, feature = "diagnostics"))]
+ wave64: OnceLock<bool>,
}
impl std::fmt::Debug for Shader {
@@ -93,6 +97,8 @@ impl Shader {
container: bytes.to_vec(),
#[cfg(windows)]
translated: OnceLock::new(),
+ #[cfg(all(windows, feature = "diagnostics"))]
+ wave64: OnceLock::new(),
}
}
}
@@ -279,19 +285,66 @@ fn parse_skip_hashes(value: &str) -> Vec<String> {
.collect()
}
+/// The stages `VICTORY_SKIP_WAVE64` names (`mesh`, `compute`, `vertex`,
+/// `pixel`).
+#[cfg(all(windows, feature = "diagnostics"))]
+fn parse_skip_stages(value: &str) -> Vec<&'static str> {
+ value
+ .split(',')
+ .map(str::trim)
+ .filter(|s| !s.is_empty())
+ .filter_map(|s| {
+ let stage = ["mesh", "compute", "vertex", "pixel"]
+ .into_iter()
+ .find(|&k| k.eq_ignore_ascii_case(s));
+ if stage.is_none() {
+ tracing::warn!(
+ stage = s,
+ "VICTORY_SKIP_WAVE64 expects mesh, compute, vertex or pixel"
+ );
+ }
+ stage
+ })
+ .collect()
+}
+
+#[cfg(all(windows, feature = "diagnostics"))]
+impl Shader {
+ /// Whether the container's native program runs in 64-lane console waves.
+ fn wave64(&self) -> bool {
+ *self.wave64.get_or_init(|| {
+ victory_shader::Container::parse(&self.container)
+ .ok()
+ .and_then(|c| {
+ c.part(victory_shader::FourCC::DXIL)
+ .map(|p| p.data.to_vec())
+ })
+ .and_then(|d| victory_shader::native::native_programs(&d).ok())
+ .is_some_and(|ps| ps.iter().any(|p| p.wave64))
+ })
+ }
+}
+
#[cfg(all(windows, feature = "diagnostics"))]
fn skipped_shader(p: &Pipeline) -> Option<&str> {
static HASHES: OnceLock<Vec<String>> = OnceLock::new();
+ static WAVE64: OnceLock<Vec<&'static str>> = OnceLock::new();
let hashes = HASHES.get_or_init(|| {
let value = std::env::var("VICTORY_SKIP_PIPELINES").unwrap_or_default();
parse_skip_hashes(&value)
});
- if hashes.is_empty() {
+ let wave64 = WAVE64.get_or_init(|| {
+ let value = std::env::var("VICTORY_SKIP_WAVE64").unwrap_or_default();
+ parse_skip_stages(&value)
+ });
+ if hashes.is_empty() && wave64.is_empty() {
return None;
}
p.shaders
.iter()
- .find(|shader| hashes.contains(&shader.hash))
+ .find(|shader| {
+ hashes.contains(&shader.hash) || (wave64.contains(&shader.stage) && shader.wave64())
+ })
.map(|shader| shader.hash.as_str())
}
@@ -684,6 +737,17 @@ pub fn wanted_early(key: &str) -> bool {
#[cfg(test)]
mod tests {
+ #[cfg(all(windows, feature = "diagnostics"))]
+ #[test]
+ fn skip_stages_names_known_stages_only() {
+ assert_eq!(
+ super::parse_skip_stages(" mesh,Compute ,,"),
+ ["mesh", "compute"]
+ );
+ assert_eq!(super::parse_skip_stages("hull,pixel"), ["pixel"]);
+ assert!(super::parse_skip_stages("").is_empty());
+ }
+
#[cfg(all(windows, feature = "diagnostics"))]
#[test]
fn skip_hashes_accepts_full_hashes_only() {
--
2.45.2.windows.1
I am not the author of this branch and cannot push to it; the patch is offered so it can be applied as-is. If you would rather have it as a fork branch I can put one up.
What
A diagnostics-only switch,
VICTORY_SKIP_WAVE64=<stage>,...(mesh,compute,vertex,pixel). It omits draws and dispatches whose pipeline has a program of a listed stage written for 64-lane console waves. It counts and logs them likeVICTORY_SKIP_PIPELINES, with the shader named. Unknown stage names are warned about and ignored. There is a new row under Debugging in the README.Why
On NVIDIA (32-lane waves) the world hangs the GPU at dispatches of wave64 mesh and compute programs. There are hundreds of such programs, which is too many to list as hashes in
VICTORY_SKIP_PIPELINES. WithVICTORY_SKIP_WAVE64=mesh,compute, an RTX 5090 stayed in the world for almost 7 minutes without a device removal, where it otherwise failed within 25 to 95 s. Testers can use the switch to check whether a hang is in this class, or narrow it to one stage, on any build.The program's wave size is read from its native program once per container and cached.
Tests
skip_stages_names_known_stages_only(parsing).cargo clippy --workspace --all-targets,cargo clippy -p victory --features diagnostics --all-targets,cargo test --workspace,cargo xtask policy: pass. The remaining clippy warnings are already onmain.Overlaps with #578 (both add a cached
Shader::wave64()). Whichever lands second needs a trivial rebase.🤖 Generated with Claude Code