Skip to content

feat(inference): FootprintRegistry::revoke_leases_for — pressure-driven lease revocation (slice 2) - #1615

Merged
joelteply merged 2 commits into
canaryfrom
feat/footprint-revoke-leases
Jun 14, 2026
Merged

joelteply merged 2 commits into
canaryfrom
feat/footprint-revoke-leases

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Slice 2 of wiring ThroughputLease ↔ FootprintRegistry ↔ PressureBroker (realization-priority #1).

Slice 1 (#1613) landed the pure select_leases_to_revoke classifier. This slice gives FootprintRegistry the realization that actually reclaims footprint under pressure — the pressure-driven sibling of the clock-driven expire_leases.

What it adds

revoke_leases_for(target_bytes, pressure_tier, now_ms) -> Option<LeaseRevocationOutcome>:

  1. snapshots the live lease mirrors → (Vec<ThroughputLease>, HashMap<lease_id, bytes>)
  2. picks the least-disruptive plan via the pure select_leases_to_revoke (expired → Hard → Graceful; active Pinned never; tier gates the ceiling)
  3. releases each chosen lease — removing its mirrored footprint so a subsequent cheapest_eviction_for pass can reclaim the now-unpinned keys
  4. returns None when policy can't satisfy the demand (caller escalates; a None pass releases nothing)

Design — "B-done-right" (agreed with Mac)

The registry owns lease-reclaim mechanics (mirrors expire_leases, same file, same shape). 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.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_for strands), pinned-safety (None releases nothing), tier-gating in the realization path, subset-only release, and zero-target no-op.

🤖 Generated with Claude Code

…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]>
@joelteply
joelteply merged commit c206c45 into canary Jun 14, 2026
2 checks passed
@joelteply
joelteply deleted the feat/footprint-revoke-leases branch June 14, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant