Skip to content

Tests: skip preemptive inputs-only typecheck in compile verifier#269

Merged
dfed merged 1 commit intomainfrom
claude/verifier-skip-input-only-preemptive
Apr 20, 2026
Merged

Tests: skip preemptive inputs-only typecheck in compile verifier#269
dfed merged 1 commit intomainfrom
claude/verifier-skip-input-only-preemptive

Conversation

@dfed
Copy link
Copy Markdown
Owner

@dfed dfed commented Apr 20, 2026

Summary

  • 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 re-run the inputs-alone pass only as a diagnostic fallback when the combined pass fails. Green-path tests pay one subprocess instead of two.

Why

Compile verification (added in #256) roughly doubled test-suite wall time. Most of that cost is the per-test swiftc startup — forking, loading the compiler, loading the SafeDIMacros compiler 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 sourceBuild on the same 842-test suite:

  • Before: 19.49s
  • After: 11.71s (~40% wall-time reduction)

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

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>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread Tests/SafeDIToolTests/Helpers/SafeDICompileVerifier.swift
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread Tests/SafeDIToolTests/Helpers/SafeDICompileVerifier.swift
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a3395a0) to head (ba09b9d).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #269   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           41        41           
  Lines         6515      6515           
=========================================
  Hits          6515      6515           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dfed dfed merged commit 92bbcd7 into main Apr 20, 2026
17 checks passed
@dfed dfed deleted the claude/verifier-skip-input-only-preemptive branch April 20, 2026 05:12
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