music-video-gen/flow-state/src
Dejvino e90951c277 Cache the gallery against a fingerprint of the source that built it
Three minutes of GPU work is fine once and intolerable on every page load, so
the gallery now builds once and comes back from IndexedDB after that.

The key is the part worth getting right. A cache you clear by hand is worse than
no cache: it will eventually show last week's pixels while you are judging this
morning's change, and it will look like a render, so you will believe it. Here
the key is a fingerprint of every file under src/, collected through
import.meta.glob so it covers the shaders, the identity, the look generator, the
engine and the descriptors without naming any of them — the file that
invalidates a render is exactly the one nobody remembers to list. Edit anything
and the entry stops matching and the page rebuilds without being asked.

Thumbnails are WebP blobs rather than raw pixels: sixty-five scenes at six
frames of 256x144 is 57MB raw, and measured, the compressed form is 4.1MB for
the whole library. Saving a build evicts every other one, so the store cannot
grow without bound.

The spinner is a CSS animation on purpose. Building blocks the main thread in
bursts and a JS-driven spinner would freeze mid-turn, which reads as a hang
exactly when the page most needs to look alive.

Verified rather than assumed, six behaviours: the fingerprint is stable across
calls; a build round-trips through storage and decodes to a real image (51%
non-black); a different fingerprint misses; saving a new key evicts the old; and
appending one comment to one scene file moved the fingerprint from 125-f842b05e
to 125-c056d7b9, which is the invalidation working end to end.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 07:19:22 +02:00
..
audio Rename clicktrack.js — a content blocker was eating it and killing the app 2026-08-18 07:01:23 +02:00
checks Cache the gallery against a fingerprint of the source that built it 2026-08-18 07:19:22 +02:00
engine Finish the migration: all 65 scenes on the identity artifacts 2026-08-18 06:39:19 +02:00
export Fix export frame loss: reject codec profiles that reorder frames 2026-08-06 13:10:24 +02:00
look Staging: a shared lattice, and the element size the songs were all sharing 2026-08-17 21:36:55 +02:00
params A reproducible migration, and the first eighteen scenes through it 2026-08-17 21:59:24 +02:00
scenes Fix two scenes that were failing their gate before the migration touched them 2026-08-18 06:44:04 +02:00
ui Fix export frame loss: reject codec profiles that reorder frames 2026-08-06 13:10:24 +02:00
main.js Rename clicktrack.js — a content blocker was eating it and killing the app 2026-08-18 07:01:23 +02:00
Show.js Make grain a treatment, tempo a governor, and params commit harder 2026-08-06 07:04:27 +02:00