From 77a432ee704b4a83d56135ed10cf2adf4b3c18af Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 25 Sep 2024 19:34:47 -0400 Subject: [PATCH] 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. --- src/test/fuzz/cluster_linearize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/fuzz/cluster_linearize.cpp b/src/test/fuzz/cluster_linearize.cpp index 6a1ea40aef..8d0249a5d7 100644 --- a/src/test/fuzz/cluster_linearize.cpp +++ b/src/test/fuzz/cluster_linearize.cpp @@ -64,7 +64,6 @@ public: SetInfo best(m_depgraph, m_todo); // Process the queue. while (!queue.empty() && iterations_left) { - --iterations_left; // Pop top element of the queue. auto [inc, und] = queue.back(); queue.pop_back(); @@ -75,6 +74,7 @@ public: // transactions that share ancestry with inc so far (which means only connected // sets will be considered). if (inc_none || inc.Overlaps(m_depgraph.Ancestors(split))) { + --iterations_left; // Add a queue entry with split included. SetInfo new_inc(m_depgraph, inc | (m_todo & m_depgraph.Ancestors(split))); queue.emplace_back(new_inc.transactions, und - new_inc.transactions);