Idea: Improve cache reuse across game instances #1759

Closed
opened 2026-11-19 17:05:54 +00:00 by BeanBot · 1 comment
Member

Reported on Discord

The idea

Improve cache reuse across separate Longshot game instances, so instances can benefit from caches prepared by another instance where it is safe to do so.

Why?

The reporter believes cache data is reused across instances and asked for a general improvement. The desired behavior and constraints for sharing caches between instances have not been specified; determine which caches can safely be shared and how instance-specific inputs should be handled.

  • #1510: shader cache invalidation caused by sizeof(Program) in the cache stamp.
  • #1649: shader cache disk usage and proposed compression/deduplication.

These track separate cache concerns, not general cross-instance cache reuse.

Reported on [Discord](https://discord.com/channels/1569849200047427645/1570984952651055114/1573010723888693289) ### The idea Improve cache reuse across separate Longshot game instances, so instances can benefit from caches prepared by another instance where it is safe to do so. ### Why? The reporter believes cache data is reused across instances and asked for a general improvement. The desired behavior and constraints for sharing caches between instances have not been specified; determine which caches can safely be shared and how instance-specific inputs should be handled. ### Related - #1510: shader cache invalidation caused by `sizeof(Program)` in the cache stamp. - #1649: shader cache disk usage and proposed compression/deduplication. These track separate cache concerns, not general cross-instance cache reuse.
Member

Taking this one (madebyjordan). What can be shared, measured on two installs a player keeps side by side (stable v3.0.0 and nightly-486, different translator stamps):

  • The game's files (romfs, 24.4 GB): already shared. #360 and LongshotLauncher #58 hard-link them between builds of the same .nup.
  • The program cache's SPIR-V (~7.5 GB a build): 99.6% of programs translate to byte-identical SPIR-V in both, so the two builds hold 14.7 GB of it that is 3.5 GB distinct. Plan: a content-addressed SPIR-V pack shared by every game folder, with records referring to it. Details and the numbers are in #1649 (issuecomment-55045), which this builds on.
  • The launcher's sizes: each row shows the folder's size with the shared game files counted in it (36 GB each), which reads as two copies of the game. The row should show what the build holds of its own, and the total should say what is shared.

Not shared, and staying per build: the Vulkan pipeline cache (driver binaries, checked against the GPU and driver), the pipeline notes (#1649's C shrinks them), the exe and the build's own files.

🤖 Generated with Claude Code

Taking this one (madebyjordan). What can be shared, measured on two installs a player keeps side by side (stable v3.0.0 and nightly-486, different translator stamps): - **The game's files (romfs, 24.4 GB):** already shared. #360 and LongshotLauncher #58 hard-link them between builds of the same .nup. - **The program cache's SPIR-V (~7.5 GB a build):** 99.6% of programs translate to byte-identical SPIR-V in both, so the two builds hold 14.7 GB of it that is 3.5 GB distinct. Plan: a content-addressed SPIR-V pack shared by every game folder, with records referring to it. Details and the numbers are in #1649 (issuecomment-55045), which this builds on. - **The launcher's sizes:** each row shows the folder's size with the shared game files counted in it (36 GB each), which reads as two copies of the game. The row should show what the build holds of its own, and the total should say what is shared. Not shared, and staying per build: the Vulkan pipeline cache (driver binaries, checked against the GPU and driver), the pipeline notes (#1649's C shrinks them), the exe and the build's own files. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
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/Longshot#1759
No description provided.