Remove per-command mutex from command list state #145
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!145
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-145"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Adika713 on GitHub · 2026-11-25 16:56 UTC · original
Adika713:perf/list-state-no-lock→main· +64 −13 · 1 files · 1 commits · openTARGET: pull request from
Adika713:perf/list-state-no-locktoBelobug/VIctory-Belobug-AMD:main.Improve CPU time of recorded draw-state calls.
List.statewas aMutex<draw::State>. Every recorded command — setters, draws,dispatches, target changes — locked and unlocked it. The file already documents
that the title uses a list on one thread at a time and uses
UnsafeCellforhostandpartson that basis. This applies the same treatment tostateandadds an ignored CPU-only benchmark.
What is in it
List.stateis nowUnsafeCell<draw::State>;with_state,cut,hoist,closeandresetborrow it directly.list::tests::benchmark_state_lockthat times 200,000 recordedstencil_refcalls and prints the median of five samples.Tested
AMD Radeon RX 6950 XT (RDNA2), Ryzen 5 3600, 32 GB RAM, Windows 11,
rustc/cargo 1.98.1. No game data; the game was not run. Each tree used an
isolated
CARGO_TARGET_DIR.Benchmark:
cargo test --release -p victory-gpu --lib benchmark_state_lock -- --ignored --nocapture --test-threads=101aadd1: medians 10.8, 11.1, 10.9 ns/call (3 runs).Correctness:
cargo check -p victory-gpu --lib --tests --locked: exit 0.cargo test -p victory-gpu --lib list:: -- --test-threads=1: 5 passed, 0 failed, 1 ignored, 110 filtered.cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 1 passed, 0 failed, 115 filtered.--skip watch::tests::written_pages_are_reported_to_every_asker: 0 failed; every run 110 passed, 0 failed, 5 ignored.cargo test --workspace --no-fail-fast --locked: no new failures; the known xmem, shader and policy failures remain.victory-gpu111 passed, 0 failed, 5 ignored.Not tested
about frame rate.
watch::tests::written_pages_are_reported_to_every_askerfailure was skippedin the repeated runs; it also occurs at main.
List.stateand keeps aMutex; its hunk wouldneed updating if both changes land.
AI use
AI-assisted: OpenCode, model Big Pickle. No game data.
@KernelSmoker on GitHub · 2026-11-25 19:56 UTC · original
Independent verification & A/B benchmark on Intel Core i9-11900K + NVIDIA GeForce RTX 3090 (Bazzite Linux 45 x86_64, driver 620.73.04, GE-Proton 10-34 / Wine 10.0 / vkd3d-proton 3.0.0, Rust 1.98.1) on PR head
1bc9a7f:list::tests::benchmark_state_lock, 3 runs each, 200,000stencil_refcalls/sample):01aadd1(Mutex<draw::State>): medians 10.3 / 10.2 / 10.1 ns/call1bc9a7f,UnsafeCell<draw::State>): medians 1.4 / 1.6 / 1.4 ns/call (~6.8× faster on this CPU/Wine runtime)--test-threads=1):list::: 5 passed, 0 failed, 1 ignoreddraw::: 1 passed, 0 failedx86_64-pc-windows-gnu): 0 new warnings in the changed lines ofcrates/victory-gpu/src/list.rs.with_state,cut,hoist,close, andresetinlist.rs— none of thewith_stateclosures capturethisto re-enterwith_state/cut/hoist, andcut/hoist/resetborrow disjointUnsafeCellfields (host,parts,state).(In-game FPS was not measured here; this verifies the CPU benchmark, unit tests, clippy, and aliasing audit on Intel + NVIDIA.)
@MamaLeVrai on GitHub · 2026-11-26 05:11 UTC · original
Concurrency check on Windows/RDNA2 (RX 6950 XT, Windows 11 build 26300, Rust 1.98.1). I merged this PR (
1bc9a7f) ontomain4f62c2aplus #210, which fixeslist::tests::lists_are_cut_at_waits_that_follow_work, a test that fails in every release run onmain. Then I ran the releasevictory-gpulib test binary 10 times, with the default thread count:watch::tests::written_pages_are_reported_to_every_asker(#102), and 1 run died without a result line.No new failure, deadlock or hang showed up in these runs. Ten runs are a small sample for races. Not run in the game.
harness machine: rx6950xt-w11 | AMD Radeon RX 6950 XT (RDNA2), driver 32.0.21045.29003 | 32 GB RAM | Windows 11 build 26300
AI-assisted (Claude Code); no game data.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.