Skip to content
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

Fixed a rare non-determinism in the AdaptiveChainPruner #7851

Merged
merged 1 commit into from
May 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ private Collection<Path<V,E>> likelyErrorChains(final List<Path<V, E>> chains, f
// Note that chains can we added twice to the queue, once for each side
final PriorityQueue<Pair<Path<V,E>, Double>> chainsToAdd = new PriorityQueue<>(
Comparator.comparingDouble((Pair<Path<V,E>, Double> p) -> -p.getRight())
.thenComparing((Pair<Path<V,E>, Double> p) -> p.getLeft().getFirstVertex().getSequence(), BaseUtils.BASES_COMPARATOR));
.thenComparing((Pair<Path<V,E>, Double> p) -> p.getLeft().getFirstVertex().getSequence(), BaseUtils.BASES_COMPARATOR)
.thenComparing((Pair<Path<V,E>, Double> p) -> p.getLeft().getBases(), BaseUtils.BASES_COMPARATOR)); // Handle rare edge case for non-determinism where two chains with equivalent score start on the same vertex

// seed the subgraph of good chains by starting with some definitely-good chains. These include the max-weight chain
// and chains emanating from vertices with two incoming or two outgoing chains (plus one outgoing or incoming for a total of 3 or more) with good log odds
Expand Down