This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ][z/OS] Fix cityhash lit for EBCDIC
ClosedPublic

Authored by zibi on Jan 12 2023, 10:54 AM.

Details

Summary

This will fix __murmur2_or_cityhash.pass.cpp in EBCDIC mode. The reason it fails is because of string literals are being used as input to CityHash algorithm so we need to adjust the EBCDIC expected results.

Diff Detail

Event Timeline

zibi created this revision.Jan 12 2023, 10:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 10:54 AM
zibi requested review of this revision.Jan 12 2023, 10:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 10:54 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
zibi retitled this revision from [PHABRICATOR][z/OS] Fix cityhash lit for EBCDIC to [SystemZ][z/OS] Fix cityhash lit for EBCDIC.Jan 12 2023, 10:55 AM
zibi added reviewers: abhina.sreeskantharajan, Kai.
zibi added a subscriber: oToToT.Jan 12 2023, 10:58 AM
zibi added a comment.Jan 13 2023, 11:35 AM

The above pre-merge checks failures are timeout and not related to this patch. Submitting again to get clean build status.

The above pre-merge checks failures are timeout and not related to this patch. Submitting again to get clean build status.

You don't have to get a green CI in the sense that all tests fail. If the failures are unrelated you can also consider it green. (You should be sure though)

libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp
31

Couldn't we just change these to char arrays with numbers instead of a string that might be different between platforms? That should make the Test platform independent.

zibi updated this revision to Diff 489094.Jan 13 2023, 12:21 PM

Addressing comments ...

zibi marked an inline comment as done.Jan 13 2023, 12:27 PM
zibi added inline comments.
libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp
31

Thank you for looking at it and your comments.

Is the new patch is what you meant? I think we want the numbers to be more than just what char can hold.

zibi updated this revision to Diff 489110.Jan 13 2023, 1:04 PM
zibi marked an inline comment as done.
  • Fix cityhash lit for EBCDIC
  • Switch to array of strings with hard coded values
EricWF added a subscriber: EricWF.Jan 13 2023, 2:10 PM
EricWF added inline comments.
libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp
23

Does this compile?

zibi updated this revision to Diff 489143.Jan 13 2023, 3:41 PM
  • fix typo
zibi marked an inline comment as done.Jan 13 2023, 3:42 PM
zibi added inline comments.
libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp
23

I guess not, it should be now, thx.

zibi marked an inline comment as done.Jan 16 2023, 6:19 AM

FYI, the failure ia the timeout on Apple, unrelated to this patch, so consider CI checks as green.

philnik added inline comments.Jan 16 2023, 9:23 AM
libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp
27

I thought more of just making this {43, 69, 74, 48, 61, 73, 68}. Or is there a reason not to do that?

zibi updated this revision to Diff 489821.Jan 17 2023, 7:36 AM

Change to use an array of integers instead of strings.

zibi marked an inline comment as done.Jan 17 2023, 7:38 AM
zibi added inline comments.
libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp
27

Yes, we can do that. I used hex values, otherwise I would need to convert them to decimal values.

tahonermann added inline comments.
libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp
27

I think the numeric hex escapes in a string literal were a better solution. When char is a signed 8-bit type, use of the initializer_list will reject narrowing conversions that occur when a code point value above 0x7F is needed.

zibi marked 2 inline comments as done.Jan 17 2023, 9:42 AM
zibi added inline comments.
libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp
27

Yes, you are right. At the moment we don't have anything > 0x7F so we are fine however, future expansion might introduce this issue.

I propose to reverse last commit.

zibi updated this revision to Diff 489870.Jan 17 2023, 10:13 AM
zibi marked an inline comment as done.
  • Revert "[SystemZ][z/OS] Fix cityhash lit for EBCDIC"
zibi added a comment.Jan 17 2023, 2:11 PM

FYI, the failures reported are unrelated.
They are either timeouts or taking unexpectedly too long (assertion in std/thread/futures/futures.async/async.pass.cpp at line 102).

philnik accepted this revision.Jan 17 2023, 2:19 PM
This revision is now accepted and ready to land.Jan 17 2023, 2:19 PM
This revision was landed with ongoing or failed builds.Jan 17 2023, 2:43 PM
This revision was automatically updated to reflect the committed changes.