GPU: use RwLock for read-mostly tables and add per-HostList VA/view caches #1356
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1356
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1356"
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?
@wbkepler on GitHub · 2026-11-24 17:35 UTC · original
wbkepler:gpu/concurrent-read-locks-and-va-cache→main· +708 −75 · 8 files · 1 commits · openSummary
Reduces multi-thread CPU recording contention and repeated lookup overhead in
victory-gpu:Mutextables queried on per-draw/dispatch/bind hot paths tostd::sync::RwLockwith shared.read()hit paths (shadow::{BUFFERS, LOOSE},descriptor::{SHADER_HEAPS, VIEWS},HostHeap::made,texture::{STAGING, HOST_WRITTEN},resource::PLACED_TEXTURES,draw::host_signature::MADE,pipeline::SHADERS), using.iter().rev().findindescriptor::shader_slot.HostListinlineShadowCache(with nested-buffer-safeCachedRange::Subrange/Exactinterval bounds) andViewCache, cleared onHostList::reset()and invalidated viaAcquire/ReleaseAtomicU64generation counters bumped under write locks inshadow::{register, unregister}anddescriptor::forget.draw.rsper-draw VB/IB/root-view/indirect/table/readable lookups throughHostList::{find_shadow, lookup_view}andHostHeap::mirror_cached.Verification
cargo clippy --workspace --all-targets&-p victory --features diagnostics --all-targets— passed (0 new warnings)cargo test --workspace— passedVICTORY_D3D12_WARP=1 cargo test -p victory-gpu --lib --features diagnostics host::tests— passed (6/6)cargo xtask policy— passed (151 files ok)@Marvisak on GitHub · 2026-11-25 01:23 UTC · original
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-gpu/src/descriptor.rs,crates/victory-gpu/src/descriptor/host.rs,crates/victory-gpu/src/draw.rs,crates/victory-gpu/src/host.rs,crates/victory-gpu/src/resource.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
@KainanP on GitHub · 2026-11-26 16:26 UTC · original
A data point for the buffer-lookup cache in this PR: on main + #1978 + #2821 + #3258 + #3274 + #3275, a rough thread-local stand-in for it in front of
shadow::find(validated by a generation counter, but with no nested-buffer check) took the list bench's draw sequence from 2,485 to 1,894 ns per draw on 5 threads (−24%) and from 1,351 to 1,242 ns on 1 thread (RTX 4060 Laptop, median of 7). Details are in #2586 (7197644545). YourCachedRangeversion is the correct form of it. Rebased on its own (BUFFERSis aMutexon main, and #2821/#2096 change it), it would likely be the next clear gain for the recording threads.AI use: Claude Code (Claude Opus 5.5) ran the measurement and drafted this comment.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.