You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(ci): overlap Bun typechecking and skip redundant alias scans - #27382
Pull request checks spend less time waiting for typechecking to start. CI uses the measured faster compiler and runs it alongside the remaining independent checks, while local checks keep their fast incremental compiler.
What Changed
Patch two anti-slop rules to skip alias scans when the relevant keyword is absent. Unicode escapes still take the full scan, and per-file state is reset. The dependency stays pinned to the same upstream commit.
Add typecheck:ci using Bun 1.4.3 and the same four explicit project configurations. Run projects sequentially, start after the type-aware and changed-code gates, and join before admitting downstream jobs. Keep native TypeScript for local checks and package declarations. Remove the unused native CI build-state cache and warmer. Run the process import guard under Bun and anti-slop under Bun’s smaller-heap mode in CI.
Keep an opt-in ARM comparison workflow with counterbalanced timings, peak memory, file-list checks, intentional compiler errors, upstream rule fixtures, and success/error checks for the real lint and import-guard CLIs. A compiler-version guard prevents silently checking a package against a different TypeScript version.
Why
The linked job started compilation 113 seconds into a 156-second job. Historical combined jobs had a 206-second median. On the same four-core ARM checkout, four paired measurements showed:
Check
Before
After
Anti-slop alias scan
33.656s
30.819s
Cold native versus Bun typecheck
73.797s
47.970s
Import guard, Node versus Bun
21.418s
14.306s
Native warm typechecking took 7.545s, so local commands retain it. Paired Bun projects offered no useful gain over sequential projects. Bun reduced the main compiler's peak memory from about 12 GiB to 1.5 GiB, allowing overlap with the remaining checks.
Four paired measurements of the concurrent early phase dropped from 39.331s to 26.548s using the alias patch, Bun’s smaller-heap mode for anti-slop, and Bun for the import guard. Anti-slop peaked at 1.9–2.1 GiB in those concurrent runs. Isolated runs can still reach 9 GiB; the flag is not a hard memory limit, and the compiler starts only after this phase ends. Oxlint's combined typecheck was investigated too; its different project scope produced 413 diagnostics on an otherwise passing checkout, so it cannot replace these checks directly.
Automated tests added/updated, or explained why not below
Frozen installs succeed. The upstream modified-rule fixtures pass. Local native/Bun source lists and exact negative diagnostics match for all four real project configurations. Tests cover compiler failures continuing to later projects, memory admission, compiler-version mismatch, phase selection, and downstream failure gates; 215 focused workflow/cache/runner/import-parser tests passed locally, followed by 56 tests covering the final runtime wiring. Native pnpm tc and the Bun CI command both pass locally.
The corrected ARM comparison passed both jobs: project file lists agree after normalizing standard-library names, intentional errors agree, and lint/import-guard success/error fixtures pass. A second runner reproduced the compiler gain: native cold 85.633s versus Bun 57.304s; fresh native incremental state 7.626s. The final comparison adds return-type, strict-null and implicit-any probes under each config's actual settings and checks the smaller-heap CLI's invalid fixture too.
The observed final job is 30% shorter; after setup it is 32% shorter. These are individual complete-job runs, with some setup/runner variation; the isolated compiler and early-phase comparisons use four counterbalanced pairs. The final full CI run and expanded comparison passed on the same head. Native cold versus Bun medians were 77.283s versus 48.681s; fresh native incremental checking took 7.428s. The expanded probes produced matching diagnostic lists in all four projects, and the Node/Bun/smaller-heap invalid lint fixture passed. Artifacts retain raw timings and memory records for 30 days.
The initial compiler harness completed its timing samples, then failed because disk and embedded standard-library paths were compared literally. The corrected ARM run above verifies the fix; no compiler mismatch was found.
Review
Subprocesses use the existing cross-platform process host. The normal local compiler, package declaration compiler, unit-test Bun pin, and remote execution behavior are unchanged. CI-only Bun 1.4.3 matches the installed TypeScript 7.0.2; upgrades require another parity comparison. The background compiler retains selected-phase/prior-success guards and a required join, so a type error still fails preflight.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
nwparker
changed the title
perf(ci): reduce static analysis and measure Bun typechecking
perf(ci): overlap Bun typechecking and skip redundant alias scans
Oct 11, 2026
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
📝 Walkthrough
📝 Walkthrough
Walkthrough
PR preflight now runs Bun-based typechecking as a background step and removes TypeScript incremental-state caching. New benchmark scripts compare native and Bun typechecking and measure static-analysis variants. New workflow jobs run the benchmarks and upload their reports. The anti-slop rules now skip type-alias environment creation under specified source guards.
Priority: ⬇️ Low
Merge Risk:⚪ Minimal · up to ab87c
No actionable merge-blocking issue was established. The preflight failure gate’s runner behavior remains unverified.
Pre-merge checks | 3 | 2
❌ Failed checks (2 warnings)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 7 files. (6 skipped: 6…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check
The description is detailed and covers the change, rationale, testing, review considerations, and checklist. However, the Linked Issue section references an Actions run and PR number instead of linkin…
Add a direct link to the actual GitHub issue under Linked Issue and use the required issue reference format, such as Fixes #<issue-number>. Keep the existing testing and implementation details.
✅ Passed checks (3 passed)
Check name
Status
Explanation
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Title check
The title clearly summarizes the two primary changes: overlapping Bun typechecking in CI and skipping redundant alias scans.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 7 files. (6 skipped: 6 unsupported.)
Full details: Description check
Explanation
The description is detailed and covers the change, rationale, testing, review considerations, and checklist. However, the Linked Issue section references an Actions run and PR number instead of linking an actual issue as required by the template.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Pull request checks spend less time waiting for typechecking to start. CI uses the measured faster compiler and runs it alongside the remaining independent checks, while local checks keep their fast incremental compiler.
What Changed
Patch two anti-slop rules to skip alias scans when the relevant keyword is absent. Unicode escapes still take the full scan, and per-file state is reset. The dependency stays pinned to the same upstream commit.
Add
typecheck:ciusing Bun 1.4.3 and the same four explicit project configurations. Run projects sequentially, start after the type-aware and changed-code gates, and join before admitting downstream jobs. Keep native TypeScript for local checks and package declarations. Remove the unused native CI build-state cache and warmer. Run the process import guard under Bun and anti-slop under Bun’s smaller-heap mode in CI.Keep an opt-in ARM comparison workflow with counterbalanced timings, peak memory, file-list checks, intentional compiler errors, upstream rule fixtures, and success/error checks for the real lint and import-guard CLIs. A compiler-version guard prevents silently checking a package against a different TypeScript version.
Why
The linked job started compilation 113 seconds into a 156-second job. Historical combined jobs had a 206-second median. On the same four-core ARM checkout, four paired measurements showed:
Native warm typechecking took 7.545s, so local commands retain it. Paired Bun projects offered no useful gain over sequential projects. Bun reduced the main compiler's peak memory from about 12 GiB to 1.5 GiB, allowing overlap with the remaining checks.
Four paired measurements of the concurrent early phase dropped from 39.331s to 26.548s using the alias patch, Bun’s smaller-heap mode for anti-slop, and Bun for the import guard. Anti-slop peaked at 1.9–2.1 GiB in those concurrent runs. Isolated runs can still reach 9 GiB; the flag is not a hard memory limit, and the compiler starts only after this phase ends. Oxlint's combined typecheck was investigated too; its different project scope produced 413 diagnostics on an otherwise passing checkout, so it cannot replace these checks directly.
Linked Issue
Investigation of the preflight job for #27330.
Visual Proof
N/A — CI tooling only.
Testing
Frozen installs succeed. The upstream modified-rule fixtures pass. Local native/Bun source lists and exact negative diagnostics match for all four real project configurations. Tests cover compiler failures continuing to later projects, memory admission, compiler-version mismatch, phase selection, and downstream failure gates; 215 focused workflow/cache/runner/import-parser tests passed locally, followed by 56 tests covering the final runtime wiring. Native
pnpm tcand the Bun CI command both pass locally.The corrected ARM comparison passed both jobs: project file lists agree after normalizing standard-library names, intentional errors agree, and lint/import-guard success/error fixtures pass. A second runner reproduced the compiler gain: native cold 85.633s versus Bun 57.304s; fresh native incremental state 7.626s. The final comparison adds return-type, strict-null and implicit-any probes under each config's actual settings and checks the smaller-heap CLI's invalid fixture too.
The observed final job is 30% shorter; after setup it is 32% shorter. These are individual complete-job runs, with some setup/runner variation; the isolated compiler and early-phase comparisons use four counterbalanced pairs. The final full CI run and expanded comparison passed on the same head. Native cold versus Bun medians were 77.283s versus 48.681s; fresh native incremental checking took 7.428s. The expanded probes produced matching diagnostic lists in all four projects, and the Node/Bun/smaller-heap invalid lint fixture passed. Artifacts retain raw timings and memory records for 30 days.
The initial compiler harness completed its timing samples, then failed because disk and embedded standard-library paths were compared literally. The corrected ARM run above verifies the fix; no compiler mismatch was found.
Review
Subprocesses use the existing cross-platform process host. The normal local compiler, package declaration compiler, unit-test Bun pin, and remote execution behavior are unchanged. CI-only Bun 1.4.3 matches the installed TypeScript 7.0.2; upgrades require another parity comparison. The background compiler retains selected-phase/prior-success guards and a required join, so a type error still fails preflight.
Agent skill upstream boundary
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)