Repository navigation
fix: Release obsolete model caches across residency changes - #816
Draft
buildingjoshbetter wants to merge 1 commit into
Draft
buildingjoshbetter wants to merge 1 commit into
buildingjoshbetter wants to merge 1 commit into
Conversation
This was referenced Oct 8, 2026
This branch has not been deployed
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.
Scope
A reviewed cache-lifetime step for #297, stacked on #813. Preserve embedding and reranker identities, dtypes, dimensions, batch limits, queue limits and result caps.
Reproduction and changes
Synthetic constructor and inference barriers reproduced overlapping obsolete model references during replacement and stale CPU cache retention after main-model changes. These are lifetime defects; the reproduction does not establish an unbounded leak or native byte cost.
The existing target-model tests that required retention of the old warm cache now assert the explicit memory-first failure policy, weakref release and reload. Their configuration, in-flight identity and lock assertions remain. Existing microbatch tests receive only the AST fixture dependencies required by the actual methods; behavioral assertions remain unchanged.
Validation
5048bec8c709f9a14b3a588d57fa3a9a4461c13c9655626d70d08c2624e2e495.69427dc69358467b7c565222bbbafe39c3f0d9e02178d0adc7f5d4a99e48f28c.2824d3cc5d03ce948597fd51d404a89b4c3c0f30.Limits and remaining work
This step limits obsolete Python cache references. It does not establish a whole-process memory budget, bound native allocator caches, eliminate active main/CPU overlap, change OOM fallback, or measure MPS memory, thermals or production latency. #297 remains open for the remaining admission and native validation work.
Only synthetic data was used in isolated tests. No personal memories, transcripts or credentials were exported. No main merge, release, package publication or issue closure.