Parallelize per-file analysis with rayon (issue #1474) - #1482
Merged
Gbangbolaoluwagbemiga merged 1 commit intoAug 27, 2026
Merged
Conversation
…feD#1474) The issue's file pointer (tooling/sanctifier-cli/src/config.rs) doesn't exist in this repo -- no config.rs anywhere under sanctifier-cli/src. The actual "process multiple files... concurrently" opportunity described in the issue is analyze.rs's run_analysis(): a sequential `for file_path in &rs_files` loop running RuleRegistry::run_all, analyze_ledger_size, and scan_storage_collisions per file, each independent of the others. The file already had `#[allow(unused_imports)] use rayon::prelude::*;` -- rayon was already a declared dependency and imported here, just never used. Switched to `rs_files.par_iter().filter_map(...)`, mirroring the Arc<Analyzer> + par_iter pattern workspace.rs already uses for the same shape of per-file work. Registry and analyzer are now wrapped in Arc so they can be shared read-only across threads; each file's (violations, size_warnings, collisions) results are collected into a Vec first, then folded into the existing totals sequentially -- avoids needing a Mutex around the shared counters while keeping the final output (all_violations order aside) equivalent to the original sequential loop. Closes HyperSafeD#1474
|
@miraclesonly Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@miraclesonly is attempting to deploy a commit to the gbangbolaoluwagbemiga's projects Team on Vercel. A member of the Team first needs to authorize it. |
Gbangbolaoluwagbemiga
merged commit Aug 27, 2026
899467f
into
HyperSafeD:main
15 of 26 checks passed
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
#1474 — parallel processing
The issue's file pointer (
tooling/sanctifier-cli/src/config.rs) doesn't exist anywhere in thisrepo. The real "process multiple files concurrently" opportunity it describes is
analyze.rs'srun_analysis(): a sequentialfor file_path in &rs_filesloop runningRuleRegistry::run_all,analyze_ledger_size, andscan_storage_collisionsper file — eachindependent of the others. The file already had
#[allow(unused_imports)] use rayon::prelude::*;— rayon was already a declared dependency andimported here, just never actually used.
Switched to
rs_files.par_iter().filter_map(...), mirroring theArc<Analyzer>+par_iterpattern
workspace.rsalready uses for the identical shape of per-file work in this same crate.registry/analyzerare now wrapped inArcfor read-only cross-thread sharing; each file's(violations, size_warnings, collisions)are collected into aVecfirst, then folded into theexisting totals sequentially afterward — avoids needing a
Mutexaround the shared counters,and keeps the final output equivalent to the original sequential loop (aside from violation
ordering across files, which was never specified as significant).
Test plan
cargo check(tooling/sanctifier-cli): passes cleanly. Full workspace build, ~2m49s.Only warning is a pre-existing, unrelated dead-code warning in
sanctifier-core(
expr_contains_verifier), not touched by this change.Closes #1474
Closes #1476
Closes #1475
Closes #1478