Repository navigation
perf(storage): reuse one consumer walk per worktree per inventory - #673
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Dependency and build removal proofs asked the same fresh process inventory about a worktree and about its node_modules or output root separately, and each question re-walked its whole target tree. A nested root is now answered from the worktree walk of the same inventory, after its directory tokens are revalidated, and repeated inventory paths are resolved once per query. Removal proofs still capture a fresh inventory and never use the sweep's observation. Carry-Group: incubator Carry-Observation: Removal guards create one target observation per fresh capture and query the worktree before its nested root; realpath results are not reused across queries because a later unresolved path must still fall back to identity proof. Co-Authored-By: Claude <[email protected]>
Querying the worktree first meant a failed worktree-wide walk skipped both node_modules use checks, so a consumed install kept an old usage clock. Carry-Group: incubator Co-Authored-By: Claude <[email protected]>
|
@codex review |
4f182d3 to
e86a0b5
Compare
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Closing and reopening only to start a fresh CI run: reruns of run 42669616868 left earlier jobs abandoned, so its Check gate could not pass on this head. |
Storage cleanup's consumer proof re-walked the same trees within one process inventory. On a 356-worktree sweep,
WorktreeConsumers.processPathsUseRootdominated the time. When a captured file can't be resolved by name, which is normal for deleted-but-open files, each query does a full no-followlstatwalk of its target.GeneratedDependencies.removeBatchasked the same fresh inventory about<worktree>/node_modulesand then about the whole worktree, walking both. The final guards then repeated this for each fresh capture. Each query also ranrealpathon every inventory path, about 11.8k paths of which only about 4k were unique.Changes:
TargetObservation(keyed by inventory), a query for a root nested in an already-walked root is answered from that walk. The nested subtree's directory tokens and the root's canonical path are revalidated first. The answer matches a fresh walk: a successful ancestor walk visited every object a nested walk would, on the same device and within the same limits. If no ancestor walk is usable, the root is walked as before.realpathdeduped within each query. Results are not reused across queries: an existing test requires a path that becomes unresolvable later to fall back to identity proof.Proof: new tests count walks per capture in
WorktreeConsumers,GeneratedDependenciesandGeneratedBuilds. They fail onlastcode/mainand pass here. The usage-recording test failed before its fix. Focused suites pass (389 tests);check:changedpasses apart from the base-branchLegacyFeaturesSectionknip failure being fixed in #671; local Quick CI passed.Follow-up: F1. Deduping
realpathwithin one query can, in a sub-second race, skip re-resolving a duplicate name that changed between its entries. The reviewer rated it a nit, and I declined it.Local review: 2 rounds with gpt-6.1-terra (xhigh), approved.
🤖 Generated with Claude Code