#!/bin/bash
# warm_table.sh <fixtureβ¦> β in-process proving with the proving key held
# (`fast_path` with FAST_KEY=1, median of FAST_REPS, default 5), per
# backend, with the process's peak RSS. The held-key proof is asserted
# byte-equal to the cold one on every run.
#
# FAST_PATH the example binary: cargo build --release -p zheng --example
# fast_path, then $CARGO_TARGET_DIR/release/examples/fast_path
# BACKENDS default "metal cpu webgpu"
X=
for; do
for; do
out=$( { FAST_KEY=1 FAST_REPS=$ ZHENG_BACKEND=$b /usr/bin/time -l "$X" ""; } 2>&1 )
row=$(echo "$out" |
warm=$(echo "$out" | sed -nE 's/.*key ([0-9.]+) ms once; warm prove ([0-9.]+) ms.*/key \1 warm \2/p')
rss=$(echo "$out" |
done
done