Skip to content

lab(drf-w8): evict unpinned foci to a resident budget, LRU first - #1770

Merged
AdaWorldAPI merged 3 commits into
mainfrom
lab/drf-w8-budget-20261025
Oct 25, 2026
Merged

AdaWorldAPI merged 3 commits into
mainfrom
lab/drf-w8-budget-20261025

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

This adds W8 and the focus-churn item from .claude/plans/d-dr64-focus-cache-falsifiers-v1.md to drf-focus-probe.

Change

  • FocusManager::evict_to_budget(budget_bytes) -> BudgetReport removes unpinned built foci, least recently loaded first, until the resident bytes fit the budget. Every load, hit or miss, refreshes a focus's recency tick.
  • A focus that a reader still holds is never evicted, so a pass can end over_budget. A slot that is still being built counts as pinned.
  • Also added: resident_bytes() and FOCUS_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 an Arc.

Tests (tests/integration/budget.rs; 27 pass with --features handoff on native and on x86-64-v3; clippy -D warnings is clean)

  • W8: a held focus survives evict_to_budget(0) while the idle ones go, and the pass reports over_budget. The held focus still folds to the direct-read result.
  • Rebuild: an evicted focus re-gathers on its next load with an identical column and fold.
  • Order: the least recently loaded focus is evicted first, and an exact fit evicts nothing.
  • Churn, measured: cyclic switching over 3 foci, 30 loads, one eviction pass after each load. A budget of 3 foci gives 3 builds; a budget of 2 or 1 gives 30.

Disable runs (each turns at least one test red)

  • Evict pinned foci.
  • Skip the recency update on a hit.
  • Evict newest first.
  • Treat an exact fit as over budget.

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::load near 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

…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
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 05c923ea-be91-481f-bd6f-019613a81644
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 25, 2026 07:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-25T07:33:29.456446Z
We couldn’t complete this review. Comment @codex review to try again.
984c2db Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AdaWorldAPI
AdaWorldAPI merged commit b149ffc into main Oct 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants