Fix the device loss introduced by the wave64 update

The update moved the particle light-atlas compute programs to a form that
puts group barriers inside branches and loops; a dispatch of them stood on
the card until the device was reset. That form is now off unless
VICTORY_WAVE_WIDE=1, and the shader cache key includes the wave switches.
Checked with a plain run of this tree on the test machine.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
fxcelessandClaude Fable 5.2 committed 2026-11-24 14:30:28 -05:00
1 parent 004bf69a4b
commit e9765a73a6
3 files changed
+24 -2

No files matched your search

+17
View File
@@ -56,6 +56,23 @@ fn build() -> &'static [u8; 32] {
bytes.extend_from_slice(&limit.to_le_bytes());
// Which group barriers wait is part of the translation too.
bytes.push(victory_shader::emit::group_sync());
// So are the switches that pick the form of a wave64 program:
// without them here a run with `VICTORY_WAVE_WIDE=0` was
// served the translations an earlier run of the same
// executable had cached with the switch unset.
for name in [
"VICTORY_WAVE_WIDE",
"VICTORY_WAVE_DEEP_SKIPS",
"VICTORY_WAVE_OWN_BITS",
"VICTORY_F16_NEAREST",
] {
bytes.extend_from_slice(name.as_bytes());
bytes.push(b'=');
if let Some(value) = std::env::var_os(name) {
bytes.extend_from_slice(value.as_encoded_bytes());
}
bytes.push(0);
}
*blake3::hash(&bytes).as_bytes()
}
Err(e) => {
+6 -1
View File
@@ -341,7 +341,12 @@ pub fn emit(
}
}
}
let wide_on = std::env::var_os("VICTORY_WAVE_WIDE").is_none_or(|v| v != "0");
// Off unless asked for (`VICTORY_WAVE_WIDE=1`), for a console wave run as two host
// waves: this form puts group barriers inside branches and loops, and runs 121-124
// lost the card in a submission of two programs that had just moved to it
// (`ptfx_CS_lightAtlas_Sprite` and `_Trail`). The 32-lane programs' form below, which
// has no barrier, stays on.
let wide_on = std::env::var_os("VICTORY_WAVE_WIDE").is_some_and(|v| v == "1");
// exact first: each host wave on its own where that is exact (the idiom, every
// form; no barriers), then the other exact forms; then approximate
for exact in [true, false] {