Pipeline library: cut writes leave unique staging files that are never removed (follow-up to #1660) #2496
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#2496
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Makto94 on GitHub · 2026-11-25 14:50 UTC · original
Since #1660,
write_atomically()stages each write in<file>.tmp-<pid>-<n>. Before, the fixedhost-pipelines.tmpwas overwritten by the next save.A write can still be cut:
save(true)returns early whenadded == 0 && !USED_CHANGEDwithout waiting for a worker's save that is writing.end()then callsTerminateProcess, and nothing stops thevictory-pipelines-Nworkers.WRITINGis per file, so even a waitingsave(true)can let the worker's second write (early-pipelines.txt) start and be cut.host_gpu_failedand crash exits callTerminateProcessdirectly.Each cut write now leaves a staging file that no later run reuses, and nothing sweeps the cache folder. The target file stays whole.
A port of #1660 elsewhere fixed this in two small commits: one lock held across the whole of
save(), taken before the early return; and a sweep of stalehost-pipelines.bin.tmp-<digits>-<digits>/early-pipelines.txt.tmp-<digits>-<digits>regular files inuse_pipeline_cache(), immediately for the own pid and after 10 minutes for other pids, because the cache folder is shared and there is no single-instance guard. Reference: https://github.com/LaunchDoesntCode/VI-Port/pull/174@oni-swr on GitHub · 2026-11-25 15:03 UTC · original
Claimed the stale staging-file sweep half on #1633 (
use_pipeline_cache()sweepinghost-pipelines.bin.tmp-<digits>-<digits>andearly-pipelines.txt.tmp-<digits>-<digits>regular files, own pid immediately and other pids after 10 minutes), leaving thesave()lock half to open PR #2328 to avoid overlap.AI-assisted (Claude Code / Claude Sonnet 5.5).
@Marvisak on GitHub · 2026-11-25 18:50 UTC · original
Automated triage for the maintainers.
Confirmed in main, in
crates/victory-gpu/src/pipeline/library.rs.write_atomicallystages each write in<file>.tmp-<pid>-<n>and removes it only when the write or rename returns an error.use_pipeline_cacheonly records the folder and sweeps nothing. So any write cut byTerminateProcessleaves a staging file that stays there for good.save()returns early when nothing was added, without waiting for a save already running. One correction:WRITINGis a single static lock shared by all files, not one per file. It is held for eachwrite_atomicallycall, not across the wholesave(), so the effect described here still holds.Open PR #2328 makes saves run one at a time. The sweep of stale staging files has been claimed on #1633. No PR for it is linked in this thread yet.
Generated by Claude Code