Skip to content

land: views-fewer-stat-walks - #590

Merged
ualtinok merged 5 commits into
mainfrom
land/views-fewer-stat-walks
Oct 19, 2026
Merged

ualtinok merged 5 commits into
mainfrom
land/views-fewer-stat-walks

Conversation

@aft-alfonso

@aft-alfonso aft-alfonso Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Accepted agent delivery; branch-keyed search descriptor included.


Summary by cubic

Cuts redundant metadata probes during view disk-limit enforcement by caching sizes of immutable v2 generation artifacts between passes, while keeping mutable SQLite files and markers freshly measured.

  • Immutable manifest-*, trigram-*, and derived-* sizes are reused across passes; SQLite files, pins, and markers are still measured each pass.
  • The cache invalidates on directory identity change (device, inode, mode, timestamps) plus a six-hour full reconciliation.
  • Project membership admission now skips metadata probes of excluded paths and non-regular files but keeps identical walker results, verified by old/new parity and lstat-count tests.
  • View-size caches live on the registry and drop with its last handle; new tests cover byte parity through changes and reconcile, eviction decisions, and cache lifetime.

Written for commit f234366. Summary will update on new commits.

View guided diff Turn on auto-fix

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with a non-blocking test isolation issue.

Findings

  1. P2 Global ignores break fixture tests ▶

Summary

This PR reduces repeated file metadata checks during disk-limit enforcement and project walks.

  • View disk checks reuse sizes for unchanged generation files.
  • Project walks skip metadata checks they do not need.

Both earlier, unnumbered threads were manually resolved without explanation. The current code addresses their original concerns: caches follow the registry's lifetime, and checkout-wide measurements no longer make exact assertions.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["Measure family"] --> B["Take registry-owned caches"]
  B --> C{"Directory changed or refresh due?"}
  C -->|Yes| D["Clear cached sizes"]
  C -->|No| E["Walk view directory"]
  D --> E
  E --> F["Reuse published artifact sizes"]
  E --> G["Measure mutable and uncached files"]
  F --> H["Check directory again"]
  G --> H
  H --> I["Keep only complete, stable cache entries"]
  I --> J["Return caches to registry"]
  J --> K["Apply disk budget"]
Loading

Reviews (2) · Last reviewed commit: "Gate Unix-only membership test helpers t..." · Reviewed by Greptile

Comment thread crates/aft/src/views/eviction.rs Outdated
Comment thread crates/aft/src/search_index.rs Outdated
ualtinok and others added 5 commits October 19, 2026 18:02
Keep mutable SQLite and marker files freshly measured while reusing immutable v2 generation artifact sizes with directory-identity invalidation and six-hour reconciliation. Preserve inode and symlink checks for live SQLite aliases; only eliminate provably redundant walker metadata probes.

Add old/new byte and membership parity fixtures, eviction and lstat-count tests, and a non-ranking search-quality descriptor. Existing test contracts are retained. Native macOS and linux,4c counter tests pass; detailed measurements and red controls are in the delivery record.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
…membership stat counts

View size caches now live on the shared registry inner (FamilyRegistry::view_size_caches)
instead of a process-global map keyed by registry path, so a closed family's caches
drop with its last registry handle. New test size_caches_drop_with_their_registry.

membership_checkout_stat_counts asserted exact paths and stat counts across walks of
the live working checkout, which an editor or concurrent job could break between walks.
The exact assertions moved to membership_walker_stat_counts on a private tempdir; the
live-checkout measurement remains as an #[ignore] benchmark that only prints counts.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
(cherry picked from commit ec9fca36d6b3666757fa18818237d3372fef9ddf)
On a real checkout the membership walker saves no lstat calls (the trimmed
probes only apply to excluded paths and special files a typical tree lacks).

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
The membership admission tests run on Unix only, so their stat-probe and
legacy-walker helpers were dead code under the Windows test build.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok force-pushed the land/views-fewer-stat-walks branch from ad5d788 to f234366 Compare October 19, 2026 16:18
Comment thread crates/aft/src/search_index.rs
@ualtinok
ualtinok added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit 396d0bf Oct 19, 2026
50 checks passed
jacobocasado pushed a commit to starredjaco/aft that referenced this pull request Oct 20, 2026
The drain tests read `lsp shutdown_all: servers=N` from the module's exit
phase. When the connection ends, the teardown used to quiesce every root
by detaching its clients to a per-root background reap thread. Each thread
waits 25 ms for Shutdown, then terminates its server. The exit phase then
found every manager empty (`phase=lsp_shutdown servers=0`) and counted
only the pids those threads had not reaped yet. If the main thread stalled
for about 100 ms after quiesce on a loaded runner, all servers were gone,
and the summary read `servers=0 ... elapsed_ms=0` (macOS integration
shard, main 396d0bf). The race dates from 83f7adb, the commit that
added the quiesce of root servers. cortexkit#588 and cortexkit#590 do not touch LSP
lifecycle.

Connection teardown now closes start admission but leaves the clients in
their managers (QuiescedLsp::LeaveForExitSweep). The exit phase in
run_subc_mode_inner takes them all under its one shared budget, as before.
A route goodbye during a session, and loop callers with no exit phase
behind them, keep the background reap (QuiescedLsp::ReapInBackground).

The drain test assertion goes from `servers >= 3` to exact equality: the
exit phase must take every root's server, and the summary must count all
of them. With ownership causal, the count no longer depends on timing.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
jacobocasado pushed a commit to starredjaco/aft that referenced this pull request Oct 20, 2026
Write .alfonso/release-notes/v0.61.0.md from the first-parent merges
since v0.60.0 plus the three queued PRs (cortexkit#588, cortexkit#590, cortexkit#578). Empty
next-notes.md and delete the next/ fragments that are on main; the three
queued branches' fragments are not on main and are left for their PRs.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
jacobocasado pushed a commit to starredjaco/aft that referenced this pull request Oct 20, 2026
…v0.61.0

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
jacobocasado pushed a commit to starredjaco/aft that referenced this pull request Oct 20, 2026
Rebase the release prep onto origin/main 3faaded and extend
.alfonso/release-notes/v0.61.0.md to cover the merges after cortexkit#590:
cortexkit#578, cortexkit#596, cortexkit#600, cortexkit#601, cortexkit#612, cortexkit#613, cortexkit#614, cortexkit#616, cortexkit#617, cortexkit#618, cortexkit#619, cortexkit#620,
cortexkit#622 and cortexkit#623. Fold and delete the 27 next/ fragments those merges added.
Credit cortexkit#465 (@null-axiom) and cortexkit#564 (@iceteaSA), and extend the cortexkit#577 line
with the shell timeout task-id fix.

Refresh ANNOUNCEMENT_FEATURES in both plugins. Pi leaves out the
OpenCode 2 permission line, which does not apply to Pi users.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
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.

1 participant