-
-
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
test_png.test_pngsuite.test fails on ppc64 (big-endian) #7792
Comments
The incorrect answer it gets for the |
The four images that are incorrectly rendered are all the 16-bit images. All the images that render correctly are 1, 2, 4 or 8-bit. There's a few edit: aha! If I just comment out this block:
it makes the tests pass (both of them). Obviously just unconditionally commenting it out isn't a true fix (it'll break LE arches); I guess we need to conditionalize the bit swap to only happen on LE arches. Now to figure out how to do that... |
I see a |
snap ;) |
Are there regressions from 1.5.x or have we always been broken on BE systems? |
@tacaswell I don't know for sure myself - I only ran into this more or less by accident while doing drive-by Fedora package rebuilds, I didn't know thing one about matplotlib until two days ago. I don't even own any ppc64 systems, I'm testing this in a sandbox container Fedora releng gave me for the purpose. Some of the font stuff that was broken was definitely new in 2.0, I did notice that, but I think some of the other stuff has been around longer. |
@tacaswell I think the font problems are new in 2.0.0 as the commit that @AdamWill referenced in his first PR was not in 1.5.3, and it seems like there was a bit of a rewrite there. Not sure about png, but it did have the CXX removal recently. |
So, really not sure what the best way to go about implementing an endianness check would be. One approach I thought of: you can get the current system's endianness trivially from Python - Googling around for endianness checks gives you all kinds of suggestions and all kinds of reasons why they're all wrong and broken and terrible, so I'm a bit lost as to what the best choice would be... |
It looks like we have NumPy available there, so maybe |
Aha, yeah, that sounds promising. On a quick look, numpy's check uses the |
_png has some code that unconditionally byte-swaps 16-bit PNG data (which is, per the spec, stored in big-endian order). This isn't appropriate on a big-endian platform, though: this swap being done unconditionally breaks the handling of 16-bit PNGs on big-endian platforms (e.g. Fedora ppc64), as reported in this swap or not.
_png has some code that unconditionally byte-swaps 16-bit PNG data (which is, per the spec, stored in big-endian order). This isn't appropriate on a big-endian platform, though: this swap being done unconditionally breaks the handling of 16-bit PNGs on big-endian platforms (e.g. Fedora ppc64), as reported in to decide whether to do this swap or not.
_png has some code that unconditionally byte-swaps 16-bit PNG data (which is, per the spec, stored in big-endian order). This isn't appropriate on a big-endian platform, though: this swap being done unconditionally breaks the handling of 16-bit PNGs on big-endian platforms (e.g. Fedora ppc64) (matplotlib#7792). So, let's use some macros numpy kindly defines for us to decide whether to do this swap or not.
Only byte-swap 16-bit PNGs on little-endian (#7792)
Only byte-swap 16-bit PNGs on little-endian (#7792)
So this is fixed now. |
Recently I've been looking at errors in the matplotlib test suite when building on Fedora's ppc64 arch, which is big-endian. I've sent a few PRs so far, but there are still some remaining issues, so I'm filing tickets for them.
This ticket is for a failure of the
test_png.test_pngsuite.test
test. In my ppc64 build, this is the image produced by the test:Here's the expected image:
The fifth, seventh, thirteenth and fifteenth images clearly differ. Haven't yet dug into why this is.
There is another png-related test that fails, the two may share a common cause:
The text was updated successfully, but these errors were encountered: