-
Notifications
You must be signed in to change notification settings - Fork 8
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
RFv2 hash mismatch with -O3 flag #17
Comments
This is interesting. It could be a compiler bug or a border-line optimization such as some aliasing (I noticed the code has quite a bit of it). What compiler version is this ? Also could you dump the options enabled at both levels this way:
It's interesting because I tried to run the code on the intel GPU in my CPU but it takes a while to start and reports an invalid hash. It could be related to the same issue. The performance is still very low compared to rf_test. I have not tested the cpuminer patch recently, I suspect it spends time initializing the rambox. |
@wtarreau here is what I got, probably clang have some platform specific differences 🤔
|
Ah that's sad. What clang version is this ? Oh on my machine with clang 3.8 it fails "rfv2_test -c" with any optimization option other than -O0. That's getting interesting ;-) |
Here is my clang specs:
|
Btw, not sure if I mentioned it before, but I also had very odd issue with original rainforest builded as python module on macOS. It's described here. |
OK I found the issue, it was caused by an incorrect rotation operation : depending on how the compiler optimizes it, it either works or not. It's one of these annoying issues when trying to implement rotations in C, you're torn between undefined behaviour the compiler can correctly map to the rol/ror instruction or slow implementation... I went for the valid implementation and added the asm equivalent for x86_64. I may do the same for armv8 later. This is in pr#18. |
On Sun, Apr 07, 2019 at 10:18:40PM -0700, iamstenman wrote:
Thanks @wtarreau. PR #18 fixed this
issue, and now everything works just fine :)
Ah cool, thanks for reporting! This issue comforted me in the usefulness
of a project I started long ago to provide reliable and portable low-level
functions!
Willy
|
I've tested RFv2 on testnet recently and noticed that cpuminer builded with
-O3
flag as @wtarreau proposed here #15 produce invalid hashes. After I recompiled cpuminer without-O3
flag, I finally managed to mine first RFv2 block.The text was updated successfully, but these errors were encountered: