Deduplicate LIVE pipeline tracking and honor VICTORY_LIBRARY_DIR + writer lock in compact() #2577
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2577
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2577"
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?
@steven-seagull27 on GitHub · 2026-11-29 14:32 UTC · original
steven-seagull27:fix/library-live-dedup-and-compact-dir→main· +259 −18 · 1 files · 1 commits · merged 2026-11-30 14:12 UTCSummary
Fixes two bugs in
crates/victory-gpu/src/pipeline/library.rs:Deduplicate
LIVEpipeline tracking by name (note_live):LIVEwas aVec<(HSTRING, Later)>andnote_live()pushed a clonedHSTRINGandID3D12PipelineStateCOM reference on every load/create call without deduplication. Repeated loads of the same pipeline name pinned duplicate COM references until exit and inflatedlive.len()incompact()'s threshold check.LIVE's backing store withLivePipelines<T>(aBTreeMap<HSTRING, T>plus a duplicate counter) so each unique pipeline name is stored at most once, duplicate calls neither clone theHSTRINGnor pin extra COM references, andcompact()evaluatescompacts()against the true unique-pipeline count while preserving duplicate counts in the rebuild log.Honor
VICTORY_LIBRARY_DIRand acquirewriter()lock incompact():compact()wrote directly toDIRinstead of resolvingVICTORY_LIBRARY_DIR(unlikesave()), and did not acquire the directory'swriter()lock (host-pipelines.lock). WhenVICTORY_LIBRARY_DIRwas configured, compaction wrote to the wrong directory, left the shared library untouched, and still setCOMPACTED = true, causingsave(true)to skip saving newly compiled pipelines. Without thewriter()lock, concurrent processes sharing a library directory could race onhost-pipelines.tmpandreplace_library().resolve_library_dir()/target_library_dir()helpers used by bothsave()andcompact(), and extractedcompact_to_dir()which creates the target directory, acquireswriter(&shared, Duration::from_secs(30))(matchingsave(true)), keeps the lock held across serialization andreplace_library(), cleans uphost-pipelines.tmpon error, and setsCOMPACTED = trueonly when the locked replacement succeeds. When the lock is contended,compact()logs a warning and returns cleanly without touching disk or markingCOMPACTED.Tests
Added synthetic unit tests in
crates/victory-gpu/src/pipeline/library.rs:live_pipelines_deduplicates_by_name_without_pinning_duplicatescompact_target_dir_honors_override_and_writes_shared_directorycompact_skips_cleanly_when_writer_lock_is_heldcompact_cleans_up_temp_and_keeps_uncompacted_on_write_errorVerification
cargo test --locked -j 2 -p victory-gpu --lib -- pipeline::library --nocapture --test-threads=1— 17 passed, 0 failedcargo test --locked -j 2 -p victory-gpu --lib -- pipeline:: --test-threads=1— 74 passed, 0 failed, 2 ignoredcargo clippy --locked -j 2 -p victory-gpu --lib --tests— 0 new warnings incrates/victory-gpu/src/pipeline/library.rsgit diff --check— clean