Skip to content

Commit

Permalink
Reduce CBMC verbosity to CBMC's default
Browse files Browse the repository at this point in the history
CBMC v6 included changes to hide timing information and loop unwinding
status output at the default verbosity. To not impact Kani users, model-checking#2995
included changes to make Kani run CBMC with `--verbosity 9`. This change
now makes Kani run CBMC with just the default verbosity, hiding timing
information and loop unwinding status by default. If users still wish to
see this information, they can invoke Kani with
`--cbmc args --verbosity 9`.
  • Loading branch information
tautschnig committed Jul 31, 2024
1 parent e4078b4 commit 754dc57
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 13 deletions.
5 changes: 0 additions & 5 deletions kani-driver/src/call_cbmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ impl KaniSession {

args.push(file.to_owned().into_os_string());

// Make CBMC verbose by default to tell users about unwinding progress. This should be
// reviewed as CBMC's verbosity defaults evolve.
args.push("--verbosity".into());
args.push("9".into());

Ok(args)
}

Expand Down
3 changes: 2 additions & 1 deletion scripts/kani-perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ done
suite="perf"
mode="cargo-kani-test"
echo "Check compiletest suite=$suite mode=$mode"
cargo run -p compiletest -- --suite $suite --mode $mode --no-fail-fast
cargo run -p compiletest -- --suite $suite --mode $mode --no-fail-fast \
--kani-flag="--enable-unstable" --kani-flag="--cbmc-args" --kani-flag="--verbosity" --kani-flag="9"
exit_code=$?

echo "Cleaning up..."
Expand Down
2 changes: 1 addition & 1 deletion tests/cargo-kani/simple-kissat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ description = "Tests that Kani can be invoked with Kissat"

[kani.flags]
enable-unstable = true
cbmc-args = ["--external-sat-solver", "kissat" ]
cbmc-args = ["--external-sat-solver", "kissat", "--verbosity", "9" ]
1 change: 1 addition & 0 deletions tests/ui/solver-attribute/cadical/test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT
// kani-flags: --enable-unstable --cbmc-args --verbosity 9

//! Checks that `cadical` is a valid argument to `kani::solver`

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/solver-option/bin/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT
// kani-flags: --solver bin=kissat
// kani-flags: --solver bin=kissat --enable-unstable --cbmc-args --verbosity 9

//! Checks that `--solver` accepts `bin=<binary>`

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/solver-option/cadical/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT
// kani-flags: --solver cadical
// kani-flags: --solver cadical --enable-unstable --cbmc-args --verbosity 9

//! Checks that the `cadical` is supported as an argument to `--solver`

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/solver-option/kissat/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT
// kani-flags: --solver kissat
// kani-flags: --solver kissat --enable-unstable --cbmc-args --verbosity 9

//! Checks that the solver option overrides the solver attribute

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/solver-option/minisat/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT
// kani-flags: --solver minisat
// kani-flags: --solver minisat --enable-unstable --cbmc-args --verbosity 9

//! Checks that `--solver minisat` is accepted

Expand Down
6 changes: 4 additions & 2 deletions tools/benchcomp/test/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def test_kani_perf_fail(self):
cmd = (
"rm -rf build target &&"
"mkdir -p build/tests/perf/Unwind-Attribute/expected &&"
"kani tests/kani/Unwind-Attribute/fixme_lib.rs > "
"kani tests/kani/Unwind-Attribute/fixme_lib.rs "
"--enable-unstable --cbmc-args --verbosity 9 > "
"build/tests/perf/Unwind-Attribute/expected/expected.out"
)
self._run_kani_perf_test(cmd, False)
Expand All @@ -65,7 +66,8 @@ def test_kani_perf_success(self):
cmd = (
"rm -rf build target &&"
"mkdir -p build/tests/perf/Arbitrary/expected &&"
"kani tests/kani/Arbitrary/arbitrary_impls.rs > "
"kani tests/kani/Arbitrary/arbitrary_impls.rs "
"--enable-unstable --cbmc-args --verbosity 9 > "
"build/tests/perf/Arbitrary/expected/expected.out"
)
self._run_kani_perf_test(cmd, True)
Expand Down

0 comments on commit 754dc57

Please sign in to comment.