Keep the shader cache when its translator marker is unreadable #4908

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

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 13:24 UTC · original
andrewpozdnakov7-jpg:codex2/fix/preserve-cache-on-marker-read-error → main · +5 −1 · 1 files · 1 commits · open

What it changes

A transient read failure of translator.txt is currently treated as a missing marker. Startup then clears translated shaders and compiled host pipeline artifacts even though the marker may name the current translator.

The launcher now returns the read error and keeps the cache. Its existing error path reports the failure and continues the launch. A missing marker or one containing invalid UTF-8 still follows the cache refresh path.

How it was tested

  • One Windows Rust fixture ran the exact clear_stale_in with a real synthetic marker open through a write handle that denied reads. The artifact cleanup was stubbed to count calls.
  • Main 5fabb46e and release e1251c31 have identical code for this function. It called cleanup once and returned success. On 137aed47e7d05e57ef13bb13cc96f19dc06948cf, cleanup was skipped and the Windows sharing error was reported to the caller.
  • The same fixture checked matching, missing, different, and invalid UTF-8 markers. cargo xtask policy --staged accepted the source file.
  • Main's CI check has five existing Clippy errors tracked in #4708.

Checked for overlap

  • Searched open and closed PRs and issues for translator marker read failures. #4869 protects shader-book reads. #4889 handles selection of the named cache. This change combines cleanly with #4889 in git merge-tree.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 13:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4907) `andrewpozdnakov7-jpg:codex2/fix/preserve-cache-on-marker-read-error` → `main` · +5 −1 · 1 files · 1 commits · open ## What it changes A transient read failure of `translator.txt` is currently treated as a missing marker. Startup then clears translated shaders and compiled host pipeline artifacts even though the marker may name the current translator. The launcher now returns the read error and keeps the cache. Its existing error path reports the failure and continues the launch. A missing marker or one containing invalid UTF-8 still follows the cache refresh path. ## How it was tested - One Windows Rust fixture ran the exact `clear_stale_in` with a real synthetic marker open through a write handle that denied reads. The artifact cleanup was stubbed to count calls. - Main `5fabb46e` and release `e1251c31` have identical code for this function. It called cleanup once and returned success. On `137aed47e7d05e57ef13bb13cc96f19dc06948cf`, cleanup was skipped and the Windows sharing error was reported to the caller. - The same fixture checked matching, missing, different, and invalid UTF-8 markers. `cargo xtask policy --staged` accepted the source file. - Main's [CI check](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46563306780/job/142355972539) has five existing Clippy errors tracked in #4708. ## Checked for overlap - [x] Searched open and closed PRs and issues for translator marker read failures. #4869 protects shader-book reads. #4889 handles selection of the named cache. This change combines cleanly with #4889 in `git merge-tree`. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 13:26:56 +00:00
Author
Owner

@⁠tyr0nsur on GitHub · 2026-12-01 13:37 UTC · original

Verified end to end on Windows. I built the exact 5fabb46e and 137aed47 executables with cargo build --locked -p victory and ran each with victory.exe warm --limit 0 --jobs 1. A temporary victory.toml selected isolated cache and data paths. Each cache had a synthetic shader artifact, a host-pipeline artifact and an empty pipeline book.

With the current translator.txt held open for writing while denying reads, Windows returned sharing violation 32. Main deleted both artifacts. The PR kept both and printed the cache-read warning. Both invocations completed normally and left the book and marker in place.

I also checked matching, different, missing and invalid UTF-8 markers through the same command. Matching kept the artifacts. The other three refreshed them, set the current marker and retained the book on both builds. Ten CLI cases passed, with no title or real cache involved.

**@⁠tyr0nsur** on GitHub · 2026-12-01 13:37 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4907#issuecomment-7312919665) Verified end to end on Windows. I built the exact `5fabb46e` and `137aed47` executables with `cargo build --locked -p victory` and ran each with `victory.exe warm --limit 0 --jobs 1`. A temporary `victory.toml` selected isolated cache and data paths. Each cache had a synthetic shader artifact, a host-pipeline artifact and an empty pipeline book. With the current `translator.txt` held open for writing while denying reads, Windows returned sharing violation 32. Main deleted both artifacts. The PR kept both and printed the cache-read warning. Both invocations completed normally and left the book and marker in place. I also checked matching, different, missing and invalid UTF-8 markers through the same command. Matching kept the artifacts. The other three refreshed them, set the current marker and retained the book on both builds. Ten CLI cases passed, with no title or real cache involved.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4907'
git switch 'github-bot/gh-4907'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4907'
git switch 'github-bot/gh-4907'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4907'
git switch 'main'
git merge --squash 'github-bot/gh-4907'
git switch 'main'
git merge --ff-only 'github-bot/gh-4907'
git switch 'main'
git merge 'github-bot/gh-4907'
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/trustno1-coder--VIctory-NVIDIA!4908
No description provided.