Skip to content

GPU: the pipeline cache folder's stale staging files are swept at start - #2514

Closed
oni-swr wants to merge 1 commit into
Marvisak:mainfrom
oni-swr:t3/victory-2496-sweep-tmp
Closed

oni-swr wants to merge 1 commit into
Marvisak:mainfrom
oni-swr:t3/victory-2496-sweep-tmp

Conversation

@oni-swr

@oni-swr oni-swr commented Nov 25, 2026

Copy link
Copy Markdown

Part of #2496 (the stale staging-file sweep half only). The save() lock half is covered by #2328; this diff does not touch save(), so it stays disjoint from #2328, #2326 and #2327.

use_pipeline_cache() now removes the staging files a cut write_atomically() left behind:

  • Matches only regular files named exactly host-pipelines.bin.tmp-<digits>-<digits> or early-pipelines.txt.tmp-<digits>-<digits> (ASCII digits, non-empty). Checked with symlink_metadata(), so symlinks and directories are never followed or removed.
  • Own pid: removed at once. Other pids: removed only when the file is at least 10 minutes old, since the folder is shared. If the age is unknown (metadata error, or an mtime in the future) the file stays.
  • A missing folder or a failed delete is ignored and never fails use_pipeline_cache().

Tests (CPU only, VICTORY_D3D12_WARP=1):

  • Strict name parsing, including malformed .tmp-foo-1, empty parts, +, extra parts and non-ASCII digits.
  • The sweep removes the own pid's files and stale files of other pids, and keeps fresh ones, the real cache files, malformed names, a directory with a matching name (and its contents), and a future-dated file.
  • A missing folder is ignored. A symlink test runs on unix.

Checked: cargo test -p victory-gpu --locked --lib pipeline::library, cargo clippy -p victory-gpu --all-targets --locked and cargo xtask policy all pass. No game files, dumps, shader names or retail hashes were used.

AI-assisted: Claude Code (Claude Sonnet 5.5).

🤖 Generated with Claude Code

A cut write leaves `<file>.tmp-<pid>-<n>` behind. use_pipeline_cache now
removes the regular files of that form for host-pipelines.bin and
early-pipelines.txt: the own pid's at once, other pids' once 10 minutes old
(the folder is shared). Anything else, or a file of unknown age, stays.

Part of Marvisak#2496.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copy link
Copy Markdown
Owner

Automated triage for the maintainers. Proposed close as a duplicate of the earlier open #2510. #2510 adds the same sweep to use_pipeline_cache() in crates/victory-gpu/src/pipeline/library.rs, with the same name parsing and the same 10-minute rule for other processes' files, and it also adds the save() lock from #2496. This PR's staging_pid only matches host-pipelines.bin and early-pipelines.txt. On main, save() also writes prebuilt-pipelines.txt (PREBUILT_FILE) through write_atomically, so cut writes of that file would never be swept. #2510 covers that file too. CI (check) passes. This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label.


Generated by Claude Code

@oni-swr

oni-swr commented Nov 25, 2026

Copy link
Copy Markdown
Author

Closing in favor of earlier #2510, which covers the same staging-file sweep (including prebuilt-pipelines.txt) and has been scoped to the sweep.

@oni-swr oni-swr closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants