Repository navigation
lab(drf-w8): evict unpinned foci to a resident budget, LRU first - #1770
Conversation
…lic churn Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
… loaded first FocusManager::evict_to_budget removes unpinned built foci in LRU order (tick refreshed on every load, hit or miss) until the gathered columns fit the budget. A focus a reader still holds is never evicted, so the report can say over_budget (W8); a slot still being built counts as pinned. An evicted focus rebuilds identically on its next load. resident_bytes and FOCUS_BYTES (the gathered column; the shared map is caller-owned) added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This adds W8 and the focus-churn item from
.claude/plans/d-dr64-focus-cache-falsifiers-v1.mdtodrf-focus-probe.Change
FocusManager::evict_to_budget(budget_bytes) -> BudgetReportremoves unpinned built foci, least recently loaded first, until the resident bytes fit the budget. Everyload, hit or miss, refreshes a focus's recency tick.over_budget. A slot that is still being built counts as pinned.resident_bytes()andFOCUS_BYTES. One focus counts as its gathered i32 column, 16 KiB. The 8 KiB sealed map is not counted, because the caller owns it and shares it through anArc.Tests (
tests/integration/budget.rs; 27 pass with--features handoffon native and onx86-64-v3; clippy-D warningsis clean)evict_to_budget(0)while the idle ones go, and the pass reportsover_budget. The held focus still folds to the direct-read result.Disable runs (each turns at least one test red)
Open: under a cyclic working set one focus larger than the budget, LRU is the worst policy; every load becomes a full gather. Whether real thought workloads switch cyclically, and whether to fall back to direct reads instead of rebuilding, is not decided here.
Merge note: this PR and #1769 both edit
FocusManager::loadnear the key construction, and both add a row to the entries index. Whichever merges second may need a small rebase.Board:
.claude/board/entries/2026-10-25-drf-w8-budget.md.Generated by Claude Code