diff --git a/rugnux/Rugnux.cpp b/rugnux/Rugnux.cpp index 43442378c..803f29786 100644 --- a/rugnux/Rugnux.cpp +++ b/rugnux/Rugnux.cpp @@ -5264,26 +5264,21 @@ ProcessResult Rugnux::RunPipeline(RugnuxObserver *observer, bool write_output, b int seen = best.score; for (int k = 1; k <= reach && !cancelled_ && !adopted && !centre_past_reach; k++) { const std::array, 4> ring = {{{-k, 0}, {k, 0}, {0, -k}, {0, k}}}; - // The ring's four centres are fed first and indexed at once, each on its own copy of - // the experiment at that centre, then read in order as before. A centre after the one - // adopted is indexed for nothing. - std::array, 4> ring_experiment; - std::array ring_ris; - std::vector all_ris; - for (size_t h = 0; h < ring.size() && !cancelled_; h++) { - try_beam_center(beam_x + static_cast(ring[h].first), - beam_y + static_cast(ring[h].second)); - ring_experiment[h] = std::make_unique(experiment_); - ring_ris[h] = feed_schemes(*indexer_pool, ring_experiment[h].get()); - for (const auto &ri : ring_ris[h]) - all_ris.push_back(ri.get()); - } - run_indexing(all_ris); + // One centre at a time, fed, indexed and scored under the one mapping and spot list it + // was set up with. The cost of a centre is re-finding its spots, which is the same + // whether four are indexed at once or one; indexing the four together saved only the + // short indexing step, while setting each centre up a second time to score it cost + // more than that, and every centre after the adopted one was indexed for nothing. for (size_t h = 0; h < ring.size() && !cancelled_; h++) { const float trial_x = beam_x + static_cast(ring[h].first); const float trial_y = beam_y + static_cast(ring[h].second); try_beam_center(trial_x, trial_y); - FirstPass alt = score_schemes(ring_ris[h], *indexer); + SchemeIndexers ris = feed_schemes(*indexer_pool); + std::vector ris_ptrs; + for (const auto &ri : ris) + ris_ptrs.push_back(ri.get()); + run_indexing(ris_ptrs); + FirstPass alt = score_schemes(ris, *indexer); logger.Info("Beam-centre hypothesis ({:.2f},{:.2f}): {}/{} frames", trial_x, trial_y, alt.score, static_cast(validation.size())); seen = std::max(seen, alt.score);