-
Notifications
You must be signed in to change notification settings - Fork 99
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
Add live streaming JSON output from CBMC to prevent Kani output hang #1278
Closed
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2d03541
Add piped output to the pipelines
jaisnan d9938c4
Hide piped output behind experimental flag
jaisnan 3aea2d2
Adding python reading from stream
jaisnan 364f3cc
Add changes to stream line by line in python
jaisnan d70a930
Clean up code and add comments
jaisnan 585d4ef
Adding tests to ensure correct piping of output
jaisnan a065dde
Clean up code
jaisnan 8bedc2a
Clean up code
jaisnan 63c7f93
fix regression tests
jaisnan 2088e01
Clean imports
jaisnan 3de6237
Cleaning up autopep8 issues
jaisnan 64dcac8
Merge branch 'main' into Add-Piped-Output
jaisnan b1080d6
Merge branch 'main' into Add-Piped-Output
jaisnan a6d003d
Address PR comments
jaisnan 918af96
Adding ui tests
jaisnan aa996dd
Merge branch 'Add-Piped-Output' of https://github.com/jaisnan/kani in…
jaisnan c947154
Merge branch 'main' into Add-Piped-Output
jaisnan c991705
autopup8 formatting
jaisnan 16edeee
Merge branch 'Add-Piped-Output' of https://github.com/jaisnan/kani in…
jaisnan 658beb9
Merge branch 'main' into Add-Piped-Output
jaisnan 38ccb39
clean up common functionality and add error code
jaisnan 9d8d661
Merge branch 'Add-Piped-Output' of https://github.com/jaisnan/kani in…
jaisnan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"description": "attempt to compute unchecked_mul which would overflow", | ||
"property": "core::num::<impl u8>::unchecked_mul.arithmetic_overflow.1", | ||
"status": "SUCCESS" | ||
|
||
"description": "attempt to compute unchecked_add which would overflow", | ||
"property": "core::num::<impl u8>::unchecked_add.arithmetic_overflow.1", | ||
"status": "SUCCESS" | ||
|
||
"description": "attempt to compute unchecked_sub which would overflow", | ||
"property": "core::num::<impl u8>::unchecked_sub.arithmetic_overflow.1", | ||
"status": "SUCCESS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// | ||
// kani-flags: --enable-unstable --use-piped-output | ||
// | ||
// Check that none of these operations trigger spurious overflow checks. | ||
#![feature(unchecked_math)] | ||
|
||
macro_rules! verify_no_overflow { | ||
($cf: ident, $uf: ident) => {{ | ||
let a: u8 = kani::nondet(); | ||
let b: u8 = kani::nondet(); | ||
let checked = a.$cf(b); | ||
kani::assume(checked.is_some()); | ||
let unchecked = unsafe { a.$uf(b) }; | ||
assert!(checked.unwrap() == unchecked); | ||
}}; | ||
} | ||
|
||
#[kani::proof] | ||
fn main() { | ||
verify_no_overflow!(checked_add, unchecked_add); | ||
verify_no_overflow!(checked_sub, unchecked_sub); | ||
verify_no_overflow!(checked_mul, unchecked_mul); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"description": "exact_div arguments divide exactly", | ||
"property": "main.exact_div.1", | ||
"status": "SUCCESS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
// kani-flags: --enable-unstable --use-piped-output | ||
|
||
#![feature(core_intrinsics)] | ||
|
||
#[kani::proof] | ||
fn main() { | ||
let a: u8 = 8; | ||
let b: u8 = 4; | ||
let i = unsafe { std::intrinsics::exact_div(a, b) }; | ||
assert!(i == 2); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"description": "resume instruction", | ||
"property": "<T as kani::Arbitrary>::any.unsupported_construct.1", | ||
"status": "SUCCESS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
// kani-flags: --enable-unstable --use-piped-output | ||
|
||
#[kani::proof] | ||
fn main() { | ||
let i: i32 = kani::any(); | ||
kani::assume(i < 10); | ||
kani::expect_fail(i > 20, "Blocked by assumption above."); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call is right after the call to
Instant::now()
, so it's not measuring verification time anymore.