bench/proof-systems: a failed run keeps its logs beside the row, labelled rows do not overwrite each other

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
igneum-labs 2026-10-06 12:56:07 +00:00
parent 37516b54a8
commit 791ce9f7c6

View file

@ -32,7 +32,9 @@ row() { # candidate backend host mode-env verify-mode
pkill -f sp1-gpu-server 2>/dev/null; rm -f /tmp/sp1-cuda-*.sock local wall; wall=$(python3 -c "import time; print(round(time.time() - $t0, 2))")
[ -n "$smi" ] && { kill $smi 2>/dev/null; sleep 1; }
local peak; if [ "$backend" = cuda ] && [ -s "$dir/smi.csv" ]; then peak=$(sort -n "$dir/smi.csv" | tail -1); else peak=$(peak_mib "$tlog"); fi
if [ $rc -ne 0 ] || [ ! -f "$res" ]; then printf '{"candidate":"%s","machine":"%s","backend":"%s","fixture":"%s","shard":%s,"na":"the prove run failed (exit %s): %s","date":"%s"}\n' "$cand" "$MACHINE" "$backend" "$(basename "$FIXTURE")" "$SHARD" "$rc" "$(grep -E 'RESULT|rror' "$plog" "$tlog" | tail -1 | tr -d '"' | cut -c1-200)" "$DATE" > "$OUT/$DATE-$MACHINE-$cand.json"; echo "row $cand: failed"; return; fi
# a failed run keeps its logs beside the row (6 October 2026: the 4060's three failures kept one line each)
if [ $rc -ne 0 ] || [ ! -f "$res" ]; then local tag; tag="$DATE-$MACHINE-$cand$( [ -n "$LABEL" ] && printf -- '-%s' "${LABEL// /-}" )"; cp "$plog" "$OUT/$tag.prove.log" 2>/dev/null; cp "$tlog" "$OUT/$tag.time.log" 2>/dev/null; fi
if [ $rc -ne 0 ] || [ ! -f "$res" ]; then printf '{"candidate":"%s","machine":"%s","backend":"%s","fixture":"%s","shard":%s,"na":"the prove run failed (exit %s): %s","date":"%s"}\n' "$cand" "$MACHINE" "$backend" "$(basename "$FIXTURE")" "$SHARD" "$rc" "$(grep -E 'RESULT|rror|panicked|out of memory|OOM' "$plog" "$tlog" | tail -1 | tr -d '"' | cut -c1-300)" "$DATE" > "$OUT/$DATE-$MACHINE-$cand$( [ -n "$LABEL" ] && printf -- '-%s' "${LABEL// /-}" ).json"; echo "row $cand: failed ($(grep -E 'panicked|out of memory|OOM|rror' "$plog" "$tlog" | tail -1 | cut -c1-160))"; return; fi
# the verify on one core, three runs
local stmt pf; stmt=$(python3 -c "import json; print(json.load(open('$res'))['statement'])"); pf=$(python3 -c "import json; print(json.load(open('$res'))['proof_file'])")
local vs=""; for i in 1 2 3; do local v0; v0=$(date +%s.%N); env $env "$host" --mode verify --proof "$pf" --statement "$stmt" > "$dir/verify-$i.log" 2>&1; local vrc=$?; vs="$vs$(python3 -c "import time; print(round(time.time() - $v0, 3))"),"; [ $vrc -ne 0 ] && { echo "row $cand: VERIFY FAILED"; break; }; done