GPU: load pipeline library entries without the global mutex #1680
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!1680
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1680/head"
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?
@Calvix2k on GitHub · 2026-11-24 20:42 UTC · original
Calvix2k:codex/gpu-pipeline-library-locks-1615→main· +27 −5 · 1 files · 1 commits · closed without mergingSummary
Loads from the host pipeline library ran under the one mutex that holds the library, so pipeline workers serialised behind loads that take seconds.
CreatePipelineLibraryonly requires that loads of the same pipeline name do not overlap.Reworked on upstream
70564ae(which added the pre-built list):ID3D12PipelineLibrary1beside the bookkeeping, so a load does not take the library mutex.prebuiltstate, which is read and written under the same mutex as before.Based on the original #1680 design by @Vaximous, reduced to the load path for the new library structure.
Validation
cargo test -p victory-gpu --locked pipeline::library— 4 passed.victory-gpusuite: 77 passed, 1 failed, 1 ignored. The failure isdraw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view, which fails identically on plainorigin/mainon this machine (unrelated).--all-targets --all-features -D warningsandcargo xtask policy(174 files) passed.@Calvix2k on GitHub · 2026-11-24 22:17 UTC · original
Marking draft: upstream
70564aerebuilt the library around the pre-built pipeline list (prebuilt, prebuilt_changed, save tagging), which overlaps every hunk of the lock/save split here. It needs a rework against the new state rather than a mechanical conflict resolution. The concurrency issue itself is still real (upstream still has oneMutex<Library>), so I will redo it on the new base.@Calvix2k on GitHub · 2026-11-25 00:46 UTC · original
Superseded by main: origin/main (
4118f33) now holds a pipeline's name with NAMES.hold(name) around load/store and keeps the library in OnceLock<Option<Mutex>>, so loads of different names run in parallel while loads/stores of one name are serialised, and saves take the library mutex. That is the same outcome this PR's 64-stripe lock and STORES RwLock produced, with the new pre-build support on top. Closing this in favour of the code already on main; nothing from the PR is lost.Pull request closed