rugnux: report an ambiguous space group instead of silently picking one

The two-arm check for "same order, different symmetry" ran after the
all-observation arm had already been adopted by value, so it compared
that arm against a copy of itself: the point-group names were always
equal and the branch was dead. In the other direction the orders were
always unequal, so it was dead there too. The AMBIGUOUS warning - written
for the case where the two merges support different symmetries of the
same order, which implies two different molecular-replacement searches -
could never be emitted.

Check before the adoption, while both arms still hold their own result.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-29 09:34:41 +02:00
co-authored by Claude Opus 5
parent 157698d31e
commit c40e09d458
+14 -12
View File
@@ -1241,18 +1241,8 @@ ProcessResult Rugnux::RunPipeline(RugnuxObserver *observer, bool write_output, b
// the WEAK reflections and the filter throws most of them away. Preferring the filtered
// arm on a tie cost four crystals their screw axes (P2(1) read as P2) for exactly that
// reason, with the point group and every intensity statistic identical.
if (order_of(sg_search) <= order_of(alt)) {
if (order_of(alt) > order_of(sg_search))
logger.Info("Space-group search: all-observation merge supports {} where the "
"Lorentz-filtered one supports {} - taking the higher symmetry",
alt.point_group_hm, sg_search.point_group_hm);
sg_search = alt;
sm = std::move(sm_all);
} else {
logger.Info("Space-group search: Lorentz-filtered merge supports {} where the "
"all-observation one supports {} - taking the higher symmetry",
sg_search.point_group_hm, alt.point_group_hm);
}
// Checked while both arms are still intact - below, the all-observation arm is adopted
// by value and the two become the same result.
if (order_of(alt) > 0 && order_of(alt) == order_of(sg_search)
&& alt.point_group_hm != sg_search.point_group_hm) {
// Same order, different symmetry: the two merges disagree about WHICH operators are
@@ -1273,6 +1263,18 @@ ProcessResult Rugnux::RunPipeline(RugnuxObserver *observer, bool write_output, b
logger.Warning("{}", msg);
stats_text << " !! " << msg << "\n\n";
}
if (order_of(sg_search) <= order_of(alt)) {
if (order_of(alt) > order_of(sg_search))
logger.Info("Space-group search: all-observation merge supports {} where the "
"Lorentz-filtered one supports {} - taking the higher symmetry",
alt.point_group_hm, sg_search.point_group_hm);
sg_search = alt;
sm = std::move(sm_all);
} else {
logger.Info("Space-group search: Lorentz-filtered merge supports {} where the "
"all-observation one supports {} - taking the higher symmetry",
sg_search.point_group_hm, alt.point_group_hm);
}
}
// Twinning evidence measured BEFORE any promotion, on the P1/subgroup merge the search was