Skip to content

pipeline: remove staging files when cache publication fails - #161

Merged
Marvisak merged 1 commit into
Marvisak:mainfrom
lordon1a:fix/pipeline-staging-cleanup
Nov 24, 2026
Merged

Marvisak merged 1 commit into
Marvisak:mainfrom
lordon1a:fix/pipeline-staging-cleanup

Conversation

@lordon1a

Copy link
Copy Markdown
Contributor

Summary

When Cache::get_or_convert() (crates/victory-pipeline/src/cache.rs) fails to write or rename its staging file into the final cache path, the orphaned temporary file was left behind in the cache directory.

This change:

  1. Opens the staging path with OpenOptions::new().write(true).create_new(true) instead of std::fs::write, drops the file handle before rename (required on Windows), and removes the staging file if writing or publishing fails.
  2. Adds a synthetic unit test (failed_publication_removes_the_staging_file) that creates a directory at the target cache path to force rename failure and verifies no staging file remains.

Verification

Tested on Windows 11 (rustc 1.100.0, x86_64-pc-windows-gnullvm):

  • cargo test -p victory-pipeline: 4 passed, 0 failed (the new test fails on main@9aef3d9 where the staging file is left behind).
  • cargo clippy -p victory-pipeline --all-targets: 0 warnings.
  • cargo xtask policy: 151 files ok (zero game data).

AI-assisted.

Reserve a new staging path and clean it up if writing or publishing fails. Cover a failed publication with a synthetic destination directory.
Copilot AI balanced review requested due to automatic review settings November 24, 2026 01:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@DaviTostes

Copy link
Copy Markdown

The test target does not compile, so the GPU suite cannot run:

error[E0428]: the name `tests` is defined multiple times
    --> crates/victory-gpu/src/host.rs:1974:1
 252 | mod tests { ... }
1974 | mod tests { ... }

The library builds; only cargo test fails, on every platform. The new test module needs to go into the existing mod tests in host.rs after a rebase (the same failure as #134/#135/#175).

No game data used.

edsuuu referenced this pull request in edsuuu/VI-BR-PORT Nov 24, 2026
…fails

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ghost ghost mentioned this pull request Nov 24, 2026
@Marvisak
Marvisak merged commit 787f665 into Marvisak:main Nov 24, 2026
suirentakamura referenced this pull request in suirentakamura/victory-suiren Nov 24, 2026
pipeline: remove staging files when cache publication fails
itsonlysimbo pushed a commit to itsonlysimbo/VIctory that referenced this pull request Nov 24, 2026
…eanup

pipeline: remove staging files when cache publication fails
Ahmet-Dedeler added a commit to Ahmet-Dedeler/VIctory that referenced this pull request Nov 26, 2026
…Marvisak#161), BC7 rot (Marvisak#3111), SDWA sext (Marvisak#3124)

- victory-shader/emit/deltas.rs + translate_vertex_deltas: lower non-provoking
  per-vertex pixel reads as flat VICTORY_P10/VICTORY_P20 inputs fed by a
  pass-through geometry shader for vertex+pixel pipelines on D3DMetal
  (pragyaangaur/VIctory-macOS#300), leaving normal pixel translation and
  Codex's mesh primitive varyings untouched.
- victory-shader/emit: translate_linked_mesh + mesh_output_bytes prune unread
  arbitrary mesh outputs so >32 KiB character mesh shaders fit Metal's 32 KiB
  limit (Marvisak#2398, pragyaangaur/VIctory-macOS#161).
- victory-shader/emit/lower.rs: SDWA dst_unused=1 (sext) copies bit 15 upward
  for 16-bit results (upstream VIctory Marvisak#3124).
- victory-formats/bcpack.rs: apply BC7 channel rotation only in modes 4 and 5
  (upstream VIctory Marvisak#3111).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants