Tests: skip preemptive inputs-only typecheck in compile verifier#269
Tests: skip preemptive inputs-only typecheck in compile verifier#269
Conversation
The verifier ran `swiftc -typecheck` twice per test: once on inputs alone, then again on inputs + generated output. The first pass existed purely to disambiguate failure attribution (fixture vs. generated code). Swap the ordering: run the combined pass first, and only re-run the inputs-alone pass as a diagnostic fallback when the combined pass fails. Green-path tests pay one subprocess instead of two. Measured on this machine with `time swift test --traits sourceBuild`: - Before: 842 tests in 19.49s - After: 842 tests in 11.71s (~40% wall-time reduction) Diagnostic messages are unchanged: a combined-pass failure still prints either "Test inputs failed to compile on their own" or "Generated code failed to compile alongside test inputs" depending on whether the fallback input-only pass also fails. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba09b9d091
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba09b9d091
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #269 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 41 41
Lines 6515 6515
=========================================
Hits 6515 6515 🚀 New features to boost your workflow:
|
Summary
swiftc -typechecktwice per test: once on inputs alone, then again on inputs + generated output. The first pass existed purely to disambiguate failure attribution (fixture vs. generated code).Why
Compile verification (added in #256) roughly doubled test-suite wall time. Most of that cost is the per-test
swiftcstartup — forking, loading the compiler, loading theSafeDIMacroscompiler plugin, typechecking under Swift 6 strict-Sendable. The input-only preemptive pass is paid on every test even though attribution only matters when something is broken.Measurements
Local
time swift test --traits sourceBuildon the same 842-test suite:Diagnostic behavior unchanged
Failure messages still read "Test inputs failed to compile on their own" vs. "Generated code failed to compile alongside test inputs" depending on whether the fallback input-only run also fails. Attribution only pays the extra subprocess when something is already broken.
Test plan
swift test --traits sourceBuild— 842 tests pass./CLI/lint.sh🤖 Generated with Claude Code