Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit d87f834

Browse files
author
Hendrik van Antwerpen
committed
Check similarity against the extended paths, not the original
1 parent af5a406 commit d87f834

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

stack-graphs/src/cycles.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ where
141141
false
142142
}
143143

144+
#[cfg(feature = "copious-debugging")]
144145
pub fn max_bucket_size(&self) -> usize {
145146
self.paths.iter().map(|b| b.1.len()).max().unwrap_or(0)
146147
}

stack-graphs/src/partial.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2493,7 +2493,8 @@ impl PartialPath {
24932493
&new_path,
24942494
|ps, left, right| left.equals(ps, right),
24952495
) {
2496-
copious_debugging!(" * too many similar");
2496+
copious_debugging!(" * too many similar");
2497+
continue;
24972498
}
24982499
let mut new_cycle_detector = path_cycle_detector.clone();
24992500
new_cycle_detector.append(edges, extension);

stack-graphs/src/stitching.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@ impl PathStitcher {
623623
copious_debugging!(" is invalid: {:?}", err);
624624
continue;
625625
}
626+
copious_debugging!(" is {}", new_path.display(graph, paths));
626627
new_cycle_detector.append(&mut self.appended_paths, extension.into());
627628
let cycles = new_cycle_detector
628629
.is_cyclic(graph, partials, db, &mut self.appended_paths)
@@ -637,13 +638,12 @@ impl PathStitcher {
637638
if self.similar_path_detector.has_similar_path(
638639
graph,
639640
paths,
640-
&path,
641+
&new_path,
641642
|ps, left, right| left.equals(ps, right),
642643
) {
643644
copious_debugging!(" is invalid: too many similar");
644645
continue;
645646
}
646-
copious_debugging!(" is {}", new_path.display(graph, paths));
647647
self.next_iteration.0.push_back(new_path);
648648
self.next_iteration.1.push_back(new_cycle_detector);
649649
}
@@ -966,6 +966,7 @@ impl ForwardPartialPathStitcher {
966966
copious_debugging!(" is invalid: {:?}", err);
967967
continue;
968968
}
969+
copious_debugging!(" is {}", new_partial_path.display(graph, partials));
969970
new_cycle_detector.append(&mut self.appended_paths, extension.into());
970971
let cycles = new_cycle_detector
971972
.is_cyclic(graph, partials, db, &mut self.appended_paths)
@@ -980,14 +981,13 @@ impl ForwardPartialPathStitcher {
980981
if self.similar_path_detector.has_similar_path(
981982
graph,
982983
partials,
983-
&partial_path,
984+
&new_partial_path,
984985
|ps, left, right| left.equals(ps, right),
985986
) {
986987
copious_debugging!(" is invalid: too many similar");
987988
continue;
988989
}
989990
}
990-
copious_debugging!(" is {}", new_partial_path.display(graph, partials));
991991
self.next_iteration.0.push_back(new_partial_path);
992992
self.next_iteration.1.push_back(new_cycle_detector);
993993
}

0 commit comments

Comments
 (0)