From d7001b59f38e81d46084f0487e18c2f2cae8a9e1 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sat, 10 Oct 2026 15:08:03 +0200 Subject: [PATCH] WIP: doubled-cell shells count only where the geometry resolves most of the class A shell is read only where at least half of the class's reflections are clear of the lattice's by r3. On a 701 A axis 26-43 of ~36000 per shell were clear; they read at the lattice's own strength, the doubled merge (93% of predictions overlapping a neighbour) passed the one-translation test, and the run was adopted doubled and failed. With the rule, of ~134 sets with probe logs only 9min and one I-centred crystal reach the doubled pass. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01EizBKhTqrAYago9KJG3dA3 --- rugnux/Rugnux.h | 6 +++++- rugnux/RugnuxImagePass.cpp | 1 + rugnux/RugnuxPasses.cpp | 9 +++++++-- tests/RugnuxTest.cpp | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/rugnux/Rugnux.h b/rugnux/Rugnux.h index fc61f484d..f4774fbbb 100644 --- a/rugnux/Rugnux.h +++ b/rugnux/Rugnux.h @@ -446,11 +446,15 @@ struct ProcessResult { UnitCell doubled_cell{}; // The class out to the run's limit (SupercellTrend), by resolution shell, less the median of the // six other classes: its mean intensity against the lattice's (excess) and in its own standard - // errors (z), the largest such z among the six beside it, and the lattice's own . + // errors (z), the largest such z among the six beside it, the lattice's own , and the + // share of the class resolved from the lattice. struct Shell { float d_low_A = 0.0f, d_high_A = 0.0f; int64_t n = 0; double excess = 0.0, z = 0.0, sibling_z = 0.0, lattice_i_over_sigma = 0.0; + // The class's reflections clear of the lattice's by r3, per lattice reflection: how much of + // the class this geometry resolves at all. + double resolved = 0.0; }; std::vector trend; }; diff --git a/rugnux/RugnuxImagePass.cpp b/rugnux/RugnuxImagePass.cpp index 63c185b13..8c018f395 100644 --- a/rugnux/RugnuxImagePass.cpp +++ b/rugnux/RugnuxImagePass.cpp @@ -468,6 +468,7 @@ void Rugnux::ImagePass(PipelineLocals &p) { shell.d_high_A = SUPERCELL_TREND_D_A[sh + 1]; shell.n = x.n; shell.lattice_i_over_sigma = l.sum_i_over_sigma / static_cast(l.n); + shell.resolved = static_cast(x.n) / static_cast(l.n); shell.excess = (mean(x) - null_i) / mean(l); shell.z = (mean(x) - null_i) / se(x); shell.sibling_z = -INFINITY; diff --git a/rugnux/RugnuxPasses.cpp b/rugnux/RugnuxPasses.cpp index c196c1731..c8cefa501 100644 --- a/rugnux/RugnuxPasses.cpp +++ b/rugnux/RugnuxPasses.cpp @@ -1429,9 +1429,14 @@ std::optional Rugnux::RefinedPasses(RugnuxObserver *observer, Pro // direction, 32-64 standard errors from zero - copies that differ in content, or intensity that is // not the crystal's own. namespace { - // A shell the class is read in: measured above its noise, against a lattice that is measured too. + // A shell the class is read in: measured above its noise, against a lattice that is measured too, in a + // geometry that resolves most of it from the lattice. Where the added reflections mostly fall within + // the background radius of a lattice reflection, what the few clear ones read is not the class, and a + // doubled merge integrates the rest on top of their neighbours (measured: a 701 A axis left 26-43 of + // ~36000 clear per shell, read them at the lattice's own strength, and its doubled merge passed every + // other test). bool DoubledCellShellMeasured(const ProcessResult::SupercellClass::Shell &sh) { - return sh.z >= 3.0 && sh.lattice_i_over_sigma >= 1.0; + return sh.z >= 3.0 && sh.lattice_i_over_sigma >= 1.0 && sh.resolved >= 0.5; } } diff --git a/tests/RugnuxTest.cpp b/tests/RugnuxTest.cpp index f8292f749..9cee8fde9 100644 --- a/tests/RugnuxTest.cpp +++ b/tests/RugnuxTest.cpp @@ -364,6 +364,7 @@ TEST_CASE("DoubledCellDecision", "[process]") { sh.z = z; sh.sibling_z = 3.0; sh.lattice_i_over_sigma = lattice; + sh.resolved = 0.9; sc.trend.push_back(sh); } return sc;