Skip to content

Commit f5a4899

Browse files
committed
only run on Ubuntu
1 parent 93676cd commit f5a4899

File tree

4 files changed

+26
-36
lines changed

4 files changed

+26
-36
lines changed

metrics-data.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

scripts/kani-std-analysis/kani_std_analysis.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# 3. Comparing the output of steps #1 and #2 to compare the Kani-verified portion of the standard library to the overall library,
1717
# e.g., what fraction of unsafe functions have Kani contracts.
1818
# Note that this script assumes that std-analysis.sh and `kani list` have already run, since we expect to invoke this script from `run-kani.sh`.
19+
# Also note that the results are architecture-dependent: the standard library has functions that are only present for certain architectures,
20+
# and https://github.com/model-checking/verify-rust-std/pull/122 has Kani harnesses that only run on x86-64.
1921

2022
# Process the results from Kani's std-analysis.sh script for each crate.
2123
# TODO For now, we just handle "core", but we should process all crates in the library.
@@ -256,13 +258,13 @@ def plot(self):
256258
def main():
257259
parser = argparse.ArgumentParser(description="Generate metrics about Kani's application to the standard library.")
258260
parser.add_argument('--metrics-file',
259-
type=str,
260-
required=True,
261-
help="Path to the JSON file containing metrics data")
261+
type=str,
262+
default="metrics-data.json",
263+
help="Path to the JSON file containing metrics data (default: metrics-data.json)")
262264
parser.add_argument('--kani-list-file',
263-
type=str,
264-
required=True,
265-
help="Path to the JSON file containing the Kani list data")
265+
type=str,
266+
default="kani-list.json",
267+
help="Path to the JSON file containing the Kani list data (default: kani-list.json)")
266268
args = parser.parse_args()
267269

268270
metrics = KaniSTDMetricsOverTime(args.metrics_file)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"results": [
3+
{
4+
"date": "2025-01-01",
5+
"total_unsafe_fns": 6987,
6+
"total_safe_abstractions": 1704,
7+
"unsafe_fns_under_contract": 144,
8+
"verified_unsafe_fns_under_contract": 132,
9+
"safe_abstractions_under_contract": 41,
10+
"verified_safe_abstractions_under_contract": 41,
11+
"safe_fns_under_contract": 39,
12+
"verified_safe_fns_under_contract": 38,
13+
"total_functions_under_contract": 224
14+
}
15+
]
16+
}

scripts/run-kani.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,17 @@ main() {
297297
echo "Running Kani list command..."
298298
"$kani_path" list -Z list $unstable_args ./library --std --format markdown
299299
elif [[ "$run_command" == "metrics" ]]; then
300-
local current_dir=$(pwd)
301300
echo "Computing Kani-specific metrics..."
302301
echo "Running Kani list command..."
303302
"$kani_path" list -Z list $unstable_args ./library --std --format json
303+
mv $(pwd)/kani-list.json scripts/kani-std-analysis/kani-list.json
304304
echo "Running Kani's std-analysis command..."
305305
pushd $build_dir
306306
./scripts/std-analysis.sh
307307
popd
308308
pushd scripts/kani-std-analysis
309309
pip install -r requirements.txt
310-
./kani_std_analysis.py --metrics-file ${current_dir}/metrics-data.json --kani-list-file ${current_dir}/kani-list.json
310+
./kani_std_analysis.py
311311
popd
312312
fi
313313
}

0 commit comments

Comments
 (0)