Shader cache key hashes the whole Cargo.lock: any dependency change makes the next launch cold #334
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS#334
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@derz92 on GitHub · 2026-11-27 12:23 UTC · original
Summary
victory-shader/build.rsfolds the whole workspaceCargo.lockintoVICTORY_SHADER_SOURCE_HASH, which keys the native shader disk cache (shader_cache::build). So adding or bumping a dependency anywhere in the workspace (an app crate, a test-only crate) invalidates every cached translation, about 16,000 shaders, even though the translator did not change. The next launch is then a cold start: the prewarm pool translates everything again for the first ~50 s, and the boot stutters (#332).I hit this by adding one path dependency to
apps/victory: the next run translated 3,483 shaders before the story load, against 0 on the run before.Proposed change
Hash only what the translator is built from: its own sources and manifest,
build.rs, the rustc version, and theCargo.lockentries of the packagesvictory-shaderdepends on (its dependency closure), not the whole lock file. Bumping a crate the translator uses still changes the key. Changes elsewhere in the workspace no longer do.I'd like to take this one and will send a PR.
@derz92 on GitHub · 2026-11-27 12:23 UTC · original
/claim
@github-actions[bot] on GitHub · 2026-11-27 12:23 UTC · original
Claimed by @derz92. Open a draft pull request with
Refs #334in its description within 24 hours, or the claim expires.@LakshanSivakumar on GitHub · 2026-11-28 00:35 UTC · original
Thank you, and thanks to derz92 for the fix. The shader cache key now hashes only the lock entries of the packages victory-shader depends on, not the whole Cargo.lock (#343, on main), with unit tests in lock_tests.rs. I have not measured a cold start myself. Closing. Please tell me if adding an app-only dependency still makes the next launch cold on
a6a58361.