RX 6950 XT / Proton: proposed opt-in face fix and 10–15 FPS walking with launcher preparation settings #4247

Open
opened 2026-11-30 18:09:22 +00:00 by github-bot · 4 comments
Owner

@⁠diafebus on GitHub · 2026-11-30 17:45 UTC · original

On an RX 6950 XT under Linux/GE-Proton, a local face-fix port plus the existing submission/mapping/copy settings now gives correct facial rendering, full interior lighting, and an observed 10–15 FPS while walking. This is our first local result at that walking speed with this visual quality. Assets still load late while cutscenes play, but the scenes work.

Base is v2026.11.30.02, 84bd61e2, with our local Wine root-signature/helper compatibility changes. The earlier Wine-patched run had good lighting and textures but facial deformation and very low FPS. The combined run corrects the face and keeps the lighting. The performance numbers are user-observed during walking, without a fixed-route benchmark.

Proposed opt-in face patch

The inline diff adapts KLBF commit 8977106, originally derived from avatarmanz/VIctory-7900XTX 1711cd1 by Beqren (VICTORY_RAW_TYPED_LOADS, GPL-3.0). Credit belongs to those authors. We verified the KLBF switch on/off on this GPU previously, and have now verified the enabled port visually in this NVIDIA build. Original KLBF change

VICTORY_FACE_FIX=1 enables it. In compute shaders that write UAVs, contain s_barrier, and perform typed format loads, it also reads the raw view. It selects that result for matching 16-bit integer view/stride metadata, preserving packed d16 results. This tree lacks KLBF's half-view metadata, so the adaptation uses the runtime view word for eligible typed loads of 1, 2, or 4 channels. The new VICTORY-prefixed switch is discovered by the translator's existing source/switch cache fingerprint mechanism.

The rationale inherited from KLBF is stale typed reads after inter-wave writes and a group barrier under RADV/vkd3d-proton. Our visual result supports the workaround on this GPU, but does not independently prove the driver-level mechanism. An isolated face-switch-off run on this NVIDIA candidate remains pending.

The port includes KLBF's targeted translator regression fixture. It passed locally (1 passed), checking changed translation/raw-load generation with the switch enabled, deterministic disabled translation, and unchanged translation without a barrier. It is a translation test. GPU coherence and broader compiler coverage still need review.

CPU preparation/configuration result

Our previous direct run --execute launch omitted the following options from this release's supplied PowerShell launcher. We enabled them together:

VICTORY_THIN=1
VICTORY_JOIN_PARTS=8
VICTORY_RELAY_COPY=1
VICTORY_WIDE_BACK=1
VICTORY_CARD_REHASH_RUNS=1
VICTORY_JOIN_COPIES=1
VICTORY_CARD_STEPS=2
VICTORY_CARD_BUFFERS_MIN_KB=64
VICTORY_INDIRECT_WINDOW=1
VICTORY_INDIRECT_BATCH=2
VICTORY_UPLOAD_AHEAD=1
VICTORY_SHOW_AFTER=1
VICTORY_MAP_THREADS=1
VICTORY_SOFT_VIEWS=copies
VICTORY_TEXTURE_NO_WAIT=1
VICTORY_FACE_FIX=1

We also replaced a local blake3/pure build workaround with blake3/prefer_intrinsics, using Clang for cross-compilation. This restores optimized hashing. It is an important confounder in interpreting the gain, rather than evidence of a new upstream threading algorithm. We added no threading code. The submission worker is confirmed active in the new log.

Illustrative runtime samples, taken at different moments:

Counter Earlier direct launch, portable hashing Combined candidate
Median frame time 445.2 ms 117.0 ms
Time with no GPU work queued 396.3 ms 76.1 ms
Idle time overlapping submission-thread work 387.2 ms 66.0 ms
Texture refresh, all threads 187.6 ms 19.7 ms

These scopes overlap and cannot be added. The samples are not a matched A/B, and texture refresh varied considerably within the earlier run. The later observed walking rate is 10–15 FPS. Face, hashing, and configuration changes were intentionally combined for the live test, so we cannot attribute the FPS gain to one setting. Background compilation ending had no perceptible effect on the earlier run's speed.

Both executables retain the Wine rendering fixes and native D3D12/compiler DLL overrides. The candidate was built with diagnostics. No screenshots, game files, caches, or captured shader binaries are included here.

Would you consider reviewing this small opt-in face adaptation, and whether the supplied preparation defaults should also be exposed more clearly for direct Proton launches? We can provide a face-toggle comparison and targeted logs if useful.

Proposed face patch against v2026.11.30.02
diff --git a/crates/victory-shader/src/emit/lower.rs b/crates/victory-shader/src/emit/lower.rs
index 1fac88c7..411c23f1 100644
--- a/crates/victory-shader/src/emit/lower.rs
+++ b/crates/victory-shader/src/emit/lower.rs
@@ -46,6 +46,34 @@ mod cube_array;
 use cube_array::cube_arrays;
 mod trips;
 
+/// (klbf-lab #260, #19) `VICTORY_FACE_FIX=1` (off by default): in a compute program that stores
+/// to UAVs and meets its group at `s_barrier`, a d16 typed UAV load of 1, 2 or 4 channels, or
+/// a format load from a 16-bit integer view, also reads the element through
+/// the slot's raw view, and takes that value where the host's word for the slot says a view
+/// of 16-bit integer channels as many as loaded (the unsigned twin of a halves place is one).
+/// On RADV through vkd3d-proton a typed (texel buffer) load after the group barrier could
+/// return what the buffer held before another wave's store that preceded the barrier; a raw
+/// load sees the store. The face network keeps its registers in such a view: mouths and jaws
+/// stretched on AMD under Proton. From avatarmanz/VIctory-7900XTX 1711cd1 by Beqren
+/// (VICTORY_RAW_TYPED_LOADS, GPL-3.0), here with the halves places too.
+pub static FACE_RAW_LOADS: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0);
+
+fn face_fix_on() -> bool {
+    #[cfg(test)]
+    if let Some(on) = TEST_FACE_FIX.get() {
+        return on;
+    }
+    static ON: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
+    *ON.get_or_init(|| std::env::var_os("VICTORY_FACE_FIX").is_some_and(|v| v == "1"))
+}
+
+#[cfg(test)]
+thread_local! {
+    /// Tests: [`face_fix_on`] as given instead of the switch.
+    pub(crate) static TEST_FACE_FIX: std::cell::Cell<Option<bool>> = const { std::cell::Cell::new(None) };
+}
+
+
 type Why = &'static str;
 
 /// How an interpolation evaluates an input channel.
@@ -487,6 +515,7 @@ struct Lower<'a> {
     tail: Vec<Option<usize>>,
     /// The program writes UAVs: barriers fence them too.
     writes_uavs: bool,
+    face_raw: bool,
     /// src0 of the current instruction as DPP fetched it.
     src0: Option<V>,
     /// Compute code that reads other lanes: thread ids follow the host
@@ -1397,6 +1426,13 @@ impl<'a> Lower<'a> {
             }
             _ => false,
         });
+        let face_raw = face_fix_on()
+            && x.native.stage == HwStage::Cs
+            && writes_uavs
+            && insts().any(|i| i.name() == "s_barrier")
+            && insts().any(|i| {
+                matches!(i.fields, Fields::Buffer { .. }) && i.name().contains("load_format")
+            });
         let mut console_lanes = false;
         // LDS accesses get a group barrier each (a console wave split in two host waves)
         let mut split_lds = false;
@@ -1788,6 +1824,7 @@ impl<'a> Lower<'a> {
             rpo: vec![usize::MAX; p.blocks.len()],
             tail: vec![None; p.blocks.len()],
             writes_uavs,
+            face_raw,
             src0: None,
             console_lanes,
             split_lds,
@@ -14003,10 +14040,52 @@ impl<'a> Lower<'a> {
             }
             return Ok(());
         }
+        let mut face_raw_words: Option<(V, Vec<V>)> = None;
         let r = if typed {
             if *offen || matches!(off, V::Inst(_)) || *offset != 0 {
                 return Err("a typed buffer load at an offset");
             }
+            if uav
+                && matches!(count, 1 | 2 | 4)
+                && self.face_raw
+                && let Some(index) = index
+                && let Some(word) = self.slot_word(src, true)?
+            {
+                FACE_RAW_LOADS.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
+                let size = 2 * count;
+                let (int, stride) = (super::shader::VIEW_INTEGER, super::shader::VIEW_STRIDE_BITS);
+                let bits = self.s.m.i32(int | stride);
+                let want = self.s.m.i32(int | size);
+                let kind = self.s.m.bin(c, Bin::And, word, bits);
+                let taken = self.s.m.cmp(c, pred::EQ, kind, want);
+                let h = self.handle(site, src, false, (11 | u, 0))?;
+                let k = self.s.m.i32(size);
+                let byte = self.s.m.bin(c, Bin::Mul, index, k);
+                let k3 = self.s.m.i32(3);
+                let within = self.s.m.bin(c, Bin::And, byte, k3);
+                let aligned = self.s.m.bin(c, Bin::Sub, byte, within);
+                let dwords = count.div_ceil(2);
+                let (mask, align) = (self.s.m.i8((1u8 << dwords) - 1), self.s.m.i32(4));
+                let l = self.s.op(
+                    c,
+                    "rawBufferLoad.f32",
+                    Attr::ReadOnly,
+                    self.s.t.res_ret,
+                    139,
+                    &[h, aligned, iu, mask, align],
+                );
+                let mut ws = Vec::new();
+                for d in 0..dwords {
+                    let f = self.s.m.extract(c, l, d);
+                    ws.push(self.as_int(f));
+                }
+                if count == 1 {
+                    // The half at its byte of the dword.
+                    let sh = self.s.m.bin(c, Bin::Shl, within, k3);
+                    ws[0] = self.s.m.bin(c, Bin::LShr, ws[0], sh);
+                }
+                face_raw_words = Some((taken, ws));
+            }
             if uav {
                 self.s.flags |= flags::TYPED_UAV_LOADS;
             }
@@ -14095,13 +14174,32 @@ impl<'a> Lower<'a> {
                         None => h,
                     });
                 }
-                self.write(inst, Reg::V(reg + k as u16), x.expect("a channel"), guard);
+                let mut x = x.expect("a channel");
+                if let Some((taken, ws)) = &face_raw_words {
+                    // Two halves a dword, as the d16 load packs them (one: its 16 bits).
+                    let w = if count == 1 {
+                        let low = self.s.m.i32(0xFFFF);
+                        self.s.m.bin(c, Bin::And, ws[0], low)
+                    } else {
+                        ws[k as usize]
+                    };
+                    x = self.s.m.select(c, *taken, w, x);
+                }
+                self.write(inst, Reg::V(reg + k as u16), x, guard);
             }
             return Ok(());
         }
         for k in 0..count {
             let x = self.s.m.extract(c, r, k);
-            let x = self.as_int(x);
+            let mut x = self.as_int(x);
+            if let Some((taken, ws)) = &face_raw_words {
+                // A format load of halves: each channel's 16 bits, zero-extended.
+                let sh = self.s.m.i32(16 * (k % 2));
+                let w = self.s.m.bin(c, Bin::LShr, ws[(k / 2) as usize], sh);
+                let low = self.s.m.i32(0xFFFF);
+                let w = self.s.m.bin(c, Bin::And, w, low);
+                x = self.s.m.select(c, *taken, w, x);
+            }
             self.write(inst, Reg::V(reg + k as u16), x, guard);
         }
         Ok(())
diff --git a/crates/victory-shader/src/emit/mod.rs b/crates/victory-shader/src/emit/mod.rs
index 3b7e312d..c5edae22 100644
--- a/crates/victory-shader/src/emit/mod.rs
+++ b/crates/victory-shader/src/emit/mod.rs
@@ -2879,6 +2879,34 @@ mod tests {
 
     /// A wave64 compute program: `body`, then a store of v1 to a UAV.
     fn stores_v1(body: &[u32]) -> Result<(), ShaderError> {
+        stores_v1_dxil(body).map(|_| ())
+    }
+
+    /// (klbf-lab #260) With `VICTORY_FACE_FIX`, a program that stores to UAVs and meets its
+    /// group at a barrier reads a 16-bit typed view through the slot's raw view as well (on
+    /// RADV a typed load after the barrier could miss another wave's store: stretched jaws);
+    /// without the switch, or without a barrier, its translation is as before.
+    #[test]
+    fn face_fix_reads_16_bit_typed_loads_after_a_barrier_through_the_raw_view() {
+        // s_barrier; buffer_load_format_d16_x v1, v0, s[8:11], 0 idxen; s_waitcnt vmcnt(0)
+        let with = [0xBF8A_0000u32, 0xE200_2000, 0x8002_0100, 0xBF8C_3F70];
+        let without = [0xE200_2000u32, 0x8002_0100, 0xBF8C_3F70];
+        let lowered = |body: &[u32], on: bool| {
+            let was = super::lower::TEST_FACE_FIX.replace(Some(on));
+            let r = stores_v1_dxil(body);
+            super::lower::TEST_FACE_FIX.set(was);
+            r.unwrap()
+        };
+        let raw_loads = || super::lower::FACE_RAW_LOADS.load(std::sync::atomic::Ordering::Relaxed);
+        let before = raw_loads();
+        assert_ne!(lowered(&with, true), lowered(&with, false), "raw load not taken");
+        assert!(raw_loads() > before, "the raw load is counted");
+        assert_eq!(lowered(&with, false), lowered(&with, false), "off: the same translation");
+        assert_eq!(lowered(&without, true), lowered(&without, false), "no barrier: no raw load");
+    }
+
+    /// [`stores_v1`]'s translation.
+    fn stores_v1_dxil(body: &[u32]) -> Result<Vec<u8>, ShaderError> {
         use crate::native::RootParam;
         use crate::{ResourceType, RootType, UsedResource};
         // s_mov_b32 s1, 0; s_load_dwordx4 s[8:11], s[0:1], 0
@@ -2921,7 +2949,7 @@ mod tests {
         let st = structure::structure(&p).unwrap();
         let container = crate::dxbc::build(&[]);
         let c = Container::parse(&container).unwrap();
-        emit(&c, &native, &p, &st, &io, &res).map(|_| ())
+        emit(&c, &native, &p, &st, &io, &res).map(|out| out.dxil)
     }
 
     /// The high dword of a wave64 mask rewritten alone (`s_mov_b32 vcc_hi`
**@⁠diafebus** on GitHub · 2026-11-30 17:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4246) On an RX 6950 XT under Linux/GE-Proton, a local face-fix port plus the existing submission/mapping/copy settings now gives **correct facial rendering, full interior lighting, and an observed 10–15 FPS while walking**. This is our first local result at that walking speed with this visual quality. Assets still load late while cutscenes play, but the scenes work. Base is **v2026.11.30.02, 84bd61e2**, with our local Wine root-signature/helper compatibility changes. The earlier Wine-patched run had good lighting and textures but facial deformation and very low FPS. The combined run corrects the face and keeps the lighting. The performance numbers are user-observed during walking, without a fixed-route benchmark. ## Proposed opt-in face patch The inline diff adapts KLBF commit 8977106, originally derived from avatarmanz/VIctory-7900XTX 1711cd1 by Beqren (`VICTORY_RAW_TYPED_LOADS`, GPL-3.0). Credit belongs to those authors. We verified the KLBF switch on/off on this GPU previously, and have now verified the enabled port visually in this NVIDIA build. [Original KLBF change](https://github.com/PastiiJay/klbf-lab/commit/8977106) `VICTORY_FACE_FIX=1` enables it. In compute shaders that write UAVs, contain `s_barrier`, and perform typed format loads, it also reads the raw view. It selects that result for matching 16-bit integer view/stride metadata, preserving packed d16 results. This tree lacks KLBF's half-view metadata, so the adaptation uses the runtime view word for eligible typed loads of 1, 2, or 4 channels. The new VICTORY-prefixed switch is discovered by the translator's existing source/switch cache fingerprint mechanism. The rationale inherited from KLBF is stale typed reads after inter-wave writes and a group barrier under RADV/vkd3d-proton. Our visual result supports the workaround on this GPU, but does not independently prove the driver-level mechanism. An isolated face-switch-off run on this NVIDIA candidate remains pending. The port includes KLBF's targeted translator regression fixture. It passed locally (1 passed), checking changed translation/raw-load generation with the switch enabled, deterministic disabled translation, and unchanged translation without a barrier. It is a translation test. GPU coherence and broader compiler coverage still need review. ## CPU preparation/configuration result Our previous direct `run --execute` launch omitted the following options from this release's supplied PowerShell launcher. We enabled them together: ```text VICTORY_THIN=1 VICTORY_JOIN_PARTS=8 VICTORY_RELAY_COPY=1 VICTORY_WIDE_BACK=1 VICTORY_CARD_REHASH_RUNS=1 VICTORY_JOIN_COPIES=1 VICTORY_CARD_STEPS=2 VICTORY_CARD_BUFFERS_MIN_KB=64 VICTORY_INDIRECT_WINDOW=1 VICTORY_INDIRECT_BATCH=2 VICTORY_UPLOAD_AHEAD=1 VICTORY_SHOW_AFTER=1 VICTORY_MAP_THREADS=1 VICTORY_SOFT_VIEWS=copies VICTORY_TEXTURE_NO_WAIT=1 VICTORY_FACE_FIX=1 ``` We also replaced a local `blake3/pure` build workaround with `blake3/prefer_intrinsics`, using Clang for cross-compilation. This restores optimized hashing. It is an important confounder in interpreting the gain, rather than evidence of a new upstream threading algorithm. We added no threading code. The submission worker is confirmed active in the new log. Illustrative runtime samples, taken at different moments: | Counter | Earlier direct launch, portable hashing | Combined candidate | |---|---:|---:| | Median frame time | 445.2 ms | 117.0 ms | | Time with no GPU work queued | 396.3 ms | 76.1 ms | | Idle time overlapping submission-thread work | 387.2 ms | 66.0 ms | | Texture refresh, all threads | 187.6 ms | 19.7 ms | These scopes overlap and cannot be added. The samples are not a matched A/B, and texture refresh varied considerably within the earlier run. The later observed walking rate is 10–15 FPS. Face, hashing, and configuration changes were intentionally combined for the live test, so we cannot attribute the FPS gain to one setting. Background compilation ending had no perceptible effect on the earlier run's speed. Both executables retain the Wine rendering fixes and native D3D12/compiler DLL overrides. The candidate was built with diagnostics. No screenshots, game files, caches, or captured shader binaries are included here. Would you consider reviewing this small opt-in face adaptation, and whether the supplied preparation defaults should also be exposed more clearly for direct Proton launches? We can provide a face-toggle comparison and targeted logs if useful. <details> <summary>Proposed face patch against v2026.11.30.02</summary> ```diff diff --git a/crates/victory-shader/src/emit/lower.rs b/crates/victory-shader/src/emit/lower.rs index 1fac88c7..411c23f1 100644 --- a/crates/victory-shader/src/emit/lower.rs +++ b/crates/victory-shader/src/emit/lower.rs @@ -46,6 +46,34 @@ mod cube_array; use cube_array::cube_arrays; mod trips; +/// (klbf-lab #260, #19) `VICTORY_FACE_FIX=1` (off by default): in a compute program that stores +/// to UAVs and meets its group at `s_barrier`, a d16 typed UAV load of 1, 2 or 4 channels, or +/// a format load from a 16-bit integer view, also reads the element through +/// the slot's raw view, and takes that value where the host's word for the slot says a view +/// of 16-bit integer channels as many as loaded (the unsigned twin of a halves place is one). +/// On RADV through vkd3d-proton a typed (texel buffer) load after the group barrier could +/// return what the buffer held before another wave's store that preceded the barrier; a raw +/// load sees the store. The face network keeps its registers in such a view: mouths and jaws +/// stretched on AMD under Proton. From avatarmanz/VIctory-7900XTX 1711cd1 by Beqren +/// (VICTORY_RAW_TYPED_LOADS, GPL-3.0), here with the halves places too. +pub static FACE_RAW_LOADS: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); + +fn face_fix_on() -> bool { + #[cfg(test)] + if let Some(on) = TEST_FACE_FIX.get() { + return on; + } + static ON: std::sync::OnceLock<bool> = std::sync::OnceLock::new(); + *ON.get_or_init(|| std::env::var_os("VICTORY_FACE_FIX").is_some_and(|v| v == "1")) +} + +#[cfg(test)] +thread_local! { + /// Tests: [`face_fix_on`] as given instead of the switch. + pub(crate) static TEST_FACE_FIX: std::cell::Cell<Option<bool>> = const { std::cell::Cell::new(None) }; +} + + type Why = &'static str; /// How an interpolation evaluates an input channel. @@ -487,6 +515,7 @@ struct Lower<'a> { tail: Vec<Option<usize>>, /// The program writes UAVs: barriers fence them too. writes_uavs: bool, + face_raw: bool, /// src0 of the current instruction as DPP fetched it. src0: Option<V>, /// Compute code that reads other lanes: thread ids follow the host @@ -1397,6 +1426,13 @@ impl<'a> Lower<'a> { } _ => false, }); + let face_raw = face_fix_on() + && x.native.stage == HwStage::Cs + && writes_uavs + && insts().any(|i| i.name() == "s_barrier") + && insts().any(|i| { + matches!(i.fields, Fields::Buffer { .. }) && i.name().contains("load_format") + }); let mut console_lanes = false; // LDS accesses get a group barrier each (a console wave split in two host waves) let mut split_lds = false; @@ -1788,6 +1824,7 @@ impl<'a> Lower<'a> { rpo: vec![usize::MAX; p.blocks.len()], tail: vec![None; p.blocks.len()], writes_uavs, + face_raw, src0: None, console_lanes, split_lds, @@ -14003,10 +14040,52 @@ impl<'a> Lower<'a> { } return Ok(()); } + let mut face_raw_words: Option<(V, Vec<V>)> = None; let r = if typed { if *offen || matches!(off, V::Inst(_)) || *offset != 0 { return Err("a typed buffer load at an offset"); } + if uav + && matches!(count, 1 | 2 | 4) + && self.face_raw + && let Some(index) = index + && let Some(word) = self.slot_word(src, true)? + { + FACE_RAW_LOADS.fetch_add(1, std::sync::atomic::Ordering::Relaxed); + let size = 2 * count; + let (int, stride) = (super::shader::VIEW_INTEGER, super::shader::VIEW_STRIDE_BITS); + let bits = self.s.m.i32(int | stride); + let want = self.s.m.i32(int | size); + let kind = self.s.m.bin(c, Bin::And, word, bits); + let taken = self.s.m.cmp(c, pred::EQ, kind, want); + let h = self.handle(site, src, false, (11 | u, 0))?; + let k = self.s.m.i32(size); + let byte = self.s.m.bin(c, Bin::Mul, index, k); + let k3 = self.s.m.i32(3); + let within = self.s.m.bin(c, Bin::And, byte, k3); + let aligned = self.s.m.bin(c, Bin::Sub, byte, within); + let dwords = count.div_ceil(2); + let (mask, align) = (self.s.m.i8((1u8 << dwords) - 1), self.s.m.i32(4)); + let l = self.s.op( + c, + "rawBufferLoad.f32", + Attr::ReadOnly, + self.s.t.res_ret, + 139, + &[h, aligned, iu, mask, align], + ); + let mut ws = Vec::new(); + for d in 0..dwords { + let f = self.s.m.extract(c, l, d); + ws.push(self.as_int(f)); + } + if count == 1 { + // The half at its byte of the dword. + let sh = self.s.m.bin(c, Bin::Shl, within, k3); + ws[0] = self.s.m.bin(c, Bin::LShr, ws[0], sh); + } + face_raw_words = Some((taken, ws)); + } if uav { self.s.flags |= flags::TYPED_UAV_LOADS; } @@ -14095,13 +14174,32 @@ impl<'a> Lower<'a> { None => h, }); } - self.write(inst, Reg::V(reg + k as u16), x.expect("a channel"), guard); + let mut x = x.expect("a channel"); + if let Some((taken, ws)) = &face_raw_words { + // Two halves a dword, as the d16 load packs them (one: its 16 bits). + let w = if count == 1 { + let low = self.s.m.i32(0xFFFF); + self.s.m.bin(c, Bin::And, ws[0], low) + } else { + ws[k as usize] + }; + x = self.s.m.select(c, *taken, w, x); + } + self.write(inst, Reg::V(reg + k as u16), x, guard); } return Ok(()); } for k in 0..count { let x = self.s.m.extract(c, r, k); - let x = self.as_int(x); + let mut x = self.as_int(x); + if let Some((taken, ws)) = &face_raw_words { + // A format load of halves: each channel's 16 bits, zero-extended. + let sh = self.s.m.i32(16 * (k % 2)); + let w = self.s.m.bin(c, Bin::LShr, ws[(k / 2) as usize], sh); + let low = self.s.m.i32(0xFFFF); + let w = self.s.m.bin(c, Bin::And, w, low); + x = self.s.m.select(c, *taken, w, x); + } self.write(inst, Reg::V(reg + k as u16), x, guard); } Ok(()) diff --git a/crates/victory-shader/src/emit/mod.rs b/crates/victory-shader/src/emit/mod.rs index 3b7e312d..c5edae22 100644 --- a/crates/victory-shader/src/emit/mod.rs +++ b/crates/victory-shader/src/emit/mod.rs @@ -2879,6 +2879,34 @@ mod tests { /// A wave64 compute program: `body`, then a store of v1 to a UAV. fn stores_v1(body: &[u32]) -> Result<(), ShaderError> { + stores_v1_dxil(body).map(|_| ()) + } + + /// (klbf-lab #260) With `VICTORY_FACE_FIX`, a program that stores to UAVs and meets its + /// group at a barrier reads a 16-bit typed view through the slot's raw view as well (on + /// RADV a typed load after the barrier could miss another wave's store: stretched jaws); + /// without the switch, or without a barrier, its translation is as before. + #[test] + fn face_fix_reads_16_bit_typed_loads_after_a_barrier_through_the_raw_view() { + // s_barrier; buffer_load_format_d16_x v1, v0, s[8:11], 0 idxen; s_waitcnt vmcnt(0) + let with = [0xBF8A_0000u32, 0xE200_2000, 0x8002_0100, 0xBF8C_3F70]; + let without = [0xE200_2000u32, 0x8002_0100, 0xBF8C_3F70]; + let lowered = |body: &[u32], on: bool| { + let was = super::lower::TEST_FACE_FIX.replace(Some(on)); + let r = stores_v1_dxil(body); + super::lower::TEST_FACE_FIX.set(was); + r.unwrap() + }; + let raw_loads = || super::lower::FACE_RAW_LOADS.load(std::sync::atomic::Ordering::Relaxed); + let before = raw_loads(); + assert_ne!(lowered(&with, true), lowered(&with, false), "raw load not taken"); + assert!(raw_loads() > before, "the raw load is counted"); + assert_eq!(lowered(&with, false), lowered(&with, false), "off: the same translation"); + assert_eq!(lowered(&without, true), lowered(&without, false), "no barrier: no raw load"); + } + + /// [`stores_v1`]'s translation. + fn stores_v1_dxil(body: &[u32]) -> Result<Vec<u8>, ShaderError> { use crate::native::RootParam; use crate::{ResourceType, RootType, UsedResource}; // s_mov_b32 s1, 0; s_load_dwordx4 s[8:11], s[0:1], 0 @@ -2921,7 +2949,7 @@ mod tests { let st = structure::structure(&p).unwrap(); let container = crate::dxbc::build(&[]); let c = Container::parse(&container).unwrap(); - emit(&c, &native, &p, &st, &io, &res).map(|_| ()) + emit(&c, &native, &p, &st, &io, &res).map(|out| out.dxil) } /// The high dword of a wave64 mask rewritten alone (`s_mov_b32 vcc_hi` ``` </details>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 18:09:22 +00:00
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-30 17:45 UTC · original

Please attach both logs from the run that went wrong. Without them we can only guess. Paste %LOCALAPPDATA% into the address bar of File Explorer to get there.

  1. The play log, in %LOCALAPPDATA%\victory\logs\: the newest victory-nvidia-play-<date>-<time>-<number>.log (from victory.exe) or victory-nvidia-<date>-<time>.log (from the script launcher). The window shows its path at the start, on the line Log: ....
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newest victory-<date>-<time>-<number>.crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\.

Also say which GPU, Windows version (10 or 11)

**@⁠github-actions[bot]** on GitHub · 2026-11-30 17:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4246#issuecomment-7286790889) Please attach both logs from the run that went wrong. Without them we can only guess. Paste `%LOCALAPPDATA%` into the address bar of File Explorer to get there. 1. The play log, in `%LOCALAPPDATA%\victory\logs\`: the newest `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or `victory-nvidia-<date>-<time>.log` (from the script launcher). The window shows its path at the start, on the line `Log: ...`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. Also say which GPU, Windows version (10 or 11)
Author
Owner

@⁠diafebus on GitHub · 2026-11-30 17:47 UTC · original

A follow-up short timing collection now contains 330 individual present intervals spanning 20.9825 seconds. Average throughput is 15.73 FPS, median frame time 61.25 ms, p95 115.9 ms, longest 228.6 ms. These are recorded frame intervals, with no generated-frame count used.

The user was asked to walk/pan around the cell during the requested 20-second collection. The data comes from complete framelog batches emitted during that window, which can include intervals outside its exact boundaries. Movement throughout the sample is not independently verified. No compilation was started during collection. This supports the observed 10–15 FPS walking result, but remains a single candidate measurement without a matched baseline route.

**@⁠diafebus** on GitHub · 2026-11-30 17:47 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4246#issuecomment-7286852538) A follow-up short timing collection now contains 330 individual present intervals spanning 20.9825 seconds. Average throughput is 15.73 FPS, median frame time 61.25 ms, p95 115.9 ms, longest 228.6 ms. These are recorded frame intervals, with no generated-frame count used. The user was asked to walk/pan around the cell during the requested 20-second collection. The data comes from complete framelog batches emitted during that window, which can include intervals outside its exact boundaries. Movement throughout the sample is not independently verified. No compilation was started during collection. This supports the observed 10–15 FPS walking result, but remains a single candidate measurement without a matched baseline route.
Author
Owner

@⁠diafebus on GitHub · 2026-11-30 19:25 UTC · original

Clarifying the automated log request. Hardware is RX 6950 XT, running Fedora Linux 45 KDE with GE-Proton11-14. This is a local Wine-patched v2026.11.30.02 build launched directly with run --execute. Its explicit VICTORY_LOG_FILE output serves as the renderer/play log, so the Windows play-launcher filename in the template does not apply to this launch.

This issue reports a successful face-fix port and preparation-setting improvement. The reported candidate run ended through title suspension. Its state directory's crashes.log is byte-for-byte identical to the older .29.03 reference data copied into this run, and its individual crash files predate the run.

The full sanitized before/candidate renderer logs, Proton output, launch settings and measured frame-interval window are prepared as victory-nvidia-4246-sanitized-logs.zip for attachment. Relevant candidate-log lines are below. The face patch is inline in the issue body and defaults off. The performance settings are existing launcher options, with optimized hashing restored. Multiple changes were combined, so the report gives the precise configuration and avoids attributing the gain to a single option.

2026-11-30T17:37:07.122302Z  INFO victory_gpu::list::thin: list calls are written down and translated by threads of ours (VICTORY_THIN=1) threads=8
2026-11-30T17:37:07.121838Z  INFO victory_gpu::queue::behind: submissions are prepared and sent by a thread of ours, not by the thread that submits (VICTORY_ASYNC_SUBMIT=1) frames=1 runs=64
2026-11-30T17:49:49.037656Z  INFO victory_hle::modules::lifecycle: title suspended; ending the title
2026-11-30T17:49:49.037663Z  WARN victory_gpu::pipeline::refused: pipeline failures: 0 host pipelines failed (none), 0 shaders do not translate failed=0 untranslated=0 retried=0 retry_made=0
**@⁠diafebus** on GitHub · 2026-11-30 19:25 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4246#issuecomment-7289368951) Clarifying the automated log request. Hardware is RX 6950 XT, running Fedora Linux 45 KDE with GE-Proton11-14. This is a local Wine-patched v2026.11.30.02 build launched directly with `run --execute`. Its explicit `VICTORY_LOG_FILE` output serves as the renderer/play log, so the Windows play-launcher filename in the template does not apply to this launch. This issue reports a successful face-fix port and preparation-setting improvement. The reported candidate run ended through title suspension. Its state directory's `crashes.log` is byte-for-byte identical to the older .29.03 reference data copied into this run, and its individual crash files predate the run. The full sanitized before/candidate renderer logs, Proton output, launch settings and measured frame-interval window are prepared as `victory-nvidia-4246-sanitized-logs.zip` for attachment. Relevant candidate-log lines are below. The face patch is inline in the issue body and defaults off. The performance settings are existing launcher options, with optimized hashing restored. Multiple changes were combined, so the report gives the precise configuration and avoids attributing the gain to a single option. ```text 2026-11-30T17:37:07.122302Z INFO victory_gpu::list::thin: list calls are written down and translated by threads of ours (VICTORY_THIN=1) threads=8 2026-11-30T17:37:07.121838Z INFO victory_gpu::queue::behind: submissions are prepared and sent by a thread of ours, not by the thread that submits (VICTORY_ASYNC_SUBMIT=1) frames=1 runs=64 2026-11-30T17:49:49.037656Z INFO victory_hle::modules::lifecycle: title suspended; ending the title 2026-11-30T17:49:49.037663Z WARN victory_gpu::pipeline::refused: pipeline failures: 0 host pipelines failed (none), 0 shaders do not translate failed=0 untranslated=0 retried=0 retry_made=0 ```
Author
Owner

@⁠diafebus on GitHub · 2026-11-30 19:29 UTC · original

We completed a 30-second cell walking/panning collection on the same working candidate.

  • 489 logged frame intervals spanning 30.9671 seconds, average 15.79 FPS, median 61.3 ms, p95 109.2 ms, longest 193.6 ms. Complete framelog batches can straddle the exact sampling boundary.
  • AMD sysfs sampled once per second reports GPU busy 74.5% average, range 3–99%. The game and its Wine server used roughly 8 logical-core equivalents, about 33.5% of the 24 logical CPUs. Eight list workers together accounted for ~1.61 cores, submission ~0.33, Wine server ~0.24. These are CPU-time totals, with no inference of linear scaling.
  • VRAM usage was essentially at the reported usable limit throughout, approximately 17.152GB used versus 17.163GB total. Shared GTT allocation was ~10.39GB at a later inspection. This does not establish active transfer/eviction rates. The runtime independently logs no room for new textures and queued texture uploads waiting for memory.
  • One runtime-counter sample reports 17.2ms with nothing queued, 15.7ms of it overlapping submission-thread work, 11.8ms submission-thread GPU waits, and 5.1ms texture refresh. These scopes overlap and are not additive.
  • The window census reports 9,086MB of shadow windows over 6,024MB of title memory. The comment notes duplicate copies of overlaps. We prepared a follow-up using WINDOW_KB=1024 and WINDOW_TAILS=1 from the release launcher's low-RAM path to investigate this, but have no result for it yet on this 64GB host.

The hardware is substantially busier than during the earlier slow direct-launch run. Memory pressure and overlap/preparation cost now look worth investigating alongside GPU cost. perf call-stack collection was blocked by the OS permissions and sudo authentication was unavailable, so these results come from per-thread /proc CPU/scheduler/wait-state samples, AMD sysfs, and the renderer log. The wait snapshots alone cannot identify the exact blocking code.

**@⁠diafebus** on GitHub · 2026-11-30 19:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4246#issuecomment-7289467241) We completed a 30-second cell walking/panning collection on the same working candidate. - 489 logged frame intervals spanning 30.9671 seconds, average **15.79 FPS**, median **61.3 ms**, p95 **109.2 ms**, longest **193.6 ms**. Complete framelog batches can straddle the exact sampling boundary. - AMD sysfs sampled once per second reports GPU busy **74.5% average**, range 3–99%. The game and its Wine server used roughly **8 logical-core equivalents**, about 33.5% of the 24 logical CPUs. Eight list workers together accounted for ~1.61 cores, submission ~0.33, Wine server ~0.24. These are CPU-time totals, with no inference of linear scaling. - VRAM usage was essentially at the reported usable limit throughout, approximately 17.152GB used versus 17.163GB total. Shared GTT allocation was ~10.39GB at a later inspection. This does not establish active transfer/eviction rates. The runtime independently logs no room for new textures and queued texture uploads waiting for memory. - One runtime-counter sample reports 17.2ms with nothing queued, 15.7ms of it overlapping submission-thread work, 11.8ms submission-thread GPU waits, and 5.1ms texture refresh. These scopes overlap and are not additive. - The window census reports 9,086MB of shadow windows over 6,024MB of title memory. The comment notes duplicate copies of overlaps. We prepared a follow-up using WINDOW_KB=1024 and WINDOW_TAILS=1 from the release launcher's low-RAM path to investigate this, but have no result for it yet on this 64GB host. The hardware is substantially busier than during the earlier slow direct-launch run. Memory pressure and overlap/preparation cost now look worth investigating alongside GPU cost. `perf` call-stack collection was blocked by the OS permissions and sudo authentication was unavailable, so these results come from per-thread `/proc` CPU/scheduler/wait-state samples, AMD sysfs, and the renderer log. The wait snapshots alone cannot identify the exact blocking code.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA#4247
No description provided.