Shader cache: translator key skips comments, tests and unrelated lock entries; prune unused entries #1581

Manually merged
github merged 2 commits from github-bot/gh-1581 into main 2026-11-30 14:17:13 +00:00 AGit
Owner

@⁠101Leafy on GitHub · 2026-11-28 21:56 UTC · original
101Leafy:nv/shader-key-trim → main · +414 −13 · 3 files · 2 commits · merged 2026-11-30 14:12 UTC

The shader cache key held a fingerprint of the whole translator source and the whole Cargo.lock. An edit to a comment, a test, or an unrelated crate's lock entry changed the key, and the next start translated every shader again.

  • victory-gpu/build.rs: the fingerprint skips comments, blank lines, and test modules, and takes only the Cargo.lock packages the translator is built from.
  • shader_cache.rs: entries carry a FORMAT number. That file is outside the fingerprint, so a change to encode or decode raises it.
  • victory-pipeline/src/cache.rs: with VICTORY_SHADER_CACHE_DAYS=n, entries not used for n days are removed on a thread of their own. A hit marks its entry used, and nothing goes until the cache has tracked use for n days. One folder here held 77,082 entries (2.7 GB) from earlier translator changes.
  • Log lines name an entry as <path>/<folder>/<file>, without the user's folders above it.
**@⁠101Leafy** on GitHub · 2026-11-28 21:56 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1581) `101Leafy:nv/shader-key-trim` → `main` · +414 −13 · 3 files · 2 commits · merged 2026-11-30 14:12 UTC The shader cache key held a fingerprint of the whole translator source and the whole Cargo.lock. An edit to a comment, a test, or an unrelated crate's lock entry changed the key, and the next start translated every shader again. - `victory-gpu/build.rs`: the fingerprint skips comments, blank lines, and test modules, and takes only the Cargo.lock packages the translator is built from. - `shader_cache.rs`: entries carry a `FORMAT` number. That file is outside the fingerprint, so a change to `encode` or `decode` raises it. - `victory-pipeline/src/cache.rs`: with `VICTORY_SHADER_CACHE_DAYS=n`, entries not used for `n` days are removed on a thread of their own. A hit marks its entry used, and nothing goes until the cache has tracked use for `n` days. One folder here held 77,082 entries (2.7 GB) from earlier translator changes. - Log lines name an entry as `<path>/<folder>/<file>`, without the user's folders above it.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 21:59:53 +00:00
github-bot force-pushed github-bot/gh-1581 from c123c4a09a to 667e97eb45 2026-11-29 00:50:57 +00:00 Compare
github-bot force-pushed github-bot/gh-1581 from 667e97eb45 to 004550996b 2026-11-29 01:46:48 +00:00 Compare
github-bot force-pushed github-bot/gh-1581 from 004550996b to a1f6e0ee25 2026-11-29 09:23:15 +00:00 Compare
github manually merged commit 1251b13a2d into main 2026-11-30 14:17:13 +00:00
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!1581
No description provided.