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

Merged
101Leafy merged 2 commits from upstream-pr/1581 into main 2026-11-30 14:12:04 +00:00
101Leafy commented 2026-11-28 21:56:40 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by 101Leafy on 2026-11-28T21:56:40Z.


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.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5544956639 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1581). Originally posted by [101Leafy](https://github.com/101Leafy) on 2026-11-28T21:56:40Z. --- 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.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!1581
No description provided.