clusterlin: keep FIFO queue of improvable chunks (preparation)

This introduces a queue of chunks that still need processing, in both
MakeTopological() and OptimizationStep(). This is simultaneously:
* A preparation for introducing randomization, by allowing permuting the
  queue.
* An improvement to the fairness of suboptimal solutions, by distributing
  the work more fairly over chunks.
* An optimization, by avoiding retrying chunks over and over again which
  are already known to be optimal.
This commit is contained in:
Pieter Wuille
2025-10-15 21:46:50 -04:00
parent 3efc94d656
commit ddbfa4dfac
3 changed files with 73 additions and 37 deletions

View File

@@ -1068,6 +1068,8 @@ FUZZ_TARGET(clusterlin_sfl)
}
// Loop until optimal.
test_fn();
sfl.StartOptimizing();
while (true) {
test_fn();
if (!sfl.OptimizeStep()) break;