Repository navigation
Perf: reduce ingest-pipeline CPU/memory churn concurrent with playback [stacked on #113] - #118
Merged
Conversation
Audit part 3 — behavior identical throughout: - AVAudioFile duration reads (ingest + launch backfill) move off the main actor; a large library's backfill did one synchronous main-thread file open per track. - Stem-cache budget passes are single-flight: rapid skips fired one full directory scan per queue move, racing each other. Coalesced to one running + at most one queued pass that re-reads the latest protected set when it starts. - separateStems no longer strongly pins the @model track across the CPU-minutes separation task (weak capture; all writes already guard on modelContext). - runStreaming mix buffers and StreamingOverlapAdd drain via a head cursor with amortized compaction instead of removeFirst-per-window memmoves (~MBs of copy traffic per window under playback). - Launch/exhaustion id-map fetches and LibraryCleanup fetches use propertiesToFetch so every track's beatTimes array is no longer eagerly hydrated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013TJoWkqg8bzkGdzxWhWjWP
sanylax0
approved these changes
Jul 20, 2026
sanylax0
merged commit Jul 20, 2026
7f80c1f
into
claude/repo-review-improvements-yvk3t7-cloud-import
4 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 3 of the CPU/memory audit — the background pipeline that runs while music plays. Stacked on #113/#112 (touches the same stems files). All changes behavior-identical.
AVAudioFile(forReading:)on the main actor — one per track at launch for a big library. Now off-main at utility priority.separateStemsno longer pins the@Modeltrack for the CPU-minutes separation run (weak capture; every write already guards onmodelContext).runStreaming's mix buffers andStreamingOverlapAdd.drainusedremoveFirst(n)per window (~MBs of copy traffic each, concurrent with playback); both now use a head cursor with amortized compaction. The existingOverlapAddTestspin output equivalence on Linux CI.LibraryCleanup's reference scans usepropertiesToFetch, sobeatTimes(hundreds of doubles per track) faults in only for tracks that actually play.Device check
stemslogs); skip rapidly — no behavioral change, stems of the current neighborhood survive eviction.🤖 Generated with Claude Code
https://claude.ai/code/session_013TJoWkqg8bzkGdzxWhWjWP
Generated by Claude Code