Repository navigation
feat(genome): rank_pages_for_eviction — single-source tier eviction policy - #1623
Merged
Merged
Conversation
…olicy `TierStore::evict` (genome/store.rs) must drop resident pages under memory pressure, but the trait defines no policy and each role runs a different canonical `EvictionPolicy` (tier.rs). This adds the single, pure definition of "under THIS policy, which pages are least valuable to keep?" — the genome analog of `paging::lease_revocation::select_leases_to_revoke`. Every role-specific TierStore::evict delegates to ONE ordering instead of re-encoding it inline. `rank_pages_for_eviction(pages: &[ResidentPage], policy: &EvictionPolicy) -> Vec<PageRef>` — pure, no I/O, no mutation. Pinned pages excluded (the composition layer protects them mid-turn). Per-policy order: - LruWithinTurn / LruAcrossTurns — oldest last_access_ms first. - LfuPlusRecency — fewest access_count_window first, oldest as recency tiebreak. - DemandAlignedWithRefinedPreference — shares LFU's ResidentPage-level order (least-demanded first); its refined-over-imported preference needs blob provenance (not on ResidentPage) and is layered on by the TierStore. - AppendOnlyGcOnSleep — empty (Frozen never evicts on the hot path). Deterministic for a given input order (stable sort). The caller walks the returned order, dropping pages until enough bytes are freed — so evict() stays a thin loop with no policy logic. Validated rust:1.95 (continuum-core --lib): 6 tests pass (one per policy family + pinned-excluded + empty-input), CARGO_EXIT=0, clean compile. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…tion (reviewer nit, #1623) Pages equal on the policy signal now break by a total order on PageRef (page_order_key), so a TierStore can pass its HashMap-backed pages directly without run-dependent eviction order — matching the lease_id tiebreak in select_leases_to_revoke. Added a test feeding the same snapshot in both input orders and asserting identical output. Co-Authored-By: Claude Opus 4.8 <[email protected]>
joelteply
added a commit
that referenced
this pull request
Oct 31, 2026
Card 2a0d34cf: land the identity custody fix in base. 762adeb2 is the airc canary head + the read-never-mints identity custody fix (fix/read-never-mints-identity, card 4b2dbdf3): a READ of the work board on a named home no longer silently mints and overwrites a citizen's identity.key; init --as mints explicitly. Bumps every workspace pin in Cargo.toml [workspace.dependencies] (airc-core, airc-blobs, airc-protocol, airc-ipc, airc-bus, airc-lib, airc-wire, airc-trust, airc-work) and re-resolves Cargo.lock to the new rev (15 lock entries). This rev already carries #1623 (sealed progress / terminal reply lifecycle, which satisfied the c7083d04 BLOCKED note) plus #1618, #1624, #1630, #1633, #1635 on top. Suite status: airc suite green at 762adeb2 (identity_commands 10/10, airc-identity unit+doc). continuum suite re-run follows against this pin.
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.
TierStore::evictmust drop resident pages under pressure, but the trait defines no policy and each role runs a different canonicalEvictionPolicy(tier.rs). This adds the single pure definition of "under THIS policy, which pages are least valuable to keep?" — the genome analog ofpaging::lease_revocation::select_leases_to_revoke. Every role-specificTierStore::evictdelegates to ONE ordering instead of re-encoding it inline.Pure, no I/O, no mutation. Pinned pages excluded (composition layer protects them mid-turn). Per-policy order:
last_access_msfirst.access_count_windowfirst, oldest as recency tiebreak.ResidentPage) and is layered on by theTierStore.Deterministic for a given input order (stable sort). The caller walks the order, dropping pages until enough bytes are freed — so
evict()stays a thin loop with no policy logic.Scope
This is the pure policy; the role-specific stores (FastTierStore=VRAM, BenchTierStore=SSD, …) that call it are the I/O-bearing follow-ups. The trait + an
InMemTierstub already exist instore.rs.Validation (rust:1.95, continuum-core
--lib)6 passed; 0 failed(one per policy family + pinned-excluded + empty-input) ·CARGO_EXIT=0· clean compile.🤖 Generated with Claude Code