Skip to content

simplify(diagnostics): share daemon compiler admission and bounds - #4546

Open
ScriptedAlchemy wants to merge 3 commits into
simplify/diagnostics-project-compiler-statusfrom
simplify/diagnostics-compiler-admission
Open

ScriptedAlchemy wants to merge 3 commits into
simplify/diagnostics-project-compiler-statusfrom
simplify/diagnostics-compiler-admission

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Why

Each producer had its own four-child compiler pool and effectively unlimited subprocess capture. Concurrent project producers did not share their child capacity.

What changed

  • Mount one compiler admission in the daemon generation and reuse the installed background CPU authority. Keep both permits until the existing child supervisor settles.
  • Replace eager per-run semaphore tasks with a bounded lazy stream. Close queued and running work with daemon admission.
  • Refuse checks after 20 minutes, 64 MiB stdout, or 1 MiB stderr. Preserve typed failures, partial findings, generation reuse, and cancellation on drop.

Scope

Fixes #4439. Parent link is #4545 on simplify/diagnostics-project-compiler-status.
The project-owned status cutover remains intact. Compiler-owned configuration evidence in #4440 and operation retirement in #4403 remain separate links. This change does not modify #4524.

Tradeoffs

The existing background CPU authority meters active compiler work. A daemon-owned semaphore additionally bounds live compiler children without another scheduler or a process-global registry. No RSS reduction or production budget calibration is claimed.

Blast Radius

Automatic project-pinned TypeScript diagnostics now share daemon admission. A stalled or excessive-output compiler fails rather than publishing clean evidence. Retrieval still reads generation-bound publications without running a compiler.

Verification

  • Bazel LSP compiler tests passed 25, including wait/run cancellation, child settlement, stdout and stderr refusal, and 1,000 valid findings. Formatting passed for all affected crates.
  • Bazel application producer/publication/store/availability tests passed 37. Three isolated producers performed nine checks under the shared four-child limit and retained partial findings.
  • Bazel supervisor and CPU tests passed 16. Daemon shutdown tests passed 3. Scoped Clippy passed for all three affected unit targets with warnings denied. The macOS test link reported existing unwind-size warnings.

Devin Review

Share compiler child capacity across admitted project producers and
charge active children to the installed background CPU authority.
Keep permits with the bounded runner through cancellation and reap.

Replace eager per-run semaphore tasks with a bounded lazy stream.
Refuse deadline and output overruns instead of publishing clean reports.
Close queued and running compiler work when daemon admission closes.

Verify isolated producer limits, wait/run cancellation, output refusal,
large valid reports, generation reuse, and daemon shutdown through Bazel.
@changeset-bot

changeset-bot Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c7bd31b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Independent source review at exact head e38c25d19a780067d4712268900854d7b7eaadd5 found two lifecycle gaps. This is not a runtime reproduction or a CI failure attribution.

  1. Windows discovery selects tsc.cmd. The existing bounded runner kills/reaps only the direct wrapper, so its Node descendant can outlive cancellation, deadline or output refusal. Releasing compiler/CPU permits after that return does not establish actual compiler termination.
  2. Dropping the async producer cancels its child token, but the detached blocking runner has no terminal join in project shutdown ownership. A project can report clean while queued or running compiler cleanup remains unsettled.

A separate correction worker is now implementing actual compiler supervision and project-owned terminal settlement with deterministic regressions. The dependent #4440 publication is held until the correction is reviewed and verified. No timeout increase, higher capacity, clean empty result, or branch rewrite is proposed. The existing local test report is preserved, but does not discharge these untested lifetime boundaries.

This branch has not been deployed

No deployments
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