test(prove): a cut-off Kani run names what failed and what never finished

`just prove` ran its 97 fast harnesses under one 30-minute `timeout` and
nothing else. On a machine busy with other builds the run was ended with
exit 124 and no harness named, so a proof that failed could not be told
from a proof that was only slow, and the answer was to run it again and
hope. A gate that cannot say which is not a gate.

Now each harness has its own cap (Kani's --harness-timeout,
KANI_HARNESS_CAP, 900 s: the fast harnesses each take under four minutes
on a busy machine, the longer ones are in kani_slow under their own
caps), the whole set's cap is KANI_FAST_CAP (1800 s as before), and a
run that does not verify every harness lists each one that failed, each
that ran past its cap, and each that never finished.

No proof changes: the caps bound how long a harness may take, not what
it must show, and the count of verified harnesses and the cover check
are as they were.

Checked: the report read against a real run in which one harness passed
and one hit a 15 s cap (the second named as past its cap); and
`KANI_FAST_CAP=2 just _kani fast` exits 1 naming all 97 as not finished.
A full `just prove` is the batch's gate.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude committed 2026-11-09 17:54:45 -07:00
1 parent 647302f7e5
commit fe3b10e2d1
2 files changed
+45 -3

No files matched your search

+32 -2
View File
@@ -213,8 +213,38 @@ _kani set:
if [ "{{set}}" = fast ]; then
args=()
for h in $names; do args+=(--harness "$h"); done
timeout 1800 cargo kani -j "$(nproc)" --output-format terse --exact "${args[@]}" | tee "$logs/fast.log"
checked "$logs/fast.log" "$(wc -l <<<"$names")"
# Two caps, both in seconds. KANI_HARNESS_CAP is one harness's:
# Kani stops that harness and carries on with the rest.
# KANI_FAST_CAP is the whole set's: on a machine busy with other
# builds the set needs more than its 30 minutes, and until
# 2026-11-09 it was cut off there with exit 124 and nothing named.
# Either way the harnesses that failed and the ones that never
# finished are listed below.
status=0
timeout "${KANI_FAST_CAP:-1800}" cargo kani -j "$(nproc)" --output-format terse --exact \
-Z unstable-options --harness-timeout "${KANI_HARNESS_CAP:-900}s" "${args[@]}" |
tee "$logs/fast.log" || status=$?
if [ "$status" != 0 ] || ! checked "$logs/fast.log" "$(wc -l <<<"$names")"; then
# With -j Kani prints a harness's whole block when it ends:
# "Checking harness <name>..." down to its "VERIFICATION:-" line.
awk -v cap="${KANI_HARNESS_CAP:-900}" '
NR == FNR { asked[$1] = 1; next }
match($0, /Checking harness [^ ]+\.\.\./) { h = substr($0, RSTART + 17, RLENGTH - 20); next }
/VERIFICATION:- / && h != "" { ended[h] = 1; if ($0 !~ /VERIFICATION:- SUCCESSFUL/) failed[h] = 1; last = h; h = ""; next }
/CBMC timed out/ && last != "" { timed[last] = 1 }
END {
for (n in asked) {
if (n in timed) print "Kani: ran past its " cap " s (KANI_HARNESS_CAP): " n
else if (n in failed) print "Kani: FAILED: " n
else if (!(n in ended)) print "Kani: not finished: " n
}
}' <(printf '%s\n' $names) "$logs/fast.log" | sort >&2
if [ "$status" = 124 ]; then
echo "Kani: the fast set was cut off at ${KANI_FAST_CAP:-1800} s; on a busy machine give it longer (KANI_FAST_CAP=7200 just prove)" >&2
fi
echo "Kani (fast): not verified (exit $status), see $logs/fast.log" >&2
exit 1
fi
else
cargo kani --only-codegen --output-format terse
failed=0