-
Notifications
You must be signed in to change notification settings - Fork 2.3k
perf(forge): parallelize stateless fuzzing #12713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…es that provided in new coverage
…tore the workers id that found the failure
…cally to prevent going over max_runs
…when not in tokio
6f9f793 to
178f82a
Compare
178f82a to
e803c4a
Compare
- Unified CorpusEntry constructors with internal _new method taking
Option<PathBuf> to eliminate code duplication between new and
from_tx_seq.
- Extracted common helper methods in WorkerCorpus:
- can_replay_tx: static helper to check if tx can be replayed,
replacing 2 duplicate closures.
- file_extension: returns appropriate file extension based on gzip
config, replacing 3 duplicated patterns.
- Simplified directory initialization using functional map pattern
instead of nested if-let, and removed unnecessary is_dir checks
before create_dir_all calls.
- Improved parse_corpus_filename by replacing rsplitn + collect with
rsplit_once for better efficiency and added proper error message for
invalid format.
- Removed unused uuid field from CorpusDirEntry struct, fixing clippy
dead_code warning.
- Reordered early returns in export method to check master worker
first for more logical flow.
9a73821 to
3df9d00
Compare
| counterexample: (calldata, call), | ||
| breakpoints, | ||
| })) | ||
| rayon::current_num_threads() as u32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unclear to me if this would be 0 if threads config is omitted
foundry/crates/cli/src/opts/global.rs
Lines 67 to 69 in a78c89f
| if self.threads.is_some() { | |
| self.force_init_thread_pool()?; | |
| } |
If it's all available threads, I'm wondering if it may exacerbate issues like this #12397. Would it make sense to take memory into account and lower the thread count accordingly or default to a lower num?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it would, the default is number of threads. i don't think this would have memory issues more than the current implementation, but it does exacerbate storage instead since we never prune anything
Closes #8898.
Continuation of #11769 + #11842. See these PRs for more details.