Skip to content
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

Generate Kani Metrics #235

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
paths:
- 'doc/**'
- '.github/workflows/book.yml'
- 'scripts/kani-std-analysis/**'

jobs:
build:
Expand All @@ -18,6 +19,23 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/kani-std-analysis/requirements.txt
celinval marked this conversation as resolved.
Show resolved Hide resolved

- name: Generate Metrics Graphs
run: |
cd scripts/kani-std-analysis/
python kani_std_analysis.py --plot-only
cd ../..
mv scripts/kani-std-analysis/*.png doc/src/metrics/kani/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a mdbook pre-processor. Can you make sure we can still build the book if the png files are not there?

Copy link
Author

@carolynzech carolynzech Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done (sort of). I got it working for mdbook build doc but not mdbook build inside the doc/ directory. At the moment, I can't really see a way around it because we need to pass a --manifest-path to the preprocessor (this is how the example does it too).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


- name: Install mdbook
run: |
cargo install mdbook --version "^0.4" --locked
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/kani-metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Kani Metrics Update

on:
schedule:
- cron: '0 0 * * 0' # Run at 00:00 UTC every Sunday
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
update-kani-metrics:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true

# The Kani metrics collection uses a Python script (kani_std_analysis.py), so make sure Python is installed
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Compute Kani Metrics
run: ./scripts/run-kani.sh --run metrics --path ${{github.workspace}}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: Update Kani metrics
title: 'Update Kani Metrics'
body: |
This is an automated PR to update Kani metrics.

The metrics have been updated by running `./scripts/run-kani.sh --run metrics`.
branch: update-kani-metrics
delete-branch: true
base: main
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ package-lock.json
## Kani
*.out


# Added by cargo
#
# already existing elements were commented out
Expand Down
2 changes: 2 additions & 0 deletions doc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
- [Verification Tools](./tools.md)
- [Kani](./tools/kani.md)

- [Metrics](./metrics.md)
- [Kani](./metrics/kani/kani.md)

---

Expand Down
3 changes: 3 additions & 0 deletions doc/src/metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Metrics
carolynzech marked this conversation as resolved.
Show resolved Hide resolved

Each approved tool can (optionally) publish metrics here about how their tool has been applied to the effort thus far.
10 changes: 10 additions & 0 deletions doc/src/metrics/kani/kani.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Kani Metrics

Note that these metrics are for x86-64 architectures.

## `core`
![Unsafe Metrics](core_unsafe_metrics.png)

![Safe Abstractions Metrics](core_safe_abstractions_metrics.png)

![Safe Metrics](core_safe_metrics.png)
Loading
Loading