Skip to content

Commit 77a432e

Browse files
committed
clusterlin tests: count SimpleCandidateFinder iterations better
Only count the number of actual new subsets added. If the queue contains a work item that completely covers a component, no transaction can be added to it without creating a disconnected component. In this case, also don't count it as an iteration. With this, the number of iterations performed by SimpleCandidateFinder is bounded by the number of distinct connected topologically-valid subsets of the cluster.
1 parent 2def858 commit 77a432e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/fuzz/cluster_linearize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class SimpleCandidateFinder
6464
SetInfo best(m_depgraph, m_todo);
6565
// Process the queue.
6666
while (!queue.empty() && iterations_left) {
67-
--iterations_left;
6867
// Pop top element of the queue.
6968
auto [inc, und] = queue.back();
7069
queue.pop_back();
@@ -75,6 +74,7 @@ class SimpleCandidateFinder
7574
// transactions that share ancestry with inc so far (which means only connected
7675
// sets will be considered).
7776
if (inc_none || inc.Overlaps(m_depgraph.Ancestors(split))) {
77+
--iterations_left;
7878
// Add a queue entry with split included.
7979
SetInfo new_inc(m_depgraph, inc | (m_todo & m_depgraph.Ancestors(split)));
8080
queue.emplace_back(new_inc.transactions, und - new_inc.transactions);

0 commit comments

Comments
 (0)