Error model: harden the fit against pathological inputs (code review)
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 25m44s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 29m14s
Build Packages / build:rpm (rocky8) (push) Successful in 30m58s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 31m34s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 31m40s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 32m5s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 33m52s
Build Packages / XDS test (durin plugin) (push) Successful in 19m26s
Build Packages / Generate python client (push) Successful in 38s
Build Packages / Build documentation (push) Successful in 1m30s
Build Packages / Create release (push) Skipped
Build Packages / XDS test (neggia plugin) (push) Successful in 20m15s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 22m14s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 23m41s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 25m45s
Build Packages / build:rpm (rocky9) (push) Successful in 29m38s
Build Packages / DIALS test (push) Successful in 34m2s
Build Packages / Unit tests (push) Successful in 2h19m4s

Addresses code-review findings on RefineErrorModel:
- Floor the 1/dev^2 bin weight relative to the data scale (1e-3 of the median
  bin dev^2), not an absolute 1e-30: a near-zero-scatter bin could otherwise
  acquire a runaway weight and hijack the global (a,b) fit.
- Reject a near-collinear normal-equation system relatively (det > 1e-10*Ass*AII)
  instead of with an absolute threshold that an ill-conditioned fit can pass.
- Reset the model to identity at entry so any early return leaves it inactive
  rather than keeping a stale a/b alongside a freshly-cleared mean map (which
  would make CorrectedSigma fall back to the per-observation I).
- PixelRefine: correct the orient_prior comment - with the sweep on, the LSQ
  anchor is the swept orientation (intended), not the spot-centroid one.

Verified unchanged on the lyso test set (ISa 1.1, CC1/2 90.3%).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 18:53:02 +02:00
co-authored by Claude Opus 4.8
parent e6a50b45c7
commit c93d381dc8
2 changed files with 35 additions and 7 deletions
@@ -920,8 +920,11 @@ void PixelRefine::Run(const T *image,
BuildParameterBlocks(data, beam, dist_mm, detector_rot,
latt_vec0, latt_vec1, latt_vec2);
// Anchor for orientation regularization = the spot-centroid orientation we
// started from (captured before any pixel-level refinement moved it).
// Anchor for orientation regularization = the orientation the LSQ starts from
// (captured before the predict<->refine iterations move it). When the global
// sweep ran first this is the swept orientation, not the original spot-centroid
// one - which is intended: the regularizer keeps the LSQ near its own starting
// point, it is not meant to pull a deliberate sweep back.
if (iter == 0)
for (int i = 0; i < 3; ++i)
orient_prior[i] = latt_vec0[i];