clusterlin: replace cluster linearization with SFL (feature)

This replaces the existing LIMO linearization algorithm (which internally uses
ancestor set finding and candidate set finding) with the much more performant
spanning-forest linearization algorithm.

This removes the old candidate-set search algorithm, and several of its tests,
benchmarks, and needed utility code.

The worst case time per cost is similar to the previous algorithm, so
ACCEPTABLE_ITERS is unchanged.
This commit is contained in:
Pieter Wuille
2025-10-23 19:15:21 -04:00
parent 6a8fa821b8
commit 3efc94d656
7 changed files with 81 additions and 994 deletions

View File

@@ -88,8 +88,10 @@ void TestOptimalLinearization(const std::vector<uint8_t>& enc, const std::vector
SanityCheck(depgraph, lin);
auto chunking = ChunkLinearization(depgraph, lin);
BOOST_CHECK(std::is_eq(CompareChunks(chunking, optimal_diagram)));
// Verify that the chunks are minimal.
BOOST_CHECK(chunking.size() == optimal_diagram.size());
// TODO: temporarily disabled; SFL does not guarantee minimal chunks. This will be
// reinstated in a future commit.
// // Verify that the chunks are minimal.
// BOOST_CHECK(chunking.size() == optimal_diagram.size());
}
tx_count = depgraph.PositionRange();
};