From 6dcef006bb2e37a5d3897d2f2f9a3761b995c9ec Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Fri, 25 Sep 2026 02:40:25 +0200 Subject: [PATCH] Two-pass: lost-centring guard only for the same primitive metric A pass 2 that re-indexes pass 1's axis-multiple supercell to the true cell reports it primitive-centred; the guard read that as a dropped centring and forced pass 1's supercell back (completeness 99.7% -> 65% on a 7x case). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01D1G8gJVAy6gp1K5Dz3NE5C --- rugnux/Rugnux.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rugnux/Rugnux.cpp b/rugnux/Rugnux.cpp index 805a7369b..6289bfda4 100644 --- a/rugnux/Rugnux.cpp +++ b/rugnux/Rugnux.cpp @@ -5023,8 +5023,11 @@ ProcessResult Rugnux::RunPipeline(RugnuxObserver *observer, bool write_output, b // centring implies, and the pass then merges in P1 (measured on a C-centred monoclinic // crystal). Only this direction - a centring pass 2 finds where pass 1 had none is the // refined geometry doing its job, and the intensity test in the search confirms it. + // Same primitive metric only: a pass 2 that lands on a primitive cell several times + // smaller is a different lattice - pass 1's supercell corrected - not a dropped centring. const bool lost_centring = prepass_result_->search_result.centering != 'P' - && best.result->search_result.centering == 'P'; + && best.result->search_result.centering == 'P' + && v1 > 1.0 && std::abs(v2 / v1 - 1.0) < 0.1; if (supercell || lost_centring) { logger.Info("Two-pass: that lattice ({}-centred, volume {:.0f} A^3) disagrees with " "pass 1 ({}-centred, {:.0f} A^3) - integrating with pass-1's lattice instead",