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

Audit for maxnumf* and minnumf* intrinsics #1248

Merged
merged 5 commits into from
Jun 6, 2022

Conversation

adpaco-aws
Copy link
Contributor

Description of changes:

Restores and completes the audit for maxnumf32, maxnumf64, minnumf32 and minnumf64. These depend on a set of CBMC builtins (fmaxf, fmax, fminf and fmin) that handle NaN arguments in a specific way.

Resolved issues:

Part of #1163
Part of #1025

Call-outs:

fmaxf is not working for an unknown reason, but I think we should restore it in order to ease debugging. The "fixme" test I added for it should work once the issue gets fixed in CBMC (if that's the reason) without needing any changes from Kani.

Testing:

  • How is this change tested? Adds 4 tests (1 of them is a "fixme").

  • Is this a refactor change? No.

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@adpaco-aws adpaco-aws requested a review from a team as a code owner June 2, 2022 19:06
// Kani does not produce the right expression (which is strange, because it's
// doing the same for similar expressions and they work) or CBMC is not picking
// it for some reason.
// Tracked in https://github.com/model-checking/kani/issues/1025
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Michael seemed to believe the issue there was fixed, have you talked to him about this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment in #1025 about this. In principle, all these builtins should be fixed, but fmaxf is not working for some reason.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmaxf and fmaxl were affected, diffblue/cbmc#6904 fixes this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... which is now merged, and will be part of the next release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is being tracked in #1025, I'm going to merge this PR in its current state. This means that the test will work if all goes well when the CBMC version is upgraded, causing the regression to fail unless the test is renamed @zhassan-aws @tedinski

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

@adpaco-aws adpaco-aws merged commit 5d206d6 into model-checking:main Jun 6, 2022
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

Successfully merging this pull request may close these issues.

4 participants