Subject: Re: bug#41544: 26.3; Possible incorrect results from color-distance

From: Eli Zaretskii <[email-masked]>
Date: Tue, 02 Jun 2020 19:14:28 +0300

> From: Mattias Engdegård <[email-masked]>
> Date: Tue, 2 Jun 2020 17:27:46 +0200
> Cc: [email-masked], [email-masked], [email-masked]
> 
> Let's start with the color-distance changes, out of respect for the bug reporter if nothing else.
> 
> It is not possible to change a function without changing it. Either we fix it or we don't. The reported bug was about broken symmetry, which is rather embarrassing; as written previously, the first analysis uncovered deeper issues worth fixing, such as loss of precision and (especially) the nonlinearity that causes triangle inequality violation.
> 
> The proposed fixes to color-distance, I hope you agree, are straightforward, reasonable and address all these points. Callers have been updated with carefully recomputed comparison constants; I detailed how they were obtained in a previous reply, and test have all been satisfactory.

I'd prefer to fix only the symmetry bug (which AFAIU happens because
we use bit shifts on signed integers), without introducing any other
effects on the function's behavior and return values.  AFAIU, such a
fix should not require any changes outside of the function itself.

OK?