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

gcd stuck when only one vCPU #2

Closed
FrankReh opened this issue May 6, 2022 · 2 comments
Closed

gcd stuck when only one vCPU #2

FrankReh opened this issue May 6, 2022 · 2 comments

Comments

@FrankReh
Copy link

FrankReh commented May 6, 2022

It appears when the benchmarks are run on a single vCPU, the RandomSequence::new call never returns because it is passed a value of 1, and as a result gcd is called with values 0 and 1, resulting in an infinite loop.

Otherwise, am enjoying looking through this very tight package.

@kprotty
Copy link
Owner

kprotty commented May 8, 2022

RIP, sounds like an easy fix though. Thanks for pointing it out.

@FrankReh
Copy link
Author

FrankReh commented May 8, 2022

If you are using rust 1.59 or 1.60, you'll run into the change made to unreachable breaking the build. Found this which goes to explaining why a breaking change was considered acceptable to the team. The fix was easy but the breakage surprised me, being new to rust, so I looked for the discussion behind it. rust-lang/rust#92137 (comment)

Just reading more, for educational purposes, the 2021 Edition came with these release notes, https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html, explaining why some compiler macros now require a string literal as the first arg. Seems they forgot to include unreachable for 1.56 so they fixed it by 1.59. Sorry for this noise, you may be finding all this much faster than I did. Wanted to say again, your rust packages are great to read through for a newcomer.

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