From c125a516b4c0940b108bf4504fc80f2ba8dac520 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sun, 15 Nov 2026 17:11:51 +0100 Subject: [PATCH] rugnux: a crystal system fixed by -C bounds the space-group search With -C and no -S the typed angles fix the crystal system and the indexer holds the lattice in it, but the metric-lattice re-ask after the P1 merge could still reindex into a higher class the metric offers and adopt a group there (a cell typed with one angle at 90.03 fixed monoclinic, indexed monoclinic, and ended tetragonal). That re-ask only ever commits a strictly higher point group, so it is skipped when the system is fixed, as the centred-group reduction already is; the search then stays within the system the cell names, as docs/RUGNUX_CLI.md states. Runs without a fixed system (no -C, a measured cell, or -S) are unaffected. Verified: that cell now ends P 1 1 21; -C with 90/90/90 still P 41 21 2 and a monoclinic -C on a C2 set still C 1 2 1, both with p.hkl byte-identical to the rc187 binary. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UqXYdJDrM65gxsCn2PrbfK --- rugnux/RugnuxScaleMerge.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rugnux/RugnuxScaleMerge.cpp b/rugnux/RugnuxScaleMerge.cpp index 96a3b7d7d..da3719339 100644 --- a/rugnux/RugnuxScaleMerge.cpp +++ b/rugnux/RugnuxScaleMerge.cpp @@ -2836,7 +2836,11 @@ bool Rugnux::ScaleMergeAndSymmetry(PipelineLocals &p) { // answered by its having run. The two cannot disagree: the ask below only ever replaces the // answer in hand with a STRICTLY higher point group, and it writes all four commit_ values // together, so the group, the cell and the lattice type stay one answer. - if (end_msg.rotation_lattice.has_value() && end_msg.rotation_lattice_type.has_value()) { + // + // A cell given with -C fixes the crystal system, and the indexer already holds it there, so + // a higher class is never asked: the search stays within the system the cell names. + if (end_msg.rotation_lattice.has_value() && end_msg.rotation_lattice_type.has_value() + && !experiment_.GetIndexingSettings().GetFixedLatticeSystem()) { TimingMark metric_mark(logger, "metric lattice re-ask"); // The merge is indexed on the lattice the indexer named, whatever has been committed // since, so the metric is measured on the primitive form of THAT one.