Add target-aware process-isolated analyzer scheduling - #6902
Open
dpearson2699 wants to merge 1 commit into
Open
Conversation
Generated by 🚫 Danger |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
swiftlint analyzecurrently treats a compiler log as one workload. Large workspaces have no supported way to schedule analyzer work by target or split rules that can safely process requested source subsets.This pull request adds an opt-in, versioned target-plan mode:
--target-plandescribes each target, its complete source inventory, compilation database, configured analyzer rules, and requested-source batches.--jobssets one global process limit.--execution-evidencewrites a versioned record of the completed run.Existing
swiftlint analyzebehavior is unchanged when no target plan is supplied.Rule safety
Collecting analyzer rules always run as whole-target jobs. Other rules can use batches only when they adopt the package-only batching capability.
unused_importis the only initial adopter and accepts at most 32 requested files per job.A batched worker still receives the complete target source inventory and compilation database. The coordinator validates ordered batch coverage and rejects missing, overlapping, duplicate, extra, or unsupported batches.
Relationship to #6886
Related to #3020.
#6886 serializes analyzer rule scheduling inside the existing invocation. This pull request addresses a different layer: bounded process isolation across explicit targets and safe batches. It does not include the commits from #6886.
Qualification
On the downstream qualification workload,
--jobs 1and--jobs 4produced the same 304 findings with identical reporter output. The four-job run reduced wall time by 69.3% in that paired measurement. This is one workload measurement, not a general SwiftLint benchmark.Validation
swift test --filter AnalyzerProcessCoordinatorTests(23 tests)swift test --filter CollectingRuleTests(4 tests)swift test --filter LintOrAnalyzeOptionsTests(1 test)swift test --no-parallel(1,110 tests in 375 suites)swift run swiftlint lint --strict(0 violations across 714 files)xcodebuild -scheme swiftlint test -destination 'platform=macOS'make bazel_test(19 test targets)