Keep unrelated files when clearing a shared cache folder #598

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

@⁠shiaho777 on GitHub · 2026-12-04 13:09 UTC · original
shiaho777:fix/cache-cleanup-names → main · +28 −7 · 1 files · 1 commits · open

In a shared cache directory, Clear old selects a directory such as shaders/t-screenshots and a file such as shaders/.tmp-notes for deletion. Preparing everything again also selects images/victory-image-backup.dll. A directory selected by Clear old is removed together with its contents.

Check for the 16-digit hex fingerprints used by the shader and image writers and for both decimal fields of a staging filename. A display-profile directory is selected as a unit only when it contains at least one image and every entry can be identified as a generated image.

The cache tests now include unrelated names alongside real cache entries. All three tests passed in the Windows test binary under Wine. I also ran victory caches --delete in temporary directories in its default, --start-over, and --start-over --everything modes and checked the surviving files. Windows-target Clippy and cargo xtask policy passed.

**@⁠shiaho777** on GitHub · 2026-12-04 13:09 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/598) `shiaho777:fix/cache-cleanup-names` → `main` · +28 −7 · 1 files · 1 commits · open In a shared cache directory, Clear old selects a directory such as `shaders/t-screenshots` and a file such as `shaders/.tmp-notes` for deletion. Preparing everything again also selects `images/victory-image-backup.dll`. A directory selected by Clear old is removed together with its contents. Check for the 16-digit hex fingerprints used by the shader and image writers and for both decimal fields of a staging filename. A display-profile directory is selected as a unit only when it contains at least one image and every entry can be identified as a generated image. The cache tests now include unrelated names alongside real cache entries. All three tests passed in the Windows test binary under Wine. I also ran `victory caches --delete` in temporary directories in its default, `--start-over`, and `--start-over --everything` modes and checked the surviving files. Windows-target Clippy and `cargo xtask policy` passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 13:11:22 +00:00
Author
Owner

@⁠fromthemoonx on GitHub · 2026-12-04 15:42 UTC · original

Works on native Windows: nothing that isn't the layer's is deleted any more, and everything the layer writes still goes.

victory caches --delete, main against this PR, on the same made-up cache folder (debug builds):

mode main also deleted this PR also deleted
default, and --older t-screenshots, t- with 15 and with 17 hex digits, .tmp-notes, .tmp-12-notes nothing
--start-over .tmp-notes, .tmp-12-notes nothing
--start-over --everything all of the above, victory-image-backup.dll, victory-image-<16 hex>-old.dll, a native-backups folder with victory-image-mine.dll in it nothing

The layer's own entries went or stayed the same on both sides in every mode. A junction named t-aaaaaaaaaaaaaaaa was left alone by both.

I also checked the new patterns against the code that writes the names (translator_stamp, create_tempfile_in, PreparedImage::file_name), at this head and at the tags v0.8.3 to v0.8.3.5: all of them fit, so leftovers of those releases are still found.

One small difference: --everything now leaves an empty native-* folder, which main removed. Harmless as far as I can see.

Tested: 9926cb44, which is on top of current main (5e44415b). Windows 11, RTX 3060 12 GB, Ryzen 7 5700X, 16 GB RAM.

  • cargo test --workspace --locked: 1400 passed, 0 failed, 51 ignored, the same counts as main here.
  • The three caches tests, 3 more times: pass.
  • Each new check undone on its own (t- fingerprint, .tmp- decimals, image fingerprint, empty folder, case of the current folder): the tests fail each time.

Not tested: the launcher's buttons, a cache folder from real play, Clippy.

AI use: tested and written up with Claude Code (Claude Opus 5.5).

**@⁠fromthemoonx** on GitHub · 2026-12-04 15:42 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/598#issuecomment-7416281607) Works on native Windows: nothing that isn't the layer's is deleted any more, and everything the layer writes still goes. **`victory caches --delete`, `main` against this PR**, on the same made-up cache folder (debug builds): | mode | `main` also deleted | this PR also deleted | |---|---|---| | default, and `--older` | `t-screenshots`, `t-` with 15 and with 17 hex digits, `.tmp-notes`, `.tmp-12-notes` | nothing | | `--start-over` | `.tmp-notes`, `.tmp-12-notes` | nothing | | `--start-over --everything` | all of the above, `victory-image-backup.dll`, `victory-image-<16 hex>-old.dll`, a `native-backups` folder with `victory-image-mine.dll` in it | nothing | The layer's own entries went or stayed the same on both sides in every mode. A junction named `t-aaaaaaaaaaaaaaaa` was left alone by both. I also checked the new patterns against the code that writes the names (`translator_stamp`, `create_tempfile_in`, `PreparedImage::file_name`), at this head and at the tags v0.8.3 to v0.8.3.5: all of them fit, so leftovers of those releases are still found. One small difference: `--everything` now leaves an empty `native-*` folder, which `main` removed. Harmless as far as I can see. **Tested:** `9926cb44`, which is on top of current `main` (`5e44415b`). Windows 11, RTX 3060 12 GB, Ryzen 7 5700X, 16 GB RAM. - `cargo test --workspace --locked`: 1400 passed, 0 failed, 51 ignored, the same counts as `main` here. - The three `caches` tests, 3 more times: pass. - Each new check undone on its own (`t-` fingerprint, `.tmp-` decimals, image fingerprint, empty folder, case of the current folder): the tests fail each time. **Not tested:** the launcher's buttons, a cache folder from real play, Clippy. **AI use:** tested and written up with Claude Code (Claude Opus 5.5).
This pull request can be merged automatically.
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/598/head:github-bot/gh-598'
git switch 'github-bot/gh-598'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-598'
git switch 'github-bot/gh-598'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-598'
git switch 'github-bot/gh-598'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-598'
git switch 'main'
git merge --squash 'github-bot/gh-598'
git switch 'main'
git merge --ff-only 'github-bot/gh-598'
git switch 'main'
git merge 'github-bot/gh-598'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.