chore(gpu): drop the one_call guard that is always None #420

Manually merged
github merged 1 commit from github-bot/gh-420 into main 2026-12-04 03:42:20 +00:00 AGit
Owner

@⁠Luxuride on GitHub · 2026-12-04 01:46 UTC · original
Luxuride:chore/gpu-drop-one-call → main · +2 −10 · 1 files · 1 commits · merged 2026-12-04 03:41 UTC

What

crates/victory-gpu/src/pipeline/library.rs:443-446:

fn one_call() -> Option<MutexGuard<'static, ()>> {
    static CALLING: Mutex<()> = Mutex::new(());
    (&false).then(|| CALLING.lock().unwrap_or_else(|e| e.into_inner()))
}

(&false).then(..) is false.then(..), i.e. always None, so CALLING is never locked and the three call sites (:620, :702, :759) bind a permanently-None guard. The module doc at pipeline/library.rs:16-23 records why the global lock was removed ("the eight workers made pipelines one at a time: 87 to 96 of 110 looks at each worker found it waiting for that lock"), so the switch was turned off on purpose and the vestige was left behind.

This deletes the dead one_call function, its static, the three let _all = one_call(); lines and the now-unused MutexGuard import (the other two sites spell it std::sync::MutexGuard). Behaviour is unchanged: the guard was always None.

Validation

cargo clippy -p victory-gpu --target x86_64-pc-windows-msvc --lib -- -D clippy::needless_borrow

main reports 2 errors; this branch reports only the indirect.rs:720 one (fixed separately in another PR). No other warning appears or disappears at pipeline/library.rs. The crate still type-checks with 25 warnings, none new.

Overlap check

crates/victory-gpu/src/pipeline/library.rs appears in no open PR's file list, and no issue mentions one_call.

**@⁠Luxuride** on GitHub · 2026-12-04 01:46 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/420) `Luxuride:chore/gpu-drop-one-call` → `main` · +2 −10 · 1 files · 1 commits · merged 2026-12-04 03:41 UTC ## What `crates/victory-gpu/src/pipeline/library.rs:443-446`: ```rust fn one_call() -> Option<MutexGuard<'static, ()>> { static CALLING: Mutex<()> = Mutex::new(()); (&false).then(|| CALLING.lock().unwrap_or_else(|e| e.into_inner())) } ``` `(&false).then(..)` is `false.then(..)`, i.e. always `None`, so `CALLING` is never locked and the three call sites (`:620`, `:702`, `:759`) bind a permanently-`None` guard. The module doc at `pipeline/library.rs:16-23` records why the global lock was removed ("the eight workers made pipelines one at a time: 87 to 96 of 110 looks at each worker found it waiting for that lock"), so the switch was turned off on purpose and the vestige was left behind. This deletes the dead `one_call` function, its `static`, the three `let _all = one_call();` lines and the now-unused `MutexGuard` import (the other two sites spell it `std::sync::MutexGuard`). Behaviour is unchanged: the guard was always `None`. ## Validation ``` cargo clippy -p victory-gpu --target x86_64-pc-windows-msvc --lib -- -D clippy::needless_borrow ``` `main` reports 2 errors; this branch reports only the `indirect.rs:720` one (fixed separately in another PR). No other warning appears or disappears at `pipeline/library.rs`. The crate still type-checks with 25 warnings, none new. ## Overlap check `crates/victory-gpu/src/pipeline/library.rs` appears in no open PR's file list, and no issue mentions `one_call`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 01:49:35 +00:00
github manually merged commit f5f424de71 into main 2026-12-04 03:42:20 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.