-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestImageOperationsGolden: arm64, ppc64le, s390x generate slightly different PNGs due to "fused multiply and add" (FMA) instruction #6387
Comments
I'm totally guessing here, but I assume this is the PNG header that is slightly different (maybe it has some platform info encoded?). If that is the case, we should consider making the tests more lenient. |
Thank you for the idea regarding potential difference in PNG header, which prompted me to experiment with various PNG comparison tools such as pngmeta, pngcheck, etc., and eventually, perceptualdiff (http://pdiff.sourceforge.net/, https://github.com/myint/perceptualdiff). According to this tool, all images are visually identical except these four:
This is how the last image from above look like: arm64, ppc64el (ppc64le), s390x: Feeling perplexed, I tried my luck by browsing https://github.com/disintegration/gift more carefully, and noticed the message "fix tests on arm64, ppc64le, s390x" beside colors_test.go, which led me to disintegration/gift#20 where Grigory (@disintegration) explained:
and to disintegration/gift@a999ff8 where Grigory solved with a new goldenEqual function:
which I guess could be adapted for Hugo to handle most of the golden images, maybe except some of the 8-bit colour images where tiny differences become visible differences due to dithering. Aside: It seems golang.org/x/image/vector ran into the same issue two years ago, see https://groups.google.com/forum/#!topic/golang-dev/Sti0bl2xUXQ Another aside: It appears that ppc64le and s390x have the same FMA implementation as they produce identical PNG images, whereas arm64's FMA results in slightly different results in 4 PNG images. |
In TestImageOperationsGolden, tolerate slight floating-point rounding differences due to the use or non-use of "fused multiply and add" (FMA) instruction on different architectures. Special thanks to @disintegration for the solution in goldenEqual(); see disintegration/gift#20 Fixes gohugoio#6387
In TestImageOperationsGolden, tolerate slight floating-point rounding differences due to the use or non-use of "fused multiply and add" (FMA) instruction on different architectures. Special thanks to @disintegration for the solution in goldenEqual(); see disintegration/gift#20 Fixes #6387
As documented in commit 30eea39, some filenames have changed due to cache busting of PNG and Webp images. This resolves recent TestImageOperationsGolden failure on arm64, ppc64le and s390x. See gohugoio#6387 and gohugoio#8729
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
On arm64, ppc64el (ppc64le) and s390x platforms, TestImageOperationsGolden reveals that Hugo (or github.com/disintegration/gift or an underlying library it uses) generates image with different file sizes, as seen on Debian auto-builders and Ubuntu snap builders, and reproducible on e.g. Debian s390x porterbox zelenka.debian.org:
For example:
The files that differ on s390x are as follows:
Further investigation is needed and pending.
What version of Hugo are you using (
hugo version
)?0.58.x and 0.59-DEV
Does this issue reproduce with the latest release?
Yes.
Sample full error output
Archived build logs in case they go away in the future:
http://web.archive.org/web/20191003180051/https://buildd.debian.org/status/package.php?p=hugo
http://web.archive.org/web/20191003182821/https://launchpad.net/~gohugoio/+snap/hugo-dev
https://launchpadlibrarian.net/444820590/buildlog_snap_ubuntu_xenial_arm64_hugo-dev_BUILDING.txt.gz
https://launchpadlibrarian.net/444821645/buildlog_snap_ubuntu_xenial_ppc64el_hugo-dev_BUILDING.txt.gz
https://launchpadlibrarian.net/444820127/buildlog_snap_ubuntu_xenial_s390x_hugo-dev_BUILDING.txt.gz
The text was updated successfully, but these errors were encountered: