Skip to content

Speed up daemon smoke checks and keep compiler slots busy - #28106

Merged
nwparker merged 3 commits into
mainfrom
nwparker/preflight-critical-path
Oct 13, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/preflight-critical-path

Conversation

@nwparker

@nwparker nwparker commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

The static analysis job repeats a CLI build and leaves a compiler slot idle when one project finishes before its partner. This change removes that repeated build and lets the free slot take the next project.

What Changed

  • The Orcad terminal smoke uses the CLI and pinned Node already shipped in its daemon package. It no longer runs a separate TypeScript CLI build and rejects a missing packaged CLI rather than falling back to stale output.
  • Bun fills free compiler slots immediately, with the same memory admission, two-process limit, two threads per process, four projects and compiler-version guard. Failed projects still report in project order and do not prevent the remaining checks.
  • The synchronous-launch ratchet still parses every file and rejects malformed syntax. Files without relevant spellings skip parent links and traversal; escaped spellings and inherited module paths keep the full analysis.
  • A type-only extraction of the HTML preview props fixes an existing main-branch line-limit failure. The component emits identical JavaScript.
  • A separate benchmark workflow compares each change in four counterbalanced pairs on ARM CI runners and retains timings and result checks.

Why

Recent production runs show that foreground checks now expose typechecking near the end of the job. Removing repeated work and idle slots addresses that delay while keeping the existing checks and compiler limits.

Linked Issue

Follow-up to #27727.

Visual Proof

N/A — CI scripts and a type-only renderer extraction that emits identical JavaScript.

Testing

  • 172 targeted tests pass, including compiler admission, continued checking after failures, freed slots, escaped imports, malformed syntax and packaged CLI selection.
  • Native pnpm tc passes.
  • The full packaged-daemon smoke passes locally on macOS: pairing, worktree creation, terminal output and execution-host CLI round trips.
  • Changed-code quality passes.
  • Full lint, the native typecheck and all normal PR checks pass, including Windows packaging, five unit shards, Electron checks and cross-platform persistence/native compatibility checks.
  • Four counterbalanced pairs per check on a four-core, 16 GB ARM runner with Bun 1.4.3:
    • Daemon build and terminal smoke: 21.47s → 15.95s. Both versions pass all pairing, worktree and terminal assertions in every run.
    • Typechecking: 52.62s → 48.14s. Same four projects, compiler, process limit and threads; all eight suites pass.
    • Sync-launch scan: 3.64s → 3.11s. Identical counts and symbols across all 8,055 production files; both reject malformed syntax.
  • Four full preflight replays use frozen source ea44810149e9c68e2718163aeffe83eff96efa6e, baseline 845b723258c0502365ef8ea29392a3badc8cbeae, and fresh ARM runners in before/after/after/before order. All four pass every desktop check and produce identical unit-selection artifacts.

Full-job measurements exclude queueing. Before: 166s, 190s; after: 170s, 164s. Medians are 178s → 167s including setup, or 142s → 133s after setup. Only two fresh runners per arm and noticeable runner variance: these are directional results, not a promised fixed percentage.

The baseline replay exposes its existing CLI resolver solely so the shared new test's static import remains valid; that export does not alter the old client behavior. Both arms prepare their implementations after the same immutable dependency installation. Both arms run the same complete desktop check set and select the same 11,982 test files in five shards.

Review

The packaged CLI uses the existing artifact paths and bundled Node resolver on macOS, Linux and Windows. Local native typechecking keeps its existing scheduler. The daemon smoke continues to exercise the public paired-server API.

Agent skill upstream boundary

  • Not applicable; no upstream skill sources copied.

Checklist

  • Focused on the static analysis job.
  • Before/after behavior, mechanism and alternatives explained.
  • No UI change requiring screenshots.
  • Cross-platform paths, remote pairing and memory bounds considered.
  • Targeted local validation passed; full PR validation runs in CI.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 792f4b87-c9d6-487e-9656-81eb4cd474b6
📥 Commits

Reviewing files that changed from the base of the PR and between a1c94a9 and ea44810.

📒 Files selected for processing (4)
  • config/scripts/run-typecheck-bun-queue.test.mjs
  • config/scripts/run-typecheck-projects-in-parallel.mjs
  • src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.tsx
  • src/renderer/src/components/browser-pane/workspace-doc/html-doc-preview-props.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

📝 Walkthrough

Walkthrough

The pull request adds a CI workflow and script for comparing preflight critical-path runs. It changes sync-spawn analysis to gate TypeScript analysis by source markers. It changes Bun typecheck scheduling to use a shared worker pool and adds queue tests. It updates terminal smoke CLI selection and cleanup by runtime target, adds resolution tests, and removes a CLI build step from the OrcaD smoke command. It also adds a shared props type for the HTML document preview component.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to ea448

No actionable issue remains identified; the change is mergeable after normal checks.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 9 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title is concise and accurately summarizes the main performance changes: faster daemon smoke checks and improved compiler-slot utilization.
Description check Passed The description is detailed, relevant, and covers the required change summary, rationale, testing, visual proof, review notes, and checklist. It references issue #27727, but the template requires an a…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@nwparker
nwparker force-pushed the nwparker/preflight-critical-path branch from a1c94a9 to ea44810 Compare October 12, 2026 23:54
@nwparker
nwparker merged commit c8996d7 into main Oct 13, 2026
47 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.

1 participant