-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Unexpected performance divergence on identical inputs between macOS and Linux #7457
Comments
Here is the input SMT2 file. (This was generated by CBMC 6.4.0, but that shouldn't matter.) |
Here is the result of running
on a x86_64 (EC2 c7i) machine, running Ubuntu 24.04:
|
Here is the same on Graviton3/Amazon Linux:
Note similar times and counts, but not identical. |
Here is the result of macOS:
Clearly something diverging significantly here... |
In a nutshell it is due to C/C++ semantics. I have yet to figure out why the old version diverged. Worth forcing. |
Debugging notes:
|
Many thanks for the continued investigation. What does smt.relevancy actually do? The "-pd" output doesn't shed much light on it. How would I know when to turn that on? |
OK... as a "user" I do not expect to read any documentation that has the word "internals" in the title. Could you translate that back into English that a user could understand, and then be able to decide what switches to use, based solely on the properties of the source language that I'm dealing with (in this case, SPARK Ada, but it could equally be C) ? |
I expect that once you start using bit-vectors with "lame" quantifier usage, then set smt.relevancy=0. When you start using bit-vectors, however, which wasn't in boogie's vocabulary, the emphasis shifts towards being able to instantiate lemmas early and eagerly. |
You're still talking a foreign language to me... there are no "bit vectors" in my source code. There are integers (signed, but all have range constraints), modular integers (although the modulus is 3329, which is prime, not some convenient power of 2), arrays thereof, and lots of quantification over those arrays. I tried smt.relevancy=0 on all 621 SMT files that arise from LibMLKEM. The "unsat" count goes up from 591 to 594, so +3 better, with no regressions. |
FWIW, the VCG generating these SMT files is Why3, not Boogie... |
still close to boogie: why+ecma ~ ymca |
Running Z3 4.13.3 on Apple Silicon macOS, and various Linux platforms, I see divergence in behaviour and a sharp performance penalty on macOS.
Input file is the same.
Z3 is 4.13.3 on all platforms.
Parameters (particularly all random seeds) are at their default values and identical on all platforms.
This causes pain for us, since our main development is done on macOS, but our CI runs are done on Linux.
I will post the inout file and result in following comments.
The text was updated successfully, but these errors were encountered: