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

Filter sanity checks #1146

Merged
merged 19 commits into from
May 3, 2022
Merged

Conversation

jaisnan
Copy link
Contributor

@jaisnan jaisnan commented May 2, 2022

Description of changes:

Properties which are sanity checks needed to be removed from the UI. They are now marked with the property_class "sanity_check" which makes it easy to filter such checks out as the pipeline to add, remove and edit checks based on their property_class has already been setup.

Resolved issues:

Resolves #1020

Call-outs:

Couldn't add tests for this UI change as it's a removal. In the future we should contain negative tests for similar changes.

Testing:

  • How is this change tested?

  • Is this a refactor change?

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.

@jaisnan jaisnan requested a review from a team as a code owner May 2, 2022 21:24

def filter_properties(properties, message):
def filter_properties(properties, message=None, property_class=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want a single property_class or a list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe a wrapper function over this function which takes in a list of property_classes and messages? For this function itself, I think it's better to keep it simple, and call it over a list somewhere else.

Copy link
Contributor

@zhassan-aws zhassan-aws left a comment

Choose a reason for hiding this comment

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

We need to check if any of the sanity checks fail, and if so, report verification failure (and the sanity check that failed).

@@ -329,6 +329,7 @@ def postprocess_results(properties, extra_ptr_check):
has_failed_unwinding_asserts = has_check_failure(properties, GlobalMessages.UNWINDING_ASSERT_DESC)
has_reachable_undefined_functions = modify_undefined_function_checks(properties)
properties, reach_checks = filter_reach_checks(properties)
properties = filter_sanity_checks(properties)[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any chance this is empty?

Copy link
Contributor

Choose a reason for hiding this comment

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

also, you should move this logic to be inside filter_sanity_checks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, thanks!


/// This testcase is currently failing with the following error:
///
/// [assertion.2] Reached assignment statement with unequal types Pointer { typ:
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch. As we discussed offline, sanity checks that fail should be visible and fail the verification. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me address those cases and clean up some of the code as well


def filter_properties(properties, message):
def filter_properties(properties, message=None, property_class=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

The changes to this function are no longer needed, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, redundant changes.

@jaisnan
Copy link
Contributor Author

jaisnan commented May 3, 2022

I've simplified this PR to just do the minimum and added a simple test to check for sanity_check. Will try to address comments on the spot to get it merged before tomorrow.

Copy link
Contributor

@zhassan-aws zhassan-aws left a comment

Choose a reason for hiding this comment

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

LGTM. In the future, we might want to make a sanity check failure more pronounced, e.g. through erroring out and not displaying any results at all. But we can do that in another PR.

@celinval celinval merged commit 0ccd0a0 into model-checking:main May 3, 2022
@jaisnan jaisnan deleted the filter-sanity-checks branch May 3, 2022 21:49
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.

Hide Sanity Checks from Output
4 participants