The shift a sector's regression can report is bounded by the width of the
features it reads: a sector whose radial profile has moved a long way is not
g + d*g' for any d, and the least-squares projection onto g' returns far less
than the true d. The walk therefore advances by a bounded distance per
iteration - about twenty pixels after damping - however far it still has to go,
so MAX_ITERATIONS = 10 was a hard cap of roughly two hundred pixels of travel
rather than a safety net around a converging fit.
A sweep whose header named the detector's middle while the beam sat 351 px away
showed exactly that: the fit walked steadily toward the answer and was cut off
still moving 19 px a step, 145 px short, and reported the per-iteration
precision of its last step - three pixels - as though it had arrived. Instrumented,
the step never decays; it is a truncated walk and not a fixed point. Lifting the
cap converges in 58 iterations to 1.4 px of the centre that indexes every frame,
and the run then adopts it and merges to 1.70 A. Undamped is not faster (81
iterations against 70), so DAMPING is unchanged.
Two changes: MAX_ITERATIONS becomes a travel budget large enough to cross a
detector, documented as such; and the returned sigma takes in the step the fit
still wanted to make, so one that leaves on the cap widens instead of claiming
the precision of a step it was in the middle of. A converged fit stops at 0.02 px,
well under any sigma worth reporting, so neither touches one.
Measured over eight passing rotation sets on five detector sizes and 0.87-2.07 A:
five converged inside ten iterations already and are bit-identical; three had
been silently truncated and their centre moves by 0.0-0.25 px, with space group,
cell, resolution and indexing rate unchanged throughout.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011GxZqDiFP3KqriBhNdcR56