Skip to content

steam-sharing: copy Steam's shader record along with the cache - #36

Merged
andrewthomaslee merged 1 commit into
mainfrom
steam-shader-record
Nov 10, 2026
Merged

andrewthomaslee merged 1 commit into
mainfrom
steam-shader-record

Conversation

@andrewthomaslee

@andrewthomaslee andrewthomaslee commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Summary

A copied shader cache now carries Steam's own record of it, so the receiver's Steam doesn't process it again.

 steam-copy-game / steam-shader-sync
   place_copy  <src>/steamapps/shadercache/<appid> -> receiver
+  copy_shader_record  (receiver's Steam closed, config.vdf theirs)
+    steam-shader-record <src config.vdf> <dst config.vdf> <appid>
+      ShaderCacheManager.CommittedDepotManifests.<appid> = source's
+      ShaderCacheManager.App.<appid>                     = source's
+      ShaderCacheManager.CompatToolBucketHashes         += source's
+      ProcessingQueue: <appid> queued only if it was for the source

Evidence

  • Before (kamrui-h1): wife's config.vdf had "ProcessingQueue" "2357570;" and no record of the GE-Proton pipeline buckets. Her Steam replayed steamapprun_pipeline_cache.049c…: Still replaying 2357570 (33%, 11746/1800301), about 230 pipelines/s, so hours of work. netsa's record had an empty queue, so his Steam didn't replay.
    After: a dry run on a copy of netsa's real config.vdf writes the 2357570 depots, size and buckets into a fake receiver config and empties its queue. vm-test steam-sharing → passed, with a new subtest: "Steam's record of the shader cache follows the copy". It also checks that a game the source still has queued stays queued, that the file keeps its owner and mode, and that the sync copies the record too.
  • check → all checks passed.

Merge Danger

Door: two-way

Only the receiver's config.vdf (ShaderCacheManager section) is rewritten, and only while their Steam is closed. Reverting stops further rewrites. A wrong record only makes Steam download or process a cache again.

Blast Radius: steam-sharing

Machines with hostSpec.system.gaming.steamSharing (kamrui-h1). The file is re-serialized by python vdf, with a space instead of two tabs between key and value. Steam's KeyValues parser should accept that, and Steam rewrites the file in its own format when it exits. This hasn't been tried on a real Steam yet: that is checked on kamrui-h1 after deploy (wife's Steam starts without processing Overwatch).

🤖 Generated with Claude Code

Each Steam client keeps its own record of a game's shader cache in
config/config.vdf (ShaderCacheManager: CommittedDepotManifests,
ProcessingQueue, ShaderCacheSize, CompatToolBucketHashes). A cache
copied by steam-copy-game or steam-shader-sync arrived without it, so the
receiver's Steam kept the game queued and replayed every pipeline again.
On kamrui-h1 that was wife's Overwatch: 1.8M pipelines (hours) although
her copy already held the compiled shaders.

steam-shader-record (_steam-shader-record.py) now writes the source's
record of the game into the receiver's config.vdf, while the receiver's
Steam is closed; the game stays queued only if it was for the source.

VM test steam-sharing: the record follows steam-copy-game and the sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andrewthomaslee
andrewthomaslee merged commit 079b331 into main Nov 10, 2026
3 checks passed
andrewthomaslee added a commit to external-systems/home that referenced this pull request Nov 10, 2026
## Summary

```diff
 flake.lock  modules 3c31dde → 079b331 (external-systems/modules#36)
```

`steam-copy-game` and `steam-shader-sync` now also copy Steam's record
of a shader cache (`config.vdf`, `ShaderCacheManager`), so the
receiver's Steam doesn't replay it again. On kamrui-h1 that's wife's
Overwatch: 1.8M pipelines.


## Evidence

- **Before:** wife's `config.vdf` had `"ProcessingQueue" "2357570;"`,
and her Steam replayed `0/1797888` pipelines at launch.
**After:** modules `vm-test steam-sharing` → passed (the record follows
the copy). Home `check` → all checks passed. `nix build
.#nixosConfigurations.kamrui-h1.config.system.build.toplevel` →
`y6vlrz9s…-nixos-system-kamrui-h1`, with `steam-shader-record` on
`steam-copy-game`'s PATH.
- Still to do after deploy: the next `steam-shader-sync` run, or
`steam-copy-game --force`, writes wife's record, and her Steam then
starts without "Processing Vulkan shaders".

## Merge Danger

**Door:** two-way

**Blast Radius:** kamrui-h1

Only the users' Steam `config.vdf` `ShaderCacheManager` section is
rewritten, and only while that user's Steam is closed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant