fix(storage): count and clear the compressed shader store #397

Merged
HumanBean merged 1 commit from HumanBean/LongshotLauncher:fix/compressed-shader-store into main 2026-12-02 19:35:26 +00:00
Owner

Why

Longshot #3023 keeps the shared shader store compressed, in new files (spirv.zpack and spirv.zidx, format 2). Storage only knows spirv.pack and spirv.idx, so it would neither count nor free the new files. This should land before #3023 reaches players.

What changed

  • src/storage/shaders.rs: each format's pack and index are checked on their own (magic, the name's own version, one generation). A folder can hold both, since builds from before #3023 keep using format 1.
  • The prepared program cache copies (spirv.pack.programs-*, the same names in both formats) are listed when either pair is there.
  • docs/paths.md names both.

Nothing changes on screen except the size Storage shows. It does not clear the old files on their own: clearing removes both formats, as clearing the shader store did before.

Testing

Linux:

  • cargo fmt --check, cargo clippy --locked --workspace --all-targets -- -D warnings: clean.
  • tests/test_launcher_core.py: 326 passed, 2 failed, 1 ignored. The two (adding_the_same_release_twice_creates_distinct_instances, copies_verified_artifacts_without_sharing_files_or_profile_data) refused because another longshot-builder was running on the PC; each passes when run alone, here and on main.
  • New test compressed_store_is_cleared_with_or_without_the_uncompressed_one: passes.
  • Tooling's test_release.py: 46 passed.

Not done: not tried in the running launcher against a real store, and not run on Windows.

🤖 Generated with Claude Code

## Why [Longshot #3023](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/3023) keeps the shared shader store compressed, in new files (`spirv.zpack` and `spirv.zidx`, format 2). Storage only knows `spirv.pack` and `spirv.idx`, so it would neither count nor free the new files. This should land before #3023 reaches players. ## What changed - `src/storage/shaders.rs`: each format's pack and index are checked on their own (magic, the name's own version, one generation). A folder can hold both, since builds from before #3023 keep using format 1. - The prepared program cache copies (`spirv.pack.programs-*`, the same names in both formats) are listed when either pair is there. - `docs/paths.md` names both. Nothing changes on screen except the size Storage shows. It does not clear the old files on their own: clearing removes both formats, as clearing the shader store did before. ## Testing Linux: - `cargo fmt --check`, `cargo clippy --locked --workspace --all-targets -- -D warnings`: clean. - `tests/test_launcher_core.py`: 326 passed, 2 failed, 1 ignored. The two (`adding_the_same_release_twice_creates_distinct_instances`, `copies_verified_artifacts_without_sharing_files_or_profile_data`) refused because another `longshot-builder` was running on the PC; each passes when run alone, here and on `main`. - New test `compressed_store_is_cleared_with_or_without_the_uncompressed_one`: passes. - Tooling's `test_release.py`: 46 passed. Not done: not tried in the running launcher against a real store, and not run on Windows. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(storage): count and clear the compressed shader store
Some checks failed
CI / What the change needs (pull_request) Successful in 4s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 10s
PR title / Conventional Commit title (pull_request) Successful in 5s
CI / Rust formatting, lint and tests (pull_request) Successful in 13m13s
CI / Release packages and stable upgrades (pull_request) Failing after 35m7s
bb3be94177
Longshot's shader store format 2 (spirv.zpack, spirv.zidx) beside format 1.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Member

Possibly related, for context:

  • PR #178 feat(settings): Free up space says what it deletes, and can clear shader caches — Earlier shader-cache clearing behavior that this extends for the compressed store
  • PR #210 fix(home): each build's size is what it holds of its own, and the footer says what builds share — Shared shader-store accounting and clearing; prior format-1 support
Possibly related, for context: - PR #178 feat(settings): Free up space says what it deletes, and can clear shader caches — Earlier shader-cache clearing behavior that this extends for the compressed store - PR #210 fix(home): each build's size is what it holds of its own, and the footer says what builds share — Shared shader-store accounting and clearing; prior format-1 support
HumanBean deleted branch fix/compressed-shader-store 2026-12-02 19:35:26 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
MagicBeanDev/LongshotLauncher!397
No description provided.