Skip to content
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

Inconsistent results between Linux and MacOS #32

Open
althonos opened this issue Jul 30, 2022 · 5 comments
Open

Inconsistent results between Linux and MacOS #32

althonos opened this issue Jul 30, 2022 · 5 comments
Assignees

Comments

@althonos
Copy link
Contributor

althonos commented Jul 30, 2022

Hi!

I recently started writing Python bindings to FAMSA (althonos/pyfamsa), and after adding CI to test the code on MacOS and Linux I noticed the results were inconsistent. I thought it was an issue with my code at first, but after checking with just the FAMSA binary it looks like different alignments are being created from the same input.

I cloned the repo and added the same checks for MacOS that are currently done for Linux, and as I've seen earlier the results are different on the two platforms (see: https://github.com/althonos/FAMSA/actions/runs/2765789682). Do you think you could investigate? I don't own a Mac so I cannot really help with this issue.

@agudys agudys self-assigned this Aug 1, 2022
@agudys
Copy link
Member

agudys commented Aug 1, 2022

Hello @althonos!

Thank you for reporting the issue - I'll take a look on that.

Best,
Adam

agudys added a commit that referenced this issue Aug 4, 2022
…orm (#32)

Co-authored-by: Martin Larralde <martin.larralde@embl.de>
@agudys
Copy link
Member

agudys commented Aug 4, 2022

@althonos
The inconsistency you reported seems to be very compiler and platform specific. The macOS-latest GitHub runner provides clang 13.0.0 compiler. The issue was not present when compiling with clang 12.x and 13.1.6 on x64 machine and with clang 13.0.0 on M1 CPU. It also did not appear on Linux (we checked all g++ versions from 5 to 11). We looked for potential sources of non-determinism (random number generators, non-stable sorts, etc.) and checked with valgrind for erronous memory accesses with no success. Thus, if there is some kind of non-determinism, it must be very well hidden - we will keep on searching ;) In the latest sources we included macOS execution tests on GitHub macOS-12 runner where the issue is not present.

By the way, we were thinking of making Python wrapper for FAMSA, but somehow never found time. We really appreciate your work and would be happy to help if you encounter some problems.

althonos added a commit to althonos/pyfamsa that referenced this issue Aug 4, 2022
@althonos
Copy link
Contributor Author

althonos commented Aug 4, 2022

Thanks for checking! I guess it's a compiler bug then. I will be using the macos-12 runner to build the extension then, and I added a small check when building to crash for clang 13.0.0.

To be fair, writing a wrapper was very easy to do because the C++ code is well written, so the work you put there paid off 😉 I may have some patches coming in later (for instance, I had to implement my own CSequence copy function, because of CFAMSA expects a vector<CSequence>, but with reference counting I cannot have proper move semantics in Python. But I think at the moment I have everything needed for a first release!

althonos added a commit to althonos/pyfamsa that referenced this issue Aug 4, 2022
althonos added a commit to althonos/pyfamsa that referenced this issue Aug 4, 2022
@agudys
Copy link
Member

agudys commented Aug 11, 2022

Thank you! Happy to hear that you found the sources not too knotty. I allowed myself to link PyFAMSA in our Readme (in the text and as an additional badge) - I hope you don't mind. By the way, in the latest release we removed Boost dependency so something like two thousand header files are out from the repository ;)

@althonos
Copy link
Contributor Author

I allowed myself to link PyFAMSA in our Readme (in the text and as an additional badge) - I hope you don't mind.

No problem at all 😉

I'll update FAMSA to v2.1.2 when I have a bit more time, I need to do some more patching in the code for it to work 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants