58 lines
3.3 KiB
Bash
Executable file
58 lines
3.3 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# The class v5 verifier cost against class v4 on igneum-build-1 (docs/design/class-v5-stored-state.md section 7), the
|
|
# latency ladder's method (tools/ladder/verify-bench-remote.sh): the cold verify of one 32-lane warp on the reference
|
|
# core (core 40, nice 19), alone and with its SMT sibling (core 88) running the same bench, plus the average of 50
|
|
# warps; class v4 at rung 0 against class v5 over the devnet's state stream (node 1's exec snapshot, 93 records).
|
|
#
|
|
# tools/class-v5/verify-bench-remote.sh [--pow <path on the box>] [--state <IGSD1 path on the box>] [--out <dir on the Mac>]
|
|
#
|
|
# Runs ON the box under its measure hold (infra/build-server/remote-run.sh BR_MEASURE=1), as the ladder's does.
|
|
set -euo pipefail
|
|
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
BS_TOOL=class-v5-verify-bench
|
|
# shellcheck source=../../infra/build-server/lib.sh
|
|
. "$HERE/../../infra/build-server/lib.sh"
|
|
POW=""; STATE="/srv/builds/_log/v5-class/node1-state.igsd1"; OUT=""
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
--pow) POW="$2"; shift 2 ;; --state) STATE="$2"; shift 2 ;; --out) OUT="$2"; shift 2 ;;
|
|
*) echo "unknown argument $1" >&2; exit 2 ;;
|
|
esac
|
|
done
|
|
bs_host
|
|
pushd "$HERE/../../igneum-pow" > /dev/null; bs_context; popd > /dev/null
|
|
WT_ROOT="$BS_WT_ROOT"
|
|
WT_NAME="$BS_WT"
|
|
POW="${POW:-/srv/builds/$WT_NAME/igneum-pow/target/release/igneum-pow}"
|
|
OUT="${OUT:-$WT_ROOT/docs/design/class-v5-bench}"
|
|
STAMP=$(date -u +%Y%m%dT%H%M%SZ)
|
|
REMOTE_OUT="/srv/builds/_log/v5-class/bench/$STAMP"
|
|
mkdir -p "$OUT"
|
|
read -r -d '' CMD <<EOF || true
|
|
set -u; mkdir -p '$REMOTE_OUT'; cd '$REMOTE_OUT'
|
|
echo "host \$(hostname) load \$(cut -d' ' -f1-3 /proc/loadavg) freq40 \$(cat /sys/devices/system/cpu/cpu40/cpufreq/scaling_cur_freq 2>/dev/null || echo ?) kHz siblings \$(cat /sys/devices/system/cpu/cpu40/topology/thread_siblings_list) pow \$(sha256sum '$POW' | cut -c1-16) state \$(sha256sum '$STATE' | cut -c1-16)" > meta.txt
|
|
for cls in v4 v5; do
|
|
extra=""; [ "\$cls" = v5 ] && extra="--state '$STATE'"
|
|
eval nice -n 19 taskset -c 40 '$POW' bench --seed igneum-genesis --day 2026-10-03 --program-class \$cls \$extra --warps 50 > alone-\$cls.txt 2>&1
|
|
eval nice -n 19 taskset -c 88 '$POW' bench --seed igneum-genesis --day 2026-10-03 --program-class \$cls \$extra --warps 4000 > sibling-\$cls.txt 2>&1 &
|
|
sib=\$!
|
|
sleep 1.5
|
|
eval nice -n 19 taskset -c 40 '$POW' bench --seed igneum-genesis --day 2026-10-03 --program-class \$cls \$extra --warps 50 > loaded-\$cls.txt 2>&1
|
|
kill \$sib 2>/dev/null; wait \$sib 2>/dev/null
|
|
echo "class \$cls done \$(date -u +%H:%M:%SZ)"
|
|
done
|
|
echo "load after \$(cut -d' ' -f1-3 /proc/loadavg)" >> meta.txt
|
|
EOF
|
|
bs_log "measuring class v4 and v5 verifier on $BS_HOST under the measure hold (pow $POW, state $STATE); results to $OUT"
|
|
BR_MEASURE=1 BR_KIND=measure BR_COMMAND="igneum-pow bench class v4 and v5 (core 40 alone, then with core 88 loaded)" BR_TARGET=x86_64-unknown-linux-gnu \
|
|
bs_remote_run "$(dirname "$POW")" "class v5 verifier bench" "$CMD"
|
|
bs_rsync -a "$BS_HOST:$REMOTE_OUT/" "$OUT/$STAMP/"
|
|
for cls in v4 v5; do
|
|
for kind in alone loaded; do
|
|
f="$OUT/$STAMP/$kind-$cls.txt"
|
|
cold=$(grep -o "single cold run[^0-9]*[0-9.]* ms" "$f" | head -1 || true)
|
|
avg=$(grep -i "CPU verify" "$f" | head -1 || true)
|
|
echo "$cls $kind: $cold | $avg"
|
|
done
|
|
done
|
|
cat "$OUT/$STAMP/meta.txt"
|