Repository navigation
perf: keep models loaded across audio/video and group the watcher queue by file kind - #107
Merged
Merged
Conversation
…ue by file kind - Whisper runs on the CPU beside the resident text model when the text model holds a dedicated GPU and Whisper would not fit next to it; it then registers no GPU memory, so the next text load no longer evicts it. Each audio or video file used to evict one model for the other. Unified memory (Metal/Apple Silicon) is unchanged. - The smart-folder watcher keeps taking files of the kind it just ran (document, image, audio/video) while any are waiting, up to 25 picks in a row, then returns to queue order. With one file at a time it used to follow arrival order, swapping models whenever kinds alternated.
…it did not finish The rerun after a busy wait relied on the analysis cache, which keeps results for 30 minutes and at most 500 documents / 300 images; a long batch outlived it and the rerun redid the work. While waiting, the run now hydrates the earlier batch's results from the durable ready queue (so progress shows them) and, once free, sends only the files without a current ready result (same modified time). When the earlier batch finished everything, the run ends without another batch.
This was referenced Nov 10, 2026
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.
Follow-up to #106. It closes the two remaining places where analysis swapped models file by file on a 6 GB GPU.
canFitExternalLoadsays Whisper won't fit beside it, Whisper loads withuseGpu: false(whisper.cpp runs on the CPU with any build variant) and registers 0 bytes of GPU memory. Before, each audio or video file evicted one model to load the other; the live log showed[Whisper] Model evicted under memory pressureright after an mp3. Unified memory (Metal or Apple Silicon) is unchanged.Verified
WhisperService.test.js(CPU when it won't fit, GPU when it fits, GPU with no text model, never on Metal) andSmartFolderWatcher.laneGrouping.test.js(grouping and the streak cap). The grouping tests fail on the previous watcher.typecheck:jsare clean.Not covered
cpuBesideText: truein the[Whisper] Loading modellog line, and no Whisper evictions between files.Added: skip work the earlier batch already did
filesNotYetReady). If the earlier batch finished everything, the run ends without another batch.discoverBatchBusynow has 19 tests. The Discover-related suites, 8 suites and 123 tests, all pass.