Repository navigation
perf(cli): parallelize multi-file analysis and harden release gates - #146
Merged
Merged
Conversation
Migrate ~257 CLI report commands from a serial per-file read/parse/analyze loop to the shared analyze_files/analyze_files_raw helper in packages/core/cli/src/shared.rs, which schedules work across all cores via std::thread::scope with a work-stealing atomic cursor (largest-file-first claim order), falling back to a serial iterator below an 8-file threshold. lint-* crates' report builders return LintError, and the package crate's return PackageRefactorError, neither of which implements From<CliError> by design (an intentional one-way layering boundary: core crates must not depend on the CLI error type). Those ~245 files use analyze_files_raw, whose closure owns its own read and converts errors via the existing one-way From impl, instead of weakening that boundary.
…rmed-safe size CI's benchmark gate caught a real regression: cache-dir/warm/128 (8 directories, right at the old PARALLEL_VALIDATION_THRESHOLD of 8) was ~37% slower than the serial path, confirmed with a lower confidence bound of +36.5% — thread-spawn overhead dominating a handful of single-syscall stat checks. warm/1024 (64 directories) was genuinely ~28% faster, confirming the parallel path pays off at that scale. Raise the threshold to 64, the larger of the two confirmed points, rather than guess at the crossover between them.
takeokunn
force-pushed
the
feat/rust-zero-cost-hardening
branch
from
August 30, 2026 01:24
b99443a to
e4f2d1c
Compare
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
analyze_files/analyze_files_rawpath, using scoped workers and deterministic result ordering.main, adapt callbacks to the owned-path API, and satisfy the current release verification gates without weakening tests or configuration.Verification
nix develop -c cargo clippy --workspace --all-targets --all-features -- -D warningsnix develop -c cargo fmt --all -- --checkgit diff --checkBenchmark gate evidence
The advisory benchmark job failed twice on non-overlapping benchmark families. A local control comparison using the identical commit (
e4f2d1c5) on both sides also reported 8/36 regressions, up to +50.9%. This demonstrates fixed-order machine drift in the comparison harness rather than a code regression. The benchmark threshold, tests, and CI configuration were not weakened.Notes
The two local full-flake attempts failed in different benchmark-style timing assertions under whole-suite parallel load. Each exact test passed immediately in isolation.