From de0bbd4b7b0f116f6ef00037d1c5892d3b0f224b Mon Sep 17 00:00:00 2001 From: 101Leafy <6332664+101Leafy@users.noreply.github.com> Date: Sun, 29 Nov 2026 01:35:31 -0600 Subject: [PATCH 1/6] Shader tests: the lane-read reference returns with no hardware device, like the other GPU tests --- crates/victory-shader/src/emit/wave64_tests.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/victory-shader/src/emit/wave64_tests.rs b/crates/victory-shader/src/emit/wave64_tests.rs index c4450b3dae..3023ddcd81 100644 --- a/crates/victory-shader/src/emit/wave64_tests.rs +++ b/crates/victory-shader/src/emit/wave64_tests.rs @@ -2144,11 +2144,9 @@ fn nv05d1_native_readlane_gpu_reference() { .expect("DXIL validation"); } - let got = dispatched_words( - &shader, - &[0; 4], - threads, - ).expect("NV05D1 requires hardware GPU readback"); + let Some(got) = dispatched_words(&shader, &[0; 4], threads) else { + return; + }; assert_eq!( got, From ead1722b493e1ec33b6e5b11937f35bba84e0509 Mon Sep 17 00:00:00 2001 From: 101Leafy <6332664+101Leafy@users.noreply.github.com> Date: Sun, 29 Nov 2026 01:41:38 -0600 Subject: [PATCH 2/6] Shaders: half-meet cap uses checked_div, for clippy 1.98's manual_checked_ops --- crates/victory-shader/src/emit/lower.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/victory-shader/src/emit/lower.rs b/crates/victory-shader/src/emit/lower.rs index 9f8f1cc133..e7a27903b0 100644 --- a/crates/victory-shader/src/emit/lower.rs +++ b/crates/victory-shader/src/emit/lower.rs @@ -2353,7 +2353,7 @@ impl<'a> Lower<'a> { // Three dwords past the table count meetings, wait polls and wait atomics. let spare = HOST_LDS_DWORDS.saturating_sub(s.lds_dwords).saturating_sub(3); let per = 2 * waves; - let cap = if per == 0 { 0 } else { spare / per }; + let cap = spare.checked_div(per).unwrap_or(0); let base = s.lds_dwords; s.lds_dwords += cap * per; let tally = s.lds_dwords; From d4cee9453e81e55547d9417ca55b1c2501b7ec38 Mon Sep 17 00:00:00 2001 From: 101Leafy <6332664+101Leafy@users.noreply.github.com> Date: Sun, 29 Nov 2026 03:26:48 -0600 Subject: [PATCH 3/6] Loader: unwind_copy only with diagnostics, the one build its stack sampler is in, so clippy -D warnings passes without it --- crates/victory-loader/src/crash.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/victory-loader/src/crash.rs b/crates/victory-loader/src/crash.rs index d2f03b439c..7b0fa6f5f7 100644 --- a/crates/victory-loader/src/crash.rs +++ b/crates/victory-loader/src/crash.rs @@ -801,6 +801,7 @@ pub(crate) fn unwind_into(context: CONTEXT, low: usize, high: usize, frames: &mu /// pages and faulted, run perfil-barco 28/11). Registers that point into the /// copied range are moved into the copy; a frame register that points /// elsewhere ends the walk. +#[cfg(feature = "diagnostics")] pub(crate) fn unwind_copy(context: CONTEXT, copy: &[u8], len: usize, frames: &mut Vec) { let mut aligned = Aligned16(context); let context = &mut aligned.0; From 8c57474dcf209a3360627e816021f58517a258c8 Mon Sep 17 00:00:00 2001 From: 101Leafy <6332664+101Leafy@users.noreply.github.com> Date: Sun, 29 Nov 2026 03:34:08 -0600 Subject: [PATCH 4/6] Shaders: clippy -D warnings clean again (unused imports, a while on an unchanged flag, the record test helper's arguments) --- crates/victory-shader/src/emit/lower.rs | 1 - crates/victory-shader/src/emit/lower/analysis.rs | 11 ++++------- crates/victory-shader/src/native.rs | 1 + 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/crates/victory-shader/src/emit/lower.rs b/crates/victory-shader/src/emit/lower.rs index 6c2ce87130..a26d9bbe2b 100644 --- a/crates/victory-shader/src/emit/lower.rs +++ b/crates/victory-shader/src/emit/lower.rs @@ -591,7 +591,6 @@ mod analysis; pub use analysis::with_program; pub use analysis::{lds_clamped, lds_clamped_mesh}; pub(super) use analysis::last_resort_wanted; -pub(in crate::emit) use analysis::lane_regions; pub(in crate::emit) use analysis::once_per_thread; use analysis::{CLAMPED, CLAMPED_MESH, lds_mesh_free}; pub(super) use analysis::{ diff --git a/crates/victory-shader/src/emit/lower/analysis.rs b/crates/victory-shader/src/emit/lower/analysis.rs index 482e3d6650..92cbc9be87 100644 --- a/crates/victory-shader/src/emit/lower/analysis.rs +++ b/crates/victory-shader/src/emit/lower/analysis.rs @@ -3,8 +3,7 @@ use std::collections::{HashMap, HashSet}; use super::{ - MASK_ELSEWHERE, NEEDS, PAIR_MEETINGS, Why, has_memory_or_export_side_effect, - reads_mask_as_data, + MASK_ELSEWHERE, NEEDS, Why, has_memory_or_export_side_effect, reads_mask_as_data, }; use crate::gfx10::{Fields, NULL, Operand}; use crate::ir::{EXEC, Exit, Inst, Program, Reg, Value}; @@ -464,8 +463,9 @@ pub(super) fn lane_uniform( // per block: a memory write of the program may have run by its end (loops come round) let mut wrote = vec![false; p.blocks.len()]; let order = crate::ir::reverse_postorder(&p.blocks); - while loads { - let mut more = false; + let mut more = loads; + while more { + more = false; for &b in &order { let w = p.blocks[b].preds.iter().any(|&q| wrote[q]) || p.blocks[b].insts.iter().any(writes); if w && !wrote[b] { @@ -473,9 +473,6 @@ pub(super) fn lane_uniform( more = true; } } - if !more { - break; - } } for b in order { let block = &p.blocks[b]; diff --git a/crates/victory-shader/src/native.rs b/crates/victory-shader/src/native.rs index b39cde802a..5460cca244 100644 --- a/crates/victory-shader/src/native.rs +++ b/crates/victory-shader/src/native.rs @@ -1652,6 +1652,7 @@ mod tests { } /// A 32-byte metadata record. + #[allow(clippy::too_many_arguments)] fn record(tag: u8, kind: u8, root: u8, offset: u32, register: u32, dwords: u8, user: u8, slot: u8) -> [u8; 32] { let mut r = [0u8; 32]; r[0] = tag; From 6a39f4f252ee957c68ca8c28a5ea91945590afab Mon Sep 17 00:00:00 2001 From: Jose Date: Sun, 29 Nov 2026 14:26:42 +0100 Subject: [PATCH 5/6] Fix slot eviction busy race, shader-model adapter reuse, parallel card_steps test, and launcher scripts - victory-gpu (resource): honor the busy flag returned by descriptor::evict_slots in slot_evict so textures with active slot creation on another thread are skipped (incrementing SLOT_EVICT[6]) instead of being evicted. - victory-gpu (streamline): use the adapter returned by game_adapter() in highest_shader_model instead of discarding it and re-querying hardware_adapter(). - victory-gpu (card_steps): clear the test page range in late::PAGES via late::forget before running places_written_after_sending_are_learned and fills_done_on_the_cpu_are_learned_too so parallel test runs do not collide on reused heap pages. - victory-gpu (font): remove unreachable duplicate b'%' arm in the F3 panel bitmap font. - PLAY_FRAMEGEN.cmd: preserve %errorlevel% before pause in the check branch so failed checks do not exit with 0. - PLAY_FACES_FIX.cmd: default to Windows powershell and use pwsh only when available instead of failing when PowerShell 7 is not installed. --- PLAY_FACES_FIX.cmd | 5 +++-- PLAY_FRAMEGEN.cmd | 3 ++- crates/victory-gpu/src/host/card_steps.rs | 12 ++++++++++++ crates/victory-gpu/src/host/font.rs | 1 - crates/victory-gpu/src/resource.rs | 4 ++++ crates/victory-gpu/src/streamline.rs | 8 +++----- 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/PLAY_FACES_FIX.cmd b/PLAY_FACES_FIX.cmd index d936a09f13..e079e55468 100644 --- a/PLAY_FACES_FIX.cmd +++ b/PLAY_FACES_FIX.cmd @@ -3,10 +3,11 @@ setlocal rem GTA VI with DLSS frame generation and facial mesh relocation enabled. rem Usage: PLAY_FACES_FIX.cmd [mode 1-6], default mode 1. set "PS1=%~dp0scripts\play-gta6-framegen.ps1" -set "PSH=pwsh" +set "PSH=powershell" set "MODE=%~1" if "%MODE%"=="" set "MODE=1" -if exist "C:\Program Files\PowerShell\7\pwsh.exe" set "PSH=C:\Program Files\PowerShell\7\pwsh.exe" +where pwsh >nul 2>nul && set "PSH=pwsh" +if "%PSH%"=="powershell" if exist "C:\Program Files\PowerShell\7\pwsh.exe" set "PSH=C:\Program Files\PowerShell\7\pwsh.exe" if not exist "%PS1%" ( echo Not found: %PS1% diff --git a/PLAY_FRAMEGEN.cmd b/PLAY_FRAMEGEN.cmd index d3d28bbf06..9bcada8c1c 100644 --- a/PLAY_FRAMEGEN.cmd +++ b/PLAY_FRAMEGEN.cmd @@ -14,9 +14,10 @@ if not exist "%PS1%" ( ) if /i not "%~1"=="check" goto :menu %PSH% -NoProfile -ExecutionPolicy Bypass -File "%PS1%" -Check +set "RC=%errorlevel%" pause rem The check's answer is what callers read: a failed check says so. -exit /b %errorlevel% +exit /b %RC% :menu set "PICK=%~1" if not "%PICK%"=="" goto :run diff --git a/crates/victory-gpu/src/host/card_steps.rs b/crates/victory-gpu/src/host/card_steps.rs index 532955973b..440eab84e8 100644 --- a/crates/victory-gpu/src/host/card_steps.rs +++ b/crates/victory-gpu/src/host/card_steps.rs @@ -1187,6 +1187,16 @@ mod late { pages.as_ref().is_some_and(|p| (from / PAGE..to.div_ceil(PAGE)).any(|page| p.contains(&page))) } + #[cfg(test)] + pub(super) fn forget(from: usize, to: usize) { + let mut pages = PAGES.lock().unwrap_or_else(|e| e.into_inner()); + if let Some(p) = pages.as_mut() { + for page in from / PAGE..to.div_ceil(PAGE) { + p.remove(&page); + } + } + } + /// The submission has landed: what the fills of `sent` (place, length, /// place in the buffer between) read, in `back`, compared with title /// memory now. @@ -2108,6 +2118,7 @@ mod tests { // Two pages of memory of our own, page-aligned, as title memory. let memory = vec![0u8; 4 * 4096]; let page = (memory.as_ptr() as usize).next_multiple_of(4096); + late::forget(page, page + 2 * 4096); let (kept, changed) = (page, page + 4096 + 64); // What the card read: the bytes as they were, at 0 and 256 of the // buffer between. @@ -2130,6 +2141,7 @@ mod tests { fn fills_done_on_the_cpu_are_learned_too() { let memory = vec![0u8; 4 * 4096]; let page = (memory.as_ptr() as usize).next_multiple_of(4096); + late::forget(page, page + 2 * 4096); let (kept, changed) = (page + 16, page + 4096 + 0xbd0); // The upload memory each was filled into: the bytes as they were. let upload = vec![0u8; 1024]; diff --git a/crates/victory-gpu/src/host/font.rs b/crates/victory-gpu/src/host/font.rs index 103c7b656a..4cfeefd2c5 100644 --- a/crates/victory-gpu/src/host/font.rs +++ b/crates/victory-gpu/src/host/font.rs @@ -52,7 +52,6 @@ pub(super) const fn glyph(c: u8) -> [u8; 7] { b'<' => [0b00010, 0b00100, 0b01000, 0b10000, 0b01000, 0b00100, 0b00010], b'*' => [0, 0b00100, 0b10101, 0b01110, 0b10101, 0b00100, 0], b':' => [0, 0b01100, 0b01100, 0, 0b01100, 0b01100, 0], - b'%' => [0b11001, 0b11010, 0b00010, 0b00100, 0b01000, 0b01011, 0b10011], b'_' => [0, 0, 0, 0, 0, 0, 0b11111], b'=' => [0, 0, 0b11111, 0, 0b11111, 0, 0], b'(' => [0b00010, 0b00100, 0b01000, 0b01000, 0b01000, 0b00100, 0b00010], diff --git a/crates/victory-gpu/src/resource.rs b/crates/victory-gpu/src/resource.rs index 3424581e1a..7d59e8ec51 100644 --- a/crates/victory-gpu/src/resource.rs +++ b/crates/victory-gpu/src/resource.rs @@ -3559,6 +3559,10 @@ fn slot_evict(video: Option<[u64; 4]>, idle_ms: u64, frames: u64, flush: u8) -> // holds the table: the texture is in use then, and stays.) let (reset, busy) = crate::descriptor::evict_slots(at, &slots[&at]); SLOT_EVICT[2].fetch_add(reset, Relaxed); + if busy { + SLOT_EVICT[6].fetch_add(1, Relaxed); + continue; + } let outcome = { let all = textures(); if !all.contains(&at) { diff --git a/crates/victory-gpu/src/streamline.rs b/crates/victory-gpu/src/streamline.rs index d24e040fcf..08b573f5aa 100644 --- a/crates/victory-gpu/src/streamline.rs +++ b/crates/victory-gpu/src/streamline.rs @@ -1007,12 +1007,10 @@ pub fn highest_shader_model() -> Option<(u32, u32)> { let mut device: Option = None; // As the title's device (`host::create`): on the first adapter where // the card takes none. - if let Some((adapter, ..)) = victory_shader::emit::host::hardware_adapter() { - let _ = D3D12CreateDevice(&adapter, D3D_FEATURE_LEVEL_11_0, &mut device); - } + let _ = D3D12CreateDevice(&adapter, D3D_FEATURE_LEVEL_11_0, &mut device); if device.is_none() { - let adapter = CreateDXGIFactory1::().ok()?.EnumAdapters1(0).ok()?; - D3D12CreateDevice(&adapter, D3D_FEATURE_LEVEL_11_0, &mut device).ok()?; + let fallback = CreateDXGIFactory1::().ok()?.EnumAdapters1(0).ok()?; + D3D12CreateDevice(&fallback, D3D_FEATURE_LEVEL_11_0, &mut device).ok()?; } device? }; From aca8f64e99ac2e2ca31a4fc722fd93d53bb784a7 Mon Sep 17 00:00:00 2001 From: Emir Aytug <272006952+ea0099@users.noreply.github.com> Date: Sun, 29 Nov 2026 18:03:48 +0100 Subject: [PATCH 6/6] Clippy: main's victory-gpu and victory-hle findings, with no behaviour change `cargo clippy --workspace --all-targets --locked -- -D warnings` (CI gate 1) has 38 findings on main. #2019 clears the five in victory-loader and victory-shader, #2486 four in victory-gpu (font.rs's second '%', which clippy reports twice, `busy`, `adapter`). This clears the other 29, so with the three in, the gate has none. Written as clippy asks (same behaviour): - shader_cache.rs: unused `AtomicBool` import - panel.rs, pipeline/library.rs: `is_multiple_of` - list.rs: `handles` is already a slice - resource.rs: `unwrap_or` for a plain `match` on a local - gameinput.rs (2): `then_some` - compose.rs: `Composer::record` takes its eight arguments (allowed, as elsewhere in the tree) - streamline.rs: the buffer-count test is a `const` assertion - lib.rs, lifecycle.rs: the item after the test module moves above it - Cargo.toml: rust-version 1.89, which the code already needs (`File::try_lock` in pipeline/library.rs; the toolchain is 1.98.1) Unused since the 11.29.01 merge, kept and marked `#[allow(dead_code)]` with a note, not deleted, so whoever wires them back has them: Host::fetch_buffer with fetchmem::{sizes, buffer}, take_spare_wb, flush_all's MANY_CHUNK and its ahead snapshot, Shadow::nothing_new_with and watch::nothing_new_with, shadow::wide_chunk, HostHeap::mirror_for_pass, recycle::Kind::Card, memory::lock_memory, make::Queue::pop, and create_loose_compute with loose_compute, fspx_container and MAX_LOOSE_PART. Co-Authored-By: Claude Opus 5.5 --- Cargo.toml | 2 +- crates/victory-gpu/src/compose.rs | 1 + crates/victory-gpu/src/descriptor/host.rs | 2 ++ crates/victory-gpu/src/fetchmem.rs | 4 ++++ crates/victory-gpu/src/host.rs | 7 ++++++- crates/victory-gpu/src/host/panel.rs | 2 +- crates/victory-gpu/src/host/recycle.rs | 2 ++ crates/victory-gpu/src/lib.rs | 5 +++-- crates/victory-gpu/src/list.rs | 2 +- crates/victory-gpu/src/memory.rs | 2 ++ crates/victory-gpu/src/pipeline.rs | 8 ++++++++ crates/victory-gpu/src/pipeline/library.rs | 2 +- crates/victory-gpu/src/pipeline/make.rs | 2 ++ crates/victory-gpu/src/resource.rs | 2 +- crates/victory-gpu/src/shader_cache.rs | 2 +- crates/victory-gpu/src/shadow.rs | 4 ++++ crates/victory-gpu/src/streamline.rs | 10 ++++++---- crates/victory-gpu/src/watch.rs | 2 ++ crates/victory-hle/src/modules/gameinput.rs | 4 ++-- crates/victory-hle/src/modules/lifecycle.rs | 13 +++++++------ 20 files changed, 57 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4e21b692d6..498c05c1aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ exclude = ["tests/fixtures"] [workspace.package] version = "0.1.0" edition = "2024" -rust-version = "1.88" +rust-version = "1.89" license = "GPL-3.0-or-later" publish = false diff --git a/crates/victory-gpu/src/compose.rs b/crates/victory-gpu/src/compose.rs index 66f00e2e53..e07dc672b0 100644 --- a/crates/victory-gpu/src/compose.rs +++ b/crates/victory-gpu/src/compose.rs @@ -218,6 +218,7 @@ impl Composer { /// Each presenter command-list slot owns its own pair of SRVs. The swap /// chain may have several outstanding presents; the slot is selected by /// the completion fence, and its descriptors are only overwritten on reuse. + #[allow(clippy::too_many_arguments)] pub(crate) fn record( &mut self, host: &Host, diff --git a/crates/victory-gpu/src/descriptor/host.rs b/crates/victory-gpu/src/descriptor/host.rs index 784d0390b9..f05d0a0208 100644 --- a/crates/victory-gpu/src/descriptor/host.rs +++ b/crates/victory-gpu/src/descriptor/host.rs @@ -4580,6 +4580,8 @@ impl HostHeap { /// slot back in the written set, which would have the next pass look at /// it again for nothing (a title write leaves a buffer slot for later, /// and the pass's own look makes it). + // (unused since the 11.29.01 merge; the batch's own `mirror_for_pass` is the one called) + #[allow(dead_code)] pub(crate) fn mirror_for_pass(&self, index: u32, handle: u64) -> Option { if !crate::asked_for!("VICTORY_HEAP_LOOK_QUIET") { return self.mirror(index, handle, true); diff --git a/crates/victory-gpu/src/fetchmem.rs b/crates/victory-gpu/src/fetchmem.rs index 848676e7fe..0745e6bd1f 100644 --- a/crates/victory-gpu/src/fetchmem.rs +++ b/crates/victory-gpu/src/fetchmem.rs @@ -33,6 +33,8 @@ pub(crate) fn on() -> bool { /// (rounded up to 16 MiB, so the next fetches fit) unless `tight`, then /// rounded to 1 MiB, then as small as the bytes allow. Never fewer than /// `total`. +// (unused since the 11.29.01 merge, with `Host::fetch_buffer`) +#[allow(dead_code)] pub(crate) fn sizes(total: u64, tight: bool) -> Vec { let mut sizes = Vec::with_capacity(3); if !tight { @@ -51,6 +53,8 @@ static COUNTS: [AtomicU64; 3] = [const { AtomicU64::new(0) }; 3]; /// ([`sizes`]) and then, after `pause`, the least once more. The buffer and /// its size; `None` only when not even the least could be made (the caller /// skips the fetch, [`skipped`]). With the switch off, the usual size once. +// (unused since the 11.29.01 merge, with `Host::fetch_buffer`) +#[allow(dead_code)] pub(crate) fn buffer( total: u64, tight: bool, diff --git a/crates/victory-gpu/src/host.rs b/crates/victory-gpu/src/host.rs index 7959e73ad6..705bb77fc9 100644 --- a/crates/victory-gpu/src/host.rs +++ b/crates/victory-gpu/src/host.rs @@ -2963,6 +2963,8 @@ fn scratch_wb(host: &Host) -> bool { /// Picks a kept chunk of `size` bytes from `spare`: write-combined callers /// (`wb == false`) only take write-combined chunks; write-back callers prefer /// write-back chunks and reuse write-combined fallback chunks when none exist. +// (unused since the 11.29.01 merge; its tests still run) +#[allow(dead_code)] fn take_spare_wb(spare: &mut Spare, size: u64, wb: bool, is_wb: impl Fn(&T) -> bool) -> Option { spare .take_if(size, |t| is_wb(t) == wb) @@ -12524,7 +12526,7 @@ impl Batch { if ahead { crate::watch::ahead_snapshot_into(&mut self.ahead_snap); } - let ahead_snap = &self.ahead_snap; + // (`self.ahead_snap` is filled above but no longer read here: unused since the 11.29.01 merge.) FLUSHES[3].fetch_add(spans.len() as u64, Ordering::Relaxed); // (The textures one to a thread; the copies as `VICTORY_WIDE_CHUNK` says.) crate::shadow::wide_each_scoped(spans.len() + due.len(), 1, &|lo, hi| { @@ -12665,6 +12667,7 @@ impl Batch { // and any thread woken. (Thousands of them, the heap's buffer views // once a frame: on the threads, below.) const FEW: usize = 256; + #[allow(dead_code)] // (unused since the 11.29.01 merge) const MANY_CHUNK: usize = 8; let light = crate::watch::light(); let batch = crate::shadow::new_batch(); @@ -15521,6 +15524,8 @@ impl Host { /// least after a moment (the card retires what it holds meanwhile). /// `None` only when not even the least fits: the caller skips the fetch /// (`crate::fetchmem::skipped`). The buffer, its mapping and its size. + // (unused since the 11.29.01 merge) + #[allow(dead_code)] fn fetch_buffer(&self, total: u64) -> Option<(ID3D12Resource, usize, u64)> { crate::fetchmem::buffer( total, diff --git a/crates/victory-gpu/src/host/panel.rs b/crates/victory-gpu/src/host/panel.rs index a82eff241a..105b2d66bf 100644 --- a/crates/victory-gpu/src/host/panel.rs +++ b/crates/victory-gpu/src/host/panel.rs @@ -146,7 +146,7 @@ fn graph_lit(graphs: &[Vec], shape: Shape, x: u32, below: u32) -> bool { return false; } if within == GRAPH - 1 { - return x % 2 == 0; + return x.is_multiple_of(2); } let Some(samples) = graphs.get(i) else { return false; diff --git a/crates/victory-gpu/src/host/recycle.rs b/crates/victory-gpu/src/host/recycle.rs index 880fc87b70..a9d25b7a5d 100644 --- a/crates/victory-gpu/src/host/recycle.rs +++ b/crates/victory-gpu/src/host/recycle.rs @@ -44,6 +44,8 @@ pub(crate) enum Kind { /// [`super::Host::upload_buffer`]. Upload = 1, /// [`super::Host::uav_buffer`]: the card's memory. + // (unused since the 11.29.01 merge) + #[allow(dead_code)] Card = 2, } diff --git a/crates/victory-gpu/src/lib.rs b/crates/victory-gpu/src/lib.rs index b78808abaf..d5f59083e1 100644 --- a/crates/victory-gpu/src/lib.rs +++ b/crates/victory-gpu/src/lib.rs @@ -265,6 +265,9 @@ pub use watch::{ title_memory_written, title_placeholder_reserved, use_lazy_views, use_soft_views, writing as kernel_will_write, Remapping, }; +#[doc(hidden)] +pub use watch::set_range_lock; + #[cfg(test)] mod world_tests { #[test] @@ -276,5 +279,3 @@ mod world_tests { assert!(!super::world_reached(10_000, 20)); } } -#[doc(hidden)] -pub use watch::set_range_lock; diff --git a/crates/victory-gpu/src/list.rs b/crates/victory-gpu/src/list.rs index 25790e328a..b0820036be 100644 --- a/crates/victory-gpu/src/list.rs +++ b/crates/victory-gpu/src/list.rs @@ -2655,7 +2655,7 @@ mod state { }; // SAFETY: the title passes a handle or null. let depth = unsafe { depth.as_ref() }.copied().unwrap_or(0); - with_set_state(this, |list, s| s.set_targets(list, &handles, depth)); + with_set_state(this, |list, s| s.set_targets(list, handles, depth)); } pub(super) extern "system" fn draw( this: This, diff --git a/crates/victory-gpu/src/memory.rs b/crates/victory-gpu/src/memory.rs index b6f9392558..7df1aad18a 100644 --- a/crates/victory-gpu/src/memory.rs +++ b/crates/victory-gpu/src/memory.rs @@ -371,6 +371,8 @@ mod timing { /// [`MEMORY`], locked; the wait counted in [`timing::WAIT`] when it was not /// free at once. +// (unused since the 11.29.01 merge) +#[allow(dead_code)] fn lock_memory() -> std::sync::MutexGuard<'static, Option> { match MEMORY.try_lock() { Ok(guard) => guard, diff --git a/crates/victory-gpu/src/pipeline.rs b/crates/victory-gpu/src/pipeline.rs index fd41ce0f85..e283b7f221 100644 --- a/crates/victory-gpu/src/pipeline.rs +++ b/crates/victory-gpu/src/pipeline.rs @@ -836,11 +836,15 @@ pub(crate) extern "system" fn create_compute_x( /// The largest part of a console pipeline that is believed (the biggest seen /// is 127 KiB of code). +// (unused since the 11.29.01 merge, with `create_loose_compute`) +#[allow(dead_code)] const MAX_LOOSE_PART: usize = 16 << 20; /// A container holding one `ACCC` part: an `FSPX` of `entries` (kind, data), as /// the console compiler stores a compute program that another compiler made /// (`victory_shader::native::fspx_program` reads it back). +// (unused since the 11.29.01 merge outside tests, with `create_loose_compute`) +#[allow(dead_code)] fn fspx_container(entries: &[(u32, &[u8])]) -> Vec { let mut fspx = b"FSPX".to_vec(); fspx.extend(1u32.to_le_bytes()); @@ -880,6 +884,8 @@ fn fspx_container(entries: &[(u32, &[u8])]) -> Vec { /// /// # Safety /// Every pair names bytes of the title that are mapped. +// (unused since the 11.29.01 merge, with `create_loose_compute`) +#[allow(dead_code)] unsafe fn loose_compute(desc: &[u64; 11]) -> Option> { let part = |at: usize| -> Option<&[u8]> { let (address, size) = (desc[at], desc[at + 1] as usize); @@ -893,6 +899,8 @@ unsafe fn loose_compute(desc: &[u64; 11]) -> Option> { /// Device method 0x218 `(this, description, iid, out)`: a compute pipeline /// whose console parts come loose, not in a container. They are put into one /// and the pipeline goes on as any other. +// (unused since the 11.29.01 merge: no device method slot names it) +#[allow(dead_code)] pub(crate) extern "system" fn create_loose_compute( _: This, desc: *const [u64; 11], diff --git a/crates/victory-gpu/src/pipeline/library.rs b/crates/victory-gpu/src/pipeline/library.rs index 8792742c9b..c2620af063 100644 --- a/crates/victory-gpu/src/pipeline/library.rs +++ b/crates/victory-gpu/src/pipeline/library.rs @@ -773,7 +773,7 @@ fn load_sharded( let copies = shards(library); let at = shard_of(text, copies.len() + 1); let done = SHARD_LOADS[at].fetch_add(1, Ordering::Relaxed) + 1; - if done % 500 == 0 { + if done.is_multiple_of(500) { let per: Vec = (0..=copies.len()).map(|i| SHARD_LOADS[i].load(Ordering::Relaxed)).collect(); tracing::info!(?per, missed = SHARD_MISSES.load(Ordering::Relaxed), "host pipeline library shard loads"); } diff --git a/crates/victory-gpu/src/pipeline/make.rs b/crates/victory-gpu/src/pipeline/make.rs index ef3117d9ce..83eb780ed2 100644 --- a/crates/victory-gpu/src/pipeline/make.rs +++ b/crates/victory-gpu/src/pipeline/make.rs @@ -1313,6 +1313,8 @@ impl Queue { Some(prev == NOT_QUEUED) } + // (unused since the 11.29.01 merge) + #[allow(dead_code)] fn pop(&mut self, screens_only: bool, slow_limit: usize) -> Option> { self.pop_in(screens_only, false, slow_limit) } diff --git a/crates/victory-gpu/src/resource.rs b/crates/victory-gpu/src/resource.rs index 3424581e1a..955546bcde 100644 --- a/crates/victory-gpu/src/resource.rs +++ b/crates/victory-gpu/src/resource.rs @@ -2372,7 +2372,7 @@ pub(crate) fn targets_room_kept(memory: Option<[u64; 4]>) -> u64 { .and_then(|v| v.trim().parse::().ok()) .map(|mb| mb.min(8192) << 20) }); - let most = requested.unwrap_or_else(|| match memory { + let most = requested.unwrap_or(match memory { Some([budget, ..]) if budget <= (8u64 << 30) => 2560 << 20, _ => 3072 << 20, }); diff --git a/crates/victory-gpu/src/shader_cache.rs b/crates/victory-gpu/src/shader_cache.rs index d27a92cf83..9acbcad6ef 100644 --- a/crates/victory-gpu/src/shader_cache.rs +++ b/crates/victory-gpu/src/shader_cache.rs @@ -11,7 +11,7 @@ use std::path::PathBuf; use std::sync::{Condvar, Mutex, OnceLock}; -use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; +use std::sync::atomic::{AtomicU64, Ordering}; use victory_pipeline::{Cache, CacheKey, Converter}; use victory_shader::emit::{HostShader, StaticSampler, UserData}; diff --git a/crates/victory-gpu/src/shadow.rs b/crates/victory-gpu/src/shadow.rs index 0c572f4ee7..ce21ec806c 100644 --- a/crates/victory-gpu/src/shadow.rs +++ b/crates/victory-gpu/src/shadow.rs @@ -2804,6 +2804,8 @@ pub(crate) fn wide_each(n: usize, work: impl Fn(usize) + Send + Sync + 'static) /// nothing and 9,086 of them told so on the threads (session 2026-11-28 /// 00:45): each took its number from one counter all the threads share, and /// a flush of a few small ones woke as many threads as it had pieces. +// (unused since the 11.29.01 merge; its tests still run) +#[allow(dead_code)] pub(crate) fn wide_chunk() -> usize { static CHUNK: std::sync::OnceLock = std::sync::OnceLock::new(); *CHUNK.get_or_init(|| { @@ -6291,6 +6293,8 @@ impl Shadow { /// Lock-free [`Shadow::nothing_new`] using a pre-snapshotted `ahead` list /// from [`crate::watch::ahead_snapshot_into`]. Acquires zero locks on the /// common (no pending shader writes) path. + // (unused since the 11.29.01 merge) + #[allow(dead_code)] pub(crate) fn nothing_new_with(&self, ahead: &[(usize, usize)], address: usize, len: usize) -> bool { if self.place.is_some() { return true; diff --git a/crates/victory-gpu/src/streamline.rs b/crates/victory-gpu/src/streamline.rs index d24e040fcf..3e2ef952fe 100644 --- a/crates/victory-gpu/src/streamline.rs +++ b/crates/victory-gpu/src/streamline.rs @@ -3686,10 +3686,12 @@ mod framegen_tests { // Multi-frame generation (up to 6X) presents up to 5 synthesized frames per engine // frame. In DXGI flip-discard mode, at least 8 swap chain buffers are required so that // the GPU and compositor never run out of back buffers while presenting. - assert!( - crate::host::BUFFERS >= 8, - "swap chain buffer count must be at least 8 to prevent DXGI flip-discard starvation" - ); + const { + assert!( + crate::host::BUFFERS >= 8, + "swap chain buffer count must be at least 8 to prevent DXGI flip-discard starvation" + ) + }; } #[test] diff --git a/crates/victory-gpu/src/watch.rs b/crates/victory-gpu/src/watch.rs index 8153158420..105be39c1d 100644 --- a/crates/victory-gpu/src/watch.rs +++ b/crates/victory-gpu/src/watch.rs @@ -1242,6 +1242,8 @@ pub(crate) fn writes(start: usize, end: usize, guarded: bool) -> Option<(u64, Ve /// whole, or 0) does not hold, using a pre-snapshotted `ahead` list and /// [`WRITTEN_EPOCHS`]. Acquires zero locks; `false` if something would have to /// be asked. +// (unused since the 11.29.01 merge) +#[allow(dead_code)] pub(crate) fn nothing_new_with( ahead: &[(usize, usize)], start: usize, diff --git a/crates/victory-hle/src/modules/gameinput.rs b/crates/victory-hle/src/modules/gameinput.rs index edacc1e7c5..59715e7dd4 100644 --- a/crates/victory-hle/src/modules/gameinput.rs +++ b/crates/victory-hle/src/modules/gameinput.rs @@ -827,7 +827,7 @@ impl State { .fold(merged(merged(base_fallback, look), overlay.pad), merged); let pad = apply_trigger_overrides(pad, overlay.lt_override, overlay.rt_override); self.update(devices, FALLBACK, Some(Value::Pad(pad)), now, &mut events); - self.update(devices, KEYBOARD, (!pads_only).then(|| Value::Keys(keys)), now, &mut events); + self.update(devices, KEYBOARD, (!pads_only).then_some(Value::Keys(keys)), now, &mut events); return events; } // Counted over the pads actually shown below: an all-zero pad is no @@ -873,7 +873,7 @@ impl State { )) }); self.update(devices, FALLBACK, fallback, now, &mut events); - self.update(devices, KEYBOARD, (!pads_only).then(|| Value::Keys(keys)), now, &mut events); + self.update(devices, KEYBOARD, (!pads_only).then_some(Value::Keys(keys)), now, &mut events); events } diff --git a/crates/victory-hle/src/modules/lifecycle.rs b/crates/victory-hle/src/modules/lifecycle.rs index f3c0bfe51d..be1bb56553 100644 --- a/crates/victory-hle/src/modules/lifecycle.rs +++ b/crates/victory-hle/src/modules/lifecycle.rs @@ -1000,6 +1000,13 @@ pub(crate) fn module() -> HleModule { } } +/// Whether `message` is a key, character, raw-input or mouse message (`WM_INPUT`, `WM_KEYFIRST` +/// to `WM_KEYLAST`, `WM_MOUSEFIRST` to `WM_MOUSELAST`). +#[cfg(windows)] +fn keys_or_mouse(message: u32) -> bool { + message == 0x00FF || (0x0100..=0x0109).contains(&message) || (0x0200..=0x020E).contains(&message) +} + #[cfg(test)] mod tests { use super::*; @@ -1287,9 +1294,3 @@ mod tests { } } -/// Whether `message` is a key, character, raw-input or mouse message (`WM_INPUT`, `WM_KEYFIRST` -/// to `WM_KEYLAST`, `WM_MOUSEFIRST` to `WM_MOUSELAST`). -#[cfg(windows)] -fn keys_or_mouse(message: u32) -> bool { - message == 0x00FF || (0x0100..=0x0109).contains(&message) || (0x0200..=0x020E).contains(&message) -}