Repository navigation
feat(inference): FootprintRegistry::revoke_leases_for — pressure-driven lease revocation (slice 2) - #1615
Merged
Conversation
…en lease revocation (slice 2) Slice 2 of wiring ThroughputLease ↔ FootprintRegistry ↔ PressureBroker. Slice 1 (#1613) landed the pure `select_leases_to_revoke` classifier; this slice gives the FootprintRegistry the realization that actually reclaims footprint under pressure — the pressure-driven sibling of the clock-driven `expire_leases`. `revoke_leases_for(target_bytes, pressure_tier, now_ms) -> Option<LeaseRevocationOutcome>`: snapshots the live lease mirrors, picks the least-disruptive plan via the pure `select_leases_to_revoke` (expired → Hard → Graceful, active Pinned never; tier gates the ceiling), then RELEASES each chosen lease — removing its mirrored footprint so a subsequent `cheapest_eviction_for` pass can reclaim the now-unpinned keys. Returns None when policy can't satisfy the demand (caller escalates; a None pass releases nothing). Design (with Mac, "B-done-right"): the registry owns lease-reclaim mechanics (mirrors `expire_leases`); the PressureBroker stays the single decision-maker and will call this in phase 2 of `relieve()` (slice 3). Pool eviction stays dumb. No new tokio task / channel / pressure source — honors CONCURRENCY-STYLE-GUIDE. Validated on rust:1.95 (continuum-core --lib): 13 tests pass (5 new revoke_* + 8 slice-1 lease_revocation), CARGO_EXIT=0, clean compile. The 5 new tests cover: complementarity with key-eviction (reclaims an expired-Pinned lease that cheapest_eviction_for strands), pinned-safety (None releases nothing), tier-gating in the realization path, subset-only release, and zero-target no-op. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…er nit, #1615) Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
Slice 2 of wiring
ThroughputLease↔FootprintRegistry↔PressureBroker(realization-priority #1).Slice 1 (#1613) landed the pure
select_leases_to_revokeclassifier. This slice givesFootprintRegistrythe realization that actually reclaims footprint under pressure — the pressure-driven sibling of the clock-drivenexpire_leases.What it adds
revoke_leases_for(target_bytes, pressure_tier, now_ms) -> Option<LeaseRevocationOutcome>:(Vec<ThroughputLease>, HashMap<lease_id, bytes>)select_leases_to_revoke(expired → Hard → Graceful; activePinnednever; tier gates the ceiling)cheapest_eviction_forpass can reclaim the now-unpinned keysNonewhen policy can't satisfy the demand (caller escalates; aNonepass releases nothing)Design — "B-done-right" (agreed with Mac)
The registry owns lease-reclaim mechanics (mirrors
expire_leases, same file, same shape). ThePressureBrokerstays the single decision-maker and will call this in phase 2 ofrelieve()(slice 3). Pool eviction stays dumb. No new tokio task / channel / pressure source — honorsCONCURRENCY-STYLE-GUIDE.md. Dependency direction is clean (inference → paging, no cycle).Validation (rust:1.95, continuum-core
--lib)test result: ok. 13 passed; 0 failed·CARGO_EXIT=0· clean compile.5 new tests cover: complementarity with key-eviction (reclaims an expired-Pinned lease that
cheapest_eviction_forstrands), pinned-safety (Nonereleases nothing), tier-gating in the realization path, subset-only release, and zero-target no-op.🤖 Generated with Claude Code