-
Notifications
You must be signed in to change notification settings - Fork 3.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
GH-44767: [C++] Fix Float16.To{Little,Big}Endian on big endian machines #44768
Conversation
For `ToLittleEndian`/`ToBigEndian`, the result should always be in the specified endianness, not depend on host order. In the test ,istead of casting the `uint8_t` data into a `uint16_t` (with unspecified endianness handling), compare the bytes directly in their expected orders.
|
Confirmed to pass on a big-endian machine as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @QuLogic . For the record, did you try running the entire test suite on a big-endian machine?
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 59decc3. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them. |
Yes, I've run them all, but there are still several failures to go:
|
@QuLogic Thanks. Parquet failures are expected unfortunately, as the work of making Parquet C++ big endian-compatible has not been done. The IPC and compute failures are a bit more worrying. For the record, are you working for a company that provides big endian systems? |
Oops, I forgot to set the test environment variables; there's no
No, I'm trying to fix geopandas on Fedora s390x. |
Could you run |
Ah, those are #12681 (comment) |
Ah, thanks. These are minor precision issues in the test, it seems. |
Rationale for this change
See issue.
What changes are included in this PR?
For
ToLittleEndian
/ToBigEndian
, the result should always be in the specified endianness, not depend on host order.In the test, instead of casting the
uint8_t
data into auint16_t
(with unspecified endianness handling), compare the bytes directly in their expected orders.Are these changes tested?
Tested on little-endian, still building for big-endian.
Are there any user-facing changes?
Fixes #44767