Skip to content

Contracts & Harnesses for non_null::sub and non_null::sub_ptr and non_null::offset_from #93

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

Merged
merged 37 commits into from
Nov 27, 2024

Conversation

Jimmycreative
Copy link

Towards #53

Changes
added contract and harness for non_null::sub
added contract and harness for non_null::sub_ptr

Revalidation
To revalidate the verification results, run kani verify-std -Z unstable-options "path/to/library" -Z function-contracts -Z mem-predicates --harness ptr::non_null::verify This will run both harnesses. All default checks should pass:

SUMMARY:
 ** 0 of 1622 failed

VERIFICATION:- SUCCESSFUL
Verification Time: 0.3814842s

SUMMARY:
 ** 0 of 1780 failed (1 unreachable)

VERIFICATION:- SUCCESSFUL
Verification Time: 0.44192737s

Complete - 2 successfully verified harnesses, 0 failures, 2 total.

Clarifying Questions

The proof now only handles the array with a fixed size and uses a random element in the arr for subtraction. The element is i32 type. Is this ok for the current stage? Or maybe we need to consider other types such as i64, etc and maybe change the arr to a bigger size?

@Jimmycreative Jimmycreative requested a review from a team as a code owner September 27, 2024 07:59
@feliperodri feliperodri changed the title AWS-Team-4 Contracts & Harnesses for non_null::sub and non_null::sub_ptr Contracts & Harnesses for non_null::sub and non_null::sub_ptr Sep 27, 2024
@Jimmycreative Jimmycreative changed the title Contracts & Harnesses for non_null::sub and non_null::sub_ptr Contracts & Harnesses for non_null::sub and non_null::sub_ptr and non_null::offset_from Oct 5, 2024
Copy link

@carolynzech carolynzech left a comment

Choose a reason for hiding this comment

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

Can you go through the other comments you've received above and mark them as resolved (if you've indeed resolved them)? We want to have everything resolved before approving.

Copy link

@carolynzech carolynzech left a comment

Choose a reason for hiding this comment

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

LGTM modulo these changes. Please also resolve the conflicts. Thanks!

@carolynzech carolynzech dismissed feliperodri’s stale review November 22, 2024 15:48

dismissing stale review

Copy link

@carolynzech carolynzech left a comment

Choose a reason for hiding this comment

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

trigger merge workflow

auto-merge was automatically disabled November 26, 2024 21:58

Head branch was pushed to by a user without write access

@zhassan-aws zhassan-aws merged commit 688b15b into model-checking:main Nov 27, 2024
9 checks passed
Yenyun035 pushed a commit to rajathkotyal/verify-rust-std that referenced this pull request Nov 27, 2024
… `non_null::offset_from` (model-checking#93)

Towards model-checking#53

Changes
added contract and harness for non_null::sub
added contract and harness for non_null::sub_ptr

Revalidation
To revalidate the verification results, run kani verify-std -Z
unstable-options "path/to/library" -Z function-contracts -Z
mem-predicates --harness ptr::non_null::verify This will run both
harnesses. All default checks should pass:

```
SUMMARY:
 ** 0 of 1622 failed

VERIFICATION:- SUCCESSFUL
Verification Time: 0.3814842s

SUMMARY:
 ** 0 of 1780 failed (1 unreachable)

VERIFICATION:- SUCCESSFUL
Verification Time: 0.44192737s

Complete - 2 successfully verified harnesses, 0 failures, 2 total.
```

The proof now only handles the array with a fixed size and uses a random
element in the arr for subtraction. The element is i32 type. Is this ok
for the current stage? Or maybe we need to consider other types such as
i64, etc and maybe change the arr to a bigger size?

---------

Co-authored-by: OwO <[email protected]>
Co-authored-by: Qinyuan Wu <[email protected]>
Co-authored-by: Carolyn Zech <[email protected]>
Co-authored-by: Zyad Hassan <[email protected]>

Fix invariant return

Add to_bytes and to_bytes_with_nul harnesses
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.

7 participants