Folding the fit loop and the score loop into one reference() had to pick one of their two
spellings, and it picked the fit loop's: w * I * corr * a, where the score loop had built
Is = I * corr * a first and then summed w * Is. Those differ in the last place, and of the two
callers it is the score that decides whether a surface is kept at all - so a gate sitting on the
fence could go the other way for no reason but the order of three multiplications.
Sum w * Is, which leaves the deciding path spelled as it was and matches how the rest of this file
accumulates a weighted intensity. The fit's own reference moves by a last place instead; it is
iterated to convergence and then scored, so that is the cheaper place to absorb it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011n8riB6X59oRjkrSHzNPAU