Skip to content

Commit 22d39e0

Browse files
authored
Improve performance for align offset harness (model-checking#89)
Currently, this harness takes 21 minutes in CI. The only point of this harness is to verify the contract for pointee types with a non-power of two byte size--17 was an arbitrary choice. Reducing to 5 and changing the solver reduces verification time to 57 seconds on my local machine. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
1 parent 50faa97 commit 22d39e0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

library/core/src/ptr/mod.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -2552,8 +2552,12 @@ mod verify {
25522552
}
25532553

25542554
#[kani::proof_for_contract(align_offset)]
2555-
fn check_align_offset_17() {
2556-
let p = kani::any::<usize>() as *const [char; 17];
2555+
// The purpose of this harness is to test align_offset with a pointee type whose stride is not a power of two
2556+
// Keeping the size smaller (5) and changing the solver to kissat improves verification time
2557+
// c.f. https://github.com/model-checking/verify-rust-std/pull/89
2558+
#[kani::solver(kissat)]
2559+
fn check_align_offset_5() {
2560+
let p = kani::any::<usize>() as *const [char; 5];
25572561
check_align_offset(p);
25582562
}
25592563

0 commit comments

Comments
 (0)