GPU: retry pipeline cache saves after write failures #72

Open
github-bot wants to merge 1 commit from github-bot/gh-72 into main AGit
Owner

@⁠FIocker on GitHub · 2026-11-24 00:13 UTC · original
FIocker:gpu/retry-pipeline-cache-save → main · +91 −27 · 1 files · 1 commits · open

Keep new pipeline entries eligible for persistence until both the library blob and the early-start list have been written. A temporary write or replacement failure now retries at the next save. Serialize save attempts and use a unique temporary file for each publication.

The new filesystem tests cover concurrent complete writes and temporary-file cleanup when replacement fails. They use synthetic bytes and do not create a GPU device.

Validation on x64 Windows: cargo check -p victory-gpu, cargo clippy -p victory-gpu --tests -- -D warnings, cargo test -p victory-gpu atomic_writes, cargo test -p victory-pipeline, and the asset policy check passed.

**@⁠FIocker** on GitHub · 2026-11-24 00:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/72) `FIocker:gpu/retry-pipeline-cache-save` → `main` · +91 −27 · 1 files · 1 commits · open Keep new pipeline entries eligible for persistence until both the library blob and the early-start list have been written. A temporary write or replacement failure now retries at the next save. Serialize save attempts and use a unique temporary file for each publication. The new filesystem tests cover concurrent complete writes and temporary-file cleanup when replacement fails. They use synthetic bytes and do not create a GPU device. Validation on x64 Windows: `cargo check -p victory-gpu`, `cargo clippy -p victory-gpu --tests -- -D warnings`, `cargo test -p victory-gpu atomic_writes`, `cargo test -p victory-pipeline`, and the asset policy check passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:49:12 +00:00
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 00:56 UTC · original

Tested 521cecc under Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build with cargo xwin ... --target x86_64-pc-windows-msvc:

  • victory_gpu: 37 passed, 4 failed. Three are the usual environment-only ones; the fourth is this PR's new test pipeline::library::tests::concurrent_atomic_writes_publish_one_complete_file:
    thread '<unnamed>' panicked at crates/victory-gpu/src/pipeline/library.rs:288:65:
    called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access denied." }
    
    i.e. concurrent MoveFileEx-style replace on the same destination returns ACCESS_DENIED under Wine. The other new test (failed_atomic_writes_remove_their_temporary_file) passes.
  • This is likely Wine's rename/sharing emulation rather than your code, but since the PR is about retrying failed cache saves, it is worth confirming on Windows that eight writers publishing the same file do not hit ACCESS_DENIED there — if they can, the retry should treat it as retryable, which this test asserts by .unwrap()-ing the write instead of letting the production path retry.

No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).

**@⁠DaviTostes** on GitHub · 2026-11-24 00:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/72#issuecomment-7118587036) Tested `521cecc` under **Wine 11.22 + vkd3d-proton 3.1** on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build with `cargo xwin ... --target x86_64-pc-windows-msvc`: - `victory_gpu`: **37 passed, 4 failed**. Three are the usual environment-only ones; the fourth is this PR's new test `pipeline::library::tests::concurrent_atomic_writes_publish_one_complete_file`: ``` thread '<unnamed>' panicked at crates/victory-gpu/src/pipeline/library.rs:288:65: called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access denied." } ``` i.e. concurrent `MoveFileEx`-style replace on the same destination returns `ACCESS_DENIED` under Wine. The other new test (`failed_atomic_writes_remove_their_temporary_file`) passes. - This is likely Wine's rename/sharing emulation rather than your code, but since the PR is about retrying failed cache saves, it is worth confirming on Windows that eight writers publishing the same file do not hit `ACCESS_DENIED` there — if they can, the retry should treat it as retryable, which this test asserts by `.unwrap()`-ing the write instead of letting the production path retry. No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
Author
Owner

@⁠Exorion1er on GitHub · 2026-11-24 09:33 UTC · original

#640 changes the same function in pipeline/library.rs for the same failure: it keeps the lock across both writes and re-marks after a failed save. This PR does that and also:

  • gives each temp file a unique name (pid plus counter) and removes it when the write or rename fails
  • uses saturating_sub where #640 does added -= added
  • has two tests (concurrent writes, temp-file cleanup), where #640 has none

Both merge cleanly but edit the same lines, so only one can land. This one looks like the fuller fix.

Checked by reading both diffs. AI-assisted (Claude Code).

**@⁠Exorion1er** on GitHub · 2026-11-24 09:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/72#issuecomment-7127576400) #640 changes the same function in `pipeline/library.rs` for the same failure: it keeps the lock across both writes and re-marks after a failed save. This PR does that and also: - gives each temp file a unique name (pid plus counter) and removes it when the write or rename fails - uses `saturating_sub` where #640 does `added -= added` - has two tests (concurrent writes, temp-file cleanup), where #640 has none Both merge cleanly but edit the same lines, so only one can land. This one looks like the fuller fix. Checked by reading both diffs. AI-assisted (Claude Code).
Author
Owner

@⁠acetonahard-code on GitHub · 2026-11-24 21:13 UTC · original

As already noted in the comments here, this overlaps #640. They conflict in library.rs.

Tested on Windows 11, RTX 4070 SUPER (driver 621.14), with the repo toolchain, merged into current main (ffe310e):

cargo test -p victory-gpu passed failed ignored
main 50 0 1
main + this PR 52 0 1
main, --all-features 53 0 -
main + this PR, --all-features 55 0 -
  • The 2 new tests pass.
  • No GPU test skipped for lack of a device.
  • cargo clippy --all-targets -- -D warnings, with and without --all-features: clean.
  • Minor: cargo fmt --check would rewrap 2 blocks this PR adds (library.rs). main isn't rustfmt-clean either, so take it or leave it.

I didn't test with game data.


Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.

**@⁠acetonahard-code** on GitHub · 2026-11-24 21:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/72#issuecomment-7144636704) As already noted in the comments here, this overlaps #640. They conflict in `library.rs`. Tested on Windows 11, RTX 4070 SUPER (driver 621.14), with the repo toolchain, merged into current `main` (ffe310e): | `cargo test -p victory-gpu` | passed | failed | ignored | |---|---|---|---| | `main` | 50 | 0 | 1 | | `main` + this PR | 52 | 0 | 1 | | `main`, `--all-features` | 53 | 0 | - | | `main` + this PR, `--all-features` | 55 | 0 | - | - The 2 new tests pass. - No GPU test skipped for lack of a device. - `cargo clippy --all-targets -- -D warnings`, with and without `--all-features`: clean. - Minor: `cargo fmt --check` would rewrap 2 blocks this PR adds (`library.rs`). `main` isn't rustfmt-clean either, so take it or leave it. I didn't test with game data. --- <sub>Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.</sub>
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:15 UTC · original

Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-gpu/src/pipeline/library.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/72#issuecomment-7148312463) <!-- victory-triage v1 head=521ceccd781e95d36a74ad196920104bf424ed00 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-gpu/src/pipeline/library.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/pipeline/library.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/72/head:github-bot/gh-72'
git switch 'github-bot/gh-72'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-72'
git switch 'github-bot/gh-72'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-72'
git switch 'github-bot/gh-72'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-72'
git switch 'main'
git merge --squash 'github-bot/gh-72'
git switch 'main'
git merge --ff-only 'github-bot/gh-72'
git switch 'main'
git merge 'github-bot/gh-72'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!72
No description provided.