Skip to content

Commit 08c4add

Browse files
authored
Better proof scripts for #45 (#46)
- Solving for #45 - put the commit hash of solana-token at the end of the proof directory - `setup.sh` uses the feature/p-token branch instead of predefined commit.
1 parent a8239c5 commit 08c4add

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

p-token/test-properties/run-proofs.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ if git -C mir-semantics status --porcelain 1>/dev/null 2>&1 && \
6565
MIR_COMMIT="${MIR_COMMIT}-dirty"
6666
fi
6767

68+
PROOF_DIR="artefacts/proof-${REPO_COMMIT}-${MIR_COMMIT}"
69+
mkdir -p "${PROOF_DIR}"
70+
6871
if [ -z "${RELOAD_OPT}" ]; then
6972
MODE="Continuing"
7073
else
@@ -84,7 +87,7 @@ for name in $TESTS; do
8487
timeout --preserve-status -v ${TIMEOUT} \
8588
uv --project mir-semantics/kmir run -- \
8689
kmir prove-rs --smir artefacts/p-token.smir.json \
87-
--proof-dir artefacts/proof --verbose --start-symbol $start ${RELOAD_OPT} ${PROVE_OPTS}
90+
--proof-dir "${PROOF_DIR}" --verbose --start-symbol $start ${RELOAD_OPT} ${PROVE_OPTS}
8891
prove_rc=$?
8992

9093
end_time=$(date +%s)
@@ -118,10 +121,10 @@ for name in $TESTS; do
118121
} > "${status_file}"
119122

120123
uv --project mir-semantics/kmir run -- \
121-
kmir show --proof-dir artefacts/proof p-token.smir.$start \
122-
--full-printer > artefacts/proof/${name}-full.txt
124+
kmir show --proof-dir "${PROOF_DIR}" p-token.smir.$start \
125+
--full-printer > "${PROOF_DIR}/${name}-full.txt"
123126
uv --project mir-semantics/kmir run -- \
124-
kmir show --dir artefacts/proof p-token.smir.$start \
127+
kmir show --proof-dir "${PROOF_DIR}" p-token.smir.$start \
125128
--statistics --leaves >> "${status_file}"
126129
echo "==========================================================================="
127130
done

p-token/test-properties/setup.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ if [ "$SKIP_SUBMODULES" = false ]; then
5151
echo "Refreshing git submodules..."
5252
git submodule update --init --recursive
5353
git submodule status --recursive
54+
55+
echo "Checking out mir-semantics at origin/feature/p-token..."
56+
if git -C mir-semantics status --porcelain | grep -v '^?? ' >/dev/null; then
57+
echo "Skipping checkout: tracked local changes detected."
58+
else
59+
git -C mir-semantics fetch origin feature/p-token
60+
git -C mir-semantics checkout --quiet origin/feature/p-token
61+
fi
5462
else
5563
echo "Skipping git submodule refresh..."
5664
fi

0 commit comments

Comments
 (0)