Files
spacedrive/docs/core
Jamie PineandClaude Opus 5 ed782078f4 Keep thumbnails as WebP sidecars and replicate them to peers
The hot cache is raw BGRA and disposable, so nothing durable held a tile:
a wiped cache meant decoding every original again, and a replica could
only show a peer's thumbnails while that peer was awake to send them.

Every tile baked now also goes into its source's sidecars.db as WebP,
5 to 15 KB against around 300 KB in the cache, keyed by record uuid and
tile version. Content hashes would have deduped copies, but a content id
is re-derived when a full hash lands, which would orphan anything keyed
by it. The cache refills from a sidecar at the current version instead
of baking; a forced bake still reads the file. thumbs generate also
encodes a sidecar from the cache for any cached tile without one, so an
existing cache converts without touching the originals.

Each store counts its writes and stamps rows with the count, paired with
an id drawn at creation. Listings advertise both, and after each
replication pass a replica pulls anything newer with FetchSidecars, a
page at a time, into mounts-remote/<device>/<source>.sidecars.db. Remote
tile requests restore from that copy before asking the owner, so they
work with the owner offline. An owner answering FetchTiles sends a
current sidecar's WebP as stored, and tiles fetched on demand land in
the replica's copy too.

Titan converted 97,728 cached tiles into 1.05 GB of sidecars, down from
21 GB of cache. The Mac copied all of them and drew titan tiles it had
never fetched with titan's daemon stopped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 17:05:38 -07:00
..