Skip to content

Store the stem model in Application Support instead of Caches - #87

Merged
sanylax0 merged 1 commit into
mainfrom
claude/repo-review-improvements-yvk3t7-model-storage
Jul 18, 2026
Merged

sanylax0 merged 1 commit into
mainfrom
claude/repo-review-improvements-yvk3t7-model-storage

Conversation

@sanylax2

Copy link
Copy Markdown
Collaborator

What

PR 3 of the jetsam RCA plan. The 158 MB HT-Demucs model lived in Caches, which iOS evicts under storage pressure — so the model could silently vanish and re-download at play time, adding both a 10–30 s silent delay (which matches the observed ~50 s kill window) and a network/disk spike stacked on playback start, recurring across launches.

How

StemModelStore.directory moves to Application Support (isExcludedFromBackup, same pattern as StemCache). ensureModel() first migrates a surviving Caches copy via a rename instead of re-downloading. No other behavior changes.

Testing

On device: after merging, first ensureModel call either migrates the existing file (instant) or downloads once; subsequent launches must never hit the network for the model. Verify with the mem[model ensured] breadcrumb appearing immediately after separation task begin.

🤖 Generated with Claude Code

https://claude.ai/code/session_013TJoWkqg8bzkGdzxWhWjWP


Generated by Claude Code

Caches is OS-evictable, so the 158 MB HT-Demucs model could silently
vanish and re-download at play time — a delay and a network/memory
spike stacked exactly on playback start (the jetsam RCA's ~50 s window
matches a silent re-download). Application Support persists; excluded
from backup; existing Caches copies are migrated instead of
re-downloaded.
@sanylax0
sanylax0 merged commit ebf3073 into main Jul 18, 2026
4 checks passed
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.

3 participants