Skip to content

Commit 6fb2a8d

Browse files
committed
Fix bisect final report to use minimized fresh baseline
The final verification in bisect_and_report was comparing the minimized round result against the ORIGINAL fresh baseline (all files), producing misleading count diffs when Phase 2 reduced the indexed set. Now builds a fresh baseline from the minimized file set for accurate final reporting.
1 parent cc6587d commit 6fb2a8d

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

rust/rubydex/src/bin/incremental_test.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ fn bisect_and_report(
476476
delete_indices: &[usize],
477477
skip_file: &str,
478478
retries: usize,
479-
fresh_counts: &GraphCounts,
480479
) {
481480
// Phase 1: minimize deleted files
482481
let min_deleted = bisect_deleted_files(files, delete_indices, retries);
@@ -536,10 +535,19 @@ fn bisect_and_report(
536535
write_skip_file(skip_file, &final_skipped);
537536
println!("Skip file written to {skip_file}");
538537

538+
// Build fresh baseline from the minimized file set (not the original full baseline)
539+
let mut fresh_minimized = Graph::new();
540+
for &i in &indexed {
541+
let (ref uri, ref source, ref lang) = files[i];
542+
indexing::index_source(&mut fresh_minimized, uri, source, lang);
543+
}
544+
resolve(&mut fresh_minimized);
545+
let minimized_fresh_counts = GraphCounts::from_graph(&fresh_minimized);
546+
539547
// Final verification
540548
println!("\nFinal verification:");
541549
let final_result = run_round(files, &min_deleted, Some(&indexed), true, None);
542-
print_round_result(&final_result, fresh_counts);
550+
print_round_result(&final_result, &minimized_fresh_counts);
543551

544552
// Print the minimal reproduction
545553
let surviving: Vec<usize> = indexed.iter().copied().filter(|i| !min_deleted.contains(i)).collect();
@@ -733,7 +741,7 @@ fn main() {
733741
if args.skip_file.is_none() {
734742
println!("\nNo --skip-file specified, using {skip_path}");
735743
}
736-
bisect_and_report(&files, &delete_indices, skip_path, args.retries, &fresh_counts);
744+
bisect_and_report(&files, &delete_indices, skip_path, args.retries);
737745
break;
738746
}
739747
}
@@ -754,7 +762,7 @@ fn main() {
754762
if args.skip_file.is_none() {
755763
println!("\nNo --skip-file specified, using {skip_path}");
756764
}
757-
bisect_and_report(&files, &delete_indices, skip_path, args.retries, &fresh_counts);
765+
bisect_and_report(&files, &delete_indices, skip_path, args.retries);
758766
break;
759767
}
760768
}

0 commit comments

Comments
 (0)