Skip to content

Commit 0f66552

Browse files
Update CBMC dependency to 6.10.0 (#4619)
Upgrading to 6.9.0 requires changes as described below. Upgrading from 6.9.0 to 6.10.0 does not require any further changes. Changes in CBMC's set of static objects require retuning shadow-memory object-count test: The `unsupported_num_objects` test depends on CBMC's internal object-ID numbering: it creates N objects and expects the (N+k)-th object's ID to cross Kani's 1024-object shadow-memory limit. Newer CBMC allocates one fewer auxiliary object, so the previous N values (1019 pass / 1020 fail) no longer straddle the limit -- the fail harness verified successfully instead of failing. Bump the thresholds by one (1020 pass / 1021 fail) to restore the boundary, update the explanatory comment, and note that these counts are sensitive to CBMC's object numbering and may need adjusting on future CBMC upgrades. CBMC 6.10 makes the `slow` harness's Display/`to_string` formatting path far more memory-heavy: the original `"foo"`/unwind(6) version peaks at ~26 GB with Kani's default Cadical solver and deterministically OOM-kills the 16 GB GitHub-hosted `perf` runner ("runner has received a shutdown signal"). No solver is both under 16 GB and fast enough (minisat2/kissat stay ~8 GB but do not finish in >15 min), so the harness itself must shrink. Use an empty payload (formatted result `"A."`) and unwind(3) -- the smallest bound that still fully unrolls the formatting loops. This keeps peak memory to ~11 GB while still exercising the trait/formatting path the test guards. Both harnesses verify successfully. Resolves: #4605 Resolves: #4617 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. --------- Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
1 parent bea7ba4 commit 0f66552

3 files changed

Lines changed: 24 additions & 13 deletions

File tree

kani-dependencies

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CBMC_MAJOR="6"
2-
CBMC_MINOR="8"
3-
CBMC_VERSION="6.8.0"
2+
CBMC_MINOR="10"
3+
CBMC_VERSION="6.10.0"
44

55
KISSAT_VERSION="4.0.1"

tests/expected/shadow/unsupported_num_objects/test.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ static mut SM: kani::shadow::ShadowMem<bool> = kani::shadow::ShadowMem::new(fals
99

1010
fn check_max_objects<const N: usize>() {
1111
let mut i = 0;
12-
// A dummy loop that creates `N`` objects.
13-
// After the loop, CBMC's object ID counter should be at `N` + 3:
12+
// A dummy loop that creates `N` objects.
13+
// After the loop, CBMC's object ID counter should be at `N` + 2:
1414
// - `N` created in the loop +
1515
// - the NULL pointer whose object ID is 0, and
1616
// - objects for i, have_42
17+
// Note: the exact object count depends on CBMC's internal object
18+
// numbering, so the `N` thresholds below may need to be adjusted when
19+
// upgrading CBMC.
1720
let mut have_42 = false;
1821
while i < N {
1922
let x: Box<usize> = Box::new(kani::any());
@@ -23,7 +26,7 @@ fn check_max_objects<const N: usize>() {
2326
i += 1;
2427
}
2528

26-
// create a new object whose ID is `N` + 4
29+
// create a new object whose ID is `N` + 3
2730
let x: i32 = have_42 as i32;
2831
assert_eq!(x, have_42 as i32);
2932
// the following call to `set` would fail if the object ID for `x` exceeds
@@ -35,10 +38,10 @@ fn check_max_objects<const N: usize>() {
3538

3639
#[kani::proof]
3740
fn check_max_objects_pass() {
38-
check_max_objects::<1019>();
41+
check_max_objects::<1020>();
3942
}
4043

4144
#[kani::proof]
4245
fn check_max_objects_fail() {
43-
check_max_objects::<1020>();
46+
check_max_objects::<1021>();
4447
}

tests/perf/misc/display_trait/src/main.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
//! This test checks the performance when adding in the Display trait.
55
//! The test is from https://github.com/model-checking/kani/issues/1996
66
//! With CBMC 5.79.0, all harnesses take ~3 seconds
7+
//!
8+
//! The input string and `kani::unwind` bound are deliberately minimal. The
9+
//! `slow` harness exercises the `Display`/`to_string` formatting path, whose
10+
//! SAT encoding is memory-heavy on newer CBMC: the original `"foo"`/unwind(6)
11+
//! version peaked at ~26 GB on CBMC 6.10 and OOM-killed the 16 GB `perf`
12+
//! runner. An empty payload (formatted result `"A."`) with the smallest unwind
13+
//! that still fully unrolls the formatting loops keeps peak memory to ~11 GB
14+
//! while still covering the trait/formatting path this test is meant to guard.
715
use std::fmt::Display;
816

917
enum Foo {
@@ -23,20 +31,20 @@ impl Display for Foo {
2331
}
2432

2533
#[kani::proof]
26-
#[kani::unwind(6)]
34+
#[kani::unwind(3)]
2735
fn fast() {
28-
let a = Foo::A(String::from("foo"));
36+
let a = Foo::A(String::from(""));
2937
let s = match a {
3038
Foo::A(s) => format!("A.{s}"),
3139
Foo::B(s) => format!("B.{s}"),
3240
};
33-
assert_eq!(s, "A.foo");
41+
assert_eq!(s, "A.");
3442
}
3543

3644
#[kani::proof]
37-
#[kani::unwind(6)]
45+
#[kani::unwind(3)]
3846
fn slow() {
39-
let a = Foo::A(String::from("foo"));
47+
let a = Foo::A(String::from(""));
4048
let s = a.to_string();
41-
assert_eq!(s, "A.foo");
49+
assert_eq!(s, "A.");
4250
}

0 commit comments

Comments
 (0)