From cfe15f2343bba2cb44e4f8024d298d04943747a1 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Mon, 16 Nov 2026 06:11:40 +0100 Subject: [PATCH] tNCS test: the near-extinct synthetic clear of the gate, and its counterpart "A near-extinct class is reported as a sub-lattice" built its crystal with the weak class at 2% of the strong, which reads a modulation of 19.996x against the 20x gate: FFTW's rounding of the Patterson put it over, pocketfft's under. Swept on the same synthetic: depth 0.90/0.95/0.96/0.97/0.98 read 12.0/18.0/20.0/22.8/26.2x. The test now uses the weak class at 1% (26x), and also checks the other side of the gate, which it did not before: a deep but genuine pseudo-symmetry (weak class at 5%, 12x) is detected and NOT reported as near-extinct. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UqXYdJDrM65gxsCn2PrbfK --- tests/TranslationalNCSTest.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/TranslationalNCSTest.cpp b/tests/TranslationalNCSTest.cpp index 0ca30d949..1e478ba88 100644 --- a/tests/TranslationalNCSTest.cpp +++ b/tests/TranslationalNCSTest.cpp @@ -254,13 +254,21 @@ TEST_CASE("A near-extinct class is reported as a sub-lattice", "[tncs]") { const gemmi::UnitCell cell = Cell(70.0, 85.0, 110.0); const gemmi::SpaceGroup *sg = gemmi::find_spacegroup_by_name("P 1 2 1"); const std::array u{0.0, 0.425, 0.5}; // no p/q with q <= 6 fits the whole vector - const auto merged = Synthetic(cell, "P 1 2 1", &u, 0.96); // weak class at 2% of the strong + // The weak class at 1% of the strong reads a modulation of 26x, clear of the 20x gate; at 2% it + // read 20.0x, on the gate itself, and the FFT's rounding decided the outcome. + const auto merged = Synthetic(cell, "P 1 2 1", &u, 0.98); const auto r = AnalyzeTranslationalNCS(merged, cell, sg); REQUIRE(r.measurable); REQUIRE(r.detected); CHECK_FALSE(r.commensurate); CHECK(r.near_extinct_class); CHECK(TranslationalNCSToText(r).find("supercell candidate") != std::string::npos); + + // A deep but genuine pseudo-symmetry - the weak class at 5% of the strong, a 12x modulation - is + // not one. + const auto deep = AnalyzeTranslationalNCS(Synthetic(cell, "P 1 2 1", &u, 0.90), cell, sg); + REQUIRE(deep.detected); + CHECK_FALSE(deep.near_extinct_class); } // The vector is not only reported: the L-test picks its partner steps with it and the twin-immune