Skip to content

Commit 0e5ded7

Browse files
jprider63cp526
authored andcommitted
Benchmark z3 and cvc5
1 parent 98434f0 commit 0e5ded7

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

Diff for: .github/workflows/ci-bench.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,23 @@ jobs:
9494
opam pin --yes --no-action add cn .
9595
opam install --yes cn ocamlformat.0.26.2
9696
97-
- name: Run benchmark
97+
- name: Run benchmarks
9898
run: |
9999
opam switch ${{ matrix.version }}
100100
eval $(opam env --switch=${{ matrix.version }})
101-
cd tests; USE_OPAM='' ./run-ci-benchmarks.sh
101+
cd tests; SOLVER='z3' ./run-ci-benchmarks.sh; SOLVER='cvc5' ./run-ci-benchmarks.sh
102102
cd ..
103103
104104
- name: Store benchmark result
105-
uses: benchmark-action/github-action-benchmark@v1
105+
uses: GaloisInc/github-action-benchmark@00bf34008c7b91a09ea7f1ef93330ccb7bf2d4ab
106106
with:
107107
name: CN Benchmarks
108108
tool: 'customSmallerIsBetter'
109-
output-file-path: tests/benchmark-data.json
109+
output-file-path: |
110+
{
111+
"z3": "tests/benchmark-data-z3.json",
112+
"cvc5": "tests/benchmark-data-cvc5.json"
113+
}
110114
# Access token to deploy GitHub Pages branch
111115
github-token: ${{ secrets.GITHUB_TOKEN }}
112116
# Push and deploy GitHub pages branch automatically

Diff for: tests/run-ci-benchmarks.sh

+12-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
set -euo pipefail -o noclobber
33
# set -xv # uncomment to debug variables
44

5-
JSON_FILE="benchmark-data.json"
5+
if [[ -z "${SOLVER+x}" ]]; then
6+
JSON_FILE="benchmark-data.json"
7+
SOLVER_TYPE="--solver-type=z3"
8+
else
9+
JSON_FILE="benchmark-data-${SOLVER}.json"
10+
SOLVER_TYPE="--solver-type=${SOLVER}"
11+
fi
612
TMP_FILE=$(mktemp)
713

814
echo "[" >> "${JSON_FILE}"
@@ -21,22 +27,22 @@ TOTAL=0
2127
for TEST in ${TESTS}; do
2228

2329
# Record wall clock time in seconds
24-
/usr/bin/time --quiet -f "%e" -o /tmp/time cn verify "${TEST}" || true
30+
/usr/bin/time --quiet -f "%e" -o /tmp/time cn verify "${SOLVER_TYPE}" "${TEST}" || true
2531
TIME=$(cat /tmp/time)
2632
TOTAL="$(echo "${TOTAL} + ${TIME}" | bc -l)"
2733

2834
# If we're last, don't print a trailing comma.
2935
if [[ ${INDEX} -eq ${COUNT}-1 ]]; then
3036
# Hack to output JSON.
31-
cat << EOF >> ${TMP_FILE}
37+
cat << EOF >> "${TMP_FILE}"
3238
{
3339
"name": "${TEST}",
3440
"unit": "Seconds",
3541
"value": ${TIME}
3642
}
3743
EOF
3844
else
39-
cat << EOF >> ${TMP_FILE}
45+
cat << EOF >> "${TMP_FILE}"
4046
{
4147
"name": "${TEST}",
4248
"unit": "Seconds",
@@ -48,15 +54,15 @@ EOF
4854
let INDEX=${INDEX}+1
4955
done
5056

51-
cat << EOF >> ${JSON_FILE}
57+
cat << EOF >> "${JSON_FILE}"
5258
{
5359
"name": "Total benchmark time",
5460
"unit": "Seconds",
5561
"value": ${TOTAL}
5662
},
5763
EOF
5864

59-
cat ${TMP_FILE} >> ${JSON_FILE}
65+
cat "${TMP_FILE}" >> "${JSON_FILE}"
6066

6167
echo "]" >> "${JSON_FILE}"
6268

0 commit comments

Comments
 (0)