aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments/040-against-c/runs.sh
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-05 13:24:59 +0100
committereunhhu <[email protected]>2026-10-05 13:24:59 +0100
commit6b4580607efa698abdc07718f00c6cbdb425c210 (patch)
tree0cad9cddfd332140ecce47d17e439573f32ea11e /research/experiments/040-against-c/runs.sh
parent5a3466e8ff4d8f3c4271719b90858b7d08697dcd (diff)
downloadpure-6b4580607efa698abdc07718f00c6cbdb425c210.tar.gz
pure-6b4580607efa698abdc07718f00c6cbdb425c210.zip
Research 124's suite: seven kinds of work in one event each (roots, knapsack, sort, join, words, matmul, BFS), each against the C one would write, in one process with the same inputs and answers; PURE_AHEAD=0 to measure the code without reading ahead
Diffstat (limited to 'research/experiments/040-against-c/runs.sh')
-rw-r--r--research/experiments/040-against-c/runs.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/research/experiments/040-against-c/runs.sh b/research/experiments/040-against-c/runs.sh
new file mode 100644
index 0000000..3c83cf4
--- /dev/null
+++ b/research/experiments/040-against-c/runs.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# The runs of research 124's suite (docs/design/023), from the repository's
+# root, each under research/guard.py on a quiet Pi:
+# runs.sh build NAME COMMIT suite-run on COMMIT's core, and the
+# workloads' modules, in ~/.cache/pure-040/NAME
+# runs.sh suite NAME ROUNDS every workload on NAME: as it runs (JIT where
+# Linux AArch64), the executor alone
+# (PURE_JIT=0), and BFS without reading ahead
+# (PURE_AHEAD=0)
+set -e
+here=research/experiments/040-against-c
+builds=$HOME/.cache/pure-040
+day=$(date +%F)
+quiet() { until awk '{ exit !($1 < 1.5) }' /proc/loadavg; do sleep 10; done; }
+case "$1" in
+build)
+ rm -rf "$builds/src-$2"
+ git worktree add -f -q --detach "$builds/src-$2" "$3"
+ make -s -C "$builds/src-$2" build/libpure.a
+ mkdir -p "$builds/$2"
+ cc -O2 -g -std=c17 -I"$builds/src-$2/core" $here/suite-run.c "$builds/src-$2/build/libpure.a" -lm -o "$builds/$2/suite-run"
+ git worktree remove --force "$builds/src-$2"
+ for work in roots knapsack sort join words matmul; do ../aup/build/aup build $here/$work.aup -o "$builds/$2/$work.pmod"; done
+ ../aup/build/aup build research/experiments/033-computing/graph.aup -o "$builds/$2/graph.pmod" ;;
+suite)
+ quiet
+ echo "$2 $(uptime)" >> "$here/$day-load.txt"
+ python3 research/guard.py --most 3072 -- "$builds/$2/suite-run" "$builds/$2" "$3" \
+ | sed "s/^{/{\"version\":\"$2\",\"jit\":1,\"ahead\":1,/" >> "$here/$day-suite.jsonl"
+ quiet
+ PURE_JIT=0 python3 research/guard.py --most 3072 -- "$builds/$2/suite-run" "$builds/$2" "$3" \
+ | sed "s/^{/{\"version\":\"$2\",\"jit\":0,\"ahead\":1,/" >> "$here/$day-suite.jsonl"
+ quiet
+ PURE_AHEAD=0 python3 research/guard.py --most 3072 -- "$builds/$2/suite-run" "$builds/$2" "$3" bfs bfs_ahead \
+ | sed "s/^{/{\"version\":\"$2\",\"jit\":1,\"ahead\":0,/" >> "$here/$day-suite.jsonl" ;;
+*) echo "runs.sh build NAME COMMIT | suite NAME ROUNDS" >&2
+ exit 2 ;;
+esac