Skip to content

perf: read GC worktree discovery asynchronously - #3802

Merged
janicduplessis merged 1 commit into
mainfrom
perf/3799-async-gc-worktree-discovery
Oct 14, 2026
Merged

janicduplessis merged 1 commit into
mainfrom
perf/3799-async-gc-worktree-discovery

Conversation

@janicduplessis

Copy link
Copy Markdown
Collaborator

Description

GC still blocks on Git worktree discovery while collecting candidates and measuring build state. These reads prevent a responsive in-process report for Desktop.

Fixes #3799. Other blocking probes and cancellation remain under #3546.

Solution

Use the existing bounded async Git inventory and source-checkout selector for report paths. Preserve sorting, source-checkout refusals and containment checks. Inventory timeouts kill only the probe child; the non-measuring maintenance policy keeps its synchronous discovery.

Test plan

Four regressions fail against the original collector and pass here. Real Git behind delayed child processes verifies responsiveness during candidate discovery, classification, build-state measurement and unlisted-directory inspection. A child ignoring SIGTERM is terminated at the existing deadline without producing unlisted deletion candidates. Existing worktree and maintenance cases check removal guards and reported sizes.

@janicduplessis janicduplessis left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent correctness review of a712995 against b2541a2: clear, with no actionable findings.

Checked the full diff, issue #3799, candidate sorting/deduplication, source and bare checkout refusals, canonical containment, inventory failure handling, and the unchanged removal-time ownership and HEAD rechecks. The async selector uses the same parser and source decision function; inventory failure remains a refusal and does not yield unlisted candidates. SIGKILL is confined to the spawned inventory/read child at the existing timeout, with no ownership expansion.

Independently ran the new real-child discovery/measurement/timeout probes and the worktree parser/source-selection suite: 59 passed across two files in 7.16 seconds. These cover the changed inventory paths, not completion of all report cancellation or remaining synchronous probes. The PR description states that remaining scope accurately. No new user-facing flags or destructive decisions require guidance changes. No human-review trigger applies to this diff.

@janicduplessis janicduplessis added area: cli packages/stim-cli, including its README and guide review: ai-approved A fresh AI review found nothing left to fix labels Oct 14, 2026
@janicduplessis
janicduplessis marked this pull request as ready for review October 14, 2026 13:34
@janicduplessis
janicduplessis added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit 977c03a Oct 14, 2026
29 of 34 checks passed
@janicduplessis
janicduplessis deleted the perf/3799-async-gc-worktree-discovery branch October 14, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli packages/stim-cli, including its README and guide review: ai-approved A fresh AI review found nothing left to fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GC: read worktree discovery asynchronously for reports

1 participant