Repository navigation
refactor(inference): collapse coordinator's revocation ladder onto the single disruption_rank (slice 3) - #1617
Merged
Merged
Conversation
…e single disruption_rank (slice 3) The revocation ladder (expired → Hard → Graceful, never an active Pinned lane) was defined TWICE: once in `paging/lease_revocation::disruption_rank` (slice 1 #1613, read from `lease.revocation_policy`, consumed by `select_leases_to_revoke`), and again as a parallel inline `fn tier(class)` in `InferenceCoordinator::evict_under_pressure` (mapping `LaneClass`→tier). Compression-principle violation: one policy, two encodings that can drift. Collapse them onto the single definition: - `disruption_rank` is now `pub` — THE shared ladder. - `evict_under_pressure` builds candidates via `disruption_rank(lane.lease(), now_ms)?` (None = active Pinned → filtered out), sorts by (rank, acquired_at_ms), and derives `EvictionReason` from rank. The inline `tier()` and the separate Realtime-skip are gone. Behavior-preserving: `open_lane` sets `revocation_policy: class.revocation_policy()` (Realtime→Pinned, Interactive→Graceful, Background|Sentinel→Hard), and `lane.is_expired` delegates to `lease.is_expired`, so the ranks are identical to the former inline tier(). The coordinator keeps its own SELECTION STRATEGY (oldest-first, ungated, lane-aware side effects) on top of the shared ladder — distinct from `select_leases_to_revoke`'s broker-style strategy (largest-first, PressureTier-gated). One ladder, two strategies. Validated rust:1.95 (continuum-core --lib): 46 tests pass (full inference::coordinator + lease_revocation suites), CARGO_EXIT=0, behavior unchanged. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…nit, #1617) The event/EvictedLane payloads re-fetch lane.class() after lanes.remove; the candidate field is vestigial post-ladder-collapse. Removes the 'field class is never read' warning. 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 3 — compression. The revocation ladder (expired → Hard → Graceful, never an active Pinned lane) was defined twice:
paging/lease_revocation::disruption_rank(slice 1 feat(paging): select_leases_to_revoke — pressure-driven lease revocation classifier #1613) — readslease.revocation_policy, consumed byselect_leases_to_revoke.fn tier(class)insideInferenceCoordinator::evict_under_pressure— mappedLaneClass→tier.Two encodings of one policy → drift risk. This collapses them onto the single definition.
Change
disruption_rankis nowpub— the shared ladder.evict_under_pressurebuilds candidates viadisruption_rank(lane.lease(), now_ms)?(None= active Pinned → filtered out), sorts by(rank, acquired_at_ms), derivesEvictionReasonfrom rank. Inlinetier()+ the separate Realtime-skip deleted.Behavior-preserving (the precondition I verified)
open_lanesetsrevocation_policy: class.revocation_policy()—Realtime→Pinned,Interactive→Graceful,Background|Sentinel→Hard(lane.rs:114).lane.is_expireddelegates tolease.is_expired(lane.rs:211).So
disruption_rank(lease)yields identical ranks to the former inlinetier(class)(expired=0, Hard=1, Graceful=2, active-Pinned=excluded). The coordinator keeps its own selection strategy (oldest-first, ungated, lane-aware events) on top of the shared ladder — distinct fromselect_leases_to_revoke's broker-style strategy (largest-first,PressureTier-gated). One ladder, two strategies.Validation (rust:1.95, continuum-core
--lib)test result: ok. 46 passed; 0 failed(fullinference::coordinator+lease_revocationsuites) ·CARGO_EXIT=0· behavior unchanged.🤖 Generated with Claude Code