@@ -344,11 +344,16 @@ impl FuzzedExecutor {
344344 result. success = true ;
345345 result. traces = last_run_worker. traces . last ( ) . cloned ( ) ;
346346 result. breakpoints = last_run_worker. breakpoints . clone ( ) ;
347+ if !self . config . show_logs {
348+ result. logs = last_run_worker. logs . clone ( ) ;
349+ }
347350 }
348351
349352 for mut worker in workers {
350353 result. gas_by_case . append ( & mut worker. gas_by_case ) ;
351- result. logs . append ( & mut worker. logs ) ;
354+ if self . config . show_logs {
355+ result. logs . append ( & mut worker. logs ) ;
356+ }
352357 result. gas_report_traces . extend ( worker. traces . into_iter ( ) . map ( |t| t. arena ) ) ;
353358 HitMaps :: merge_opt ( & mut result. line_coverage , worker. coverage ) ;
354359 result. deprecated_cheatcodes . extend ( worker. deprecated_cheatcodes ) ;
@@ -407,6 +412,7 @@ impl FuzzedExecutor {
407412 std:: cmp:: max ( 1 , self . config . gas_report_samples / num_workers as u32 ) ;
408413
409414 let worker_runs = self . runs_per_worker ( worker_id) ;
415+ debug ! ( worker_runs) ;
410416
411417 let mut runner_config = self . runner . config ( ) . clone ( ) ;
412418 runner_config. cases = worker_runs;
@@ -610,6 +616,8 @@ impl FuzzedExecutor {
610616 let n = self . num_workers ( ) as u32 ;
611617 let runs = total_runs / n;
612618 let remainder = total_runs % n;
619+ // Distribute the remainder evenly among the first `remainder` workers,
620+ // assuming `worker_id` is in `0..n`.
613621 if worker_id < remainder { runs + 1 } else { runs }
614622 }
615623}
0 commit comments