aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments/040-against-c/runs.sh
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-05 13:33:32 +0100
committereunhhu <[email protected]>2026-10-05 13:33:32 +0100
commitca1acb2be40c8c65af46ba83883cf20edb36c993 (patch)
treed360cee25d3b0cf2c72c01660e6d869c6969c231 /research/experiments/040-against-c/runs.sh
parenta5f3f6c4f79245103299befe14126834f5bc4ecd (diff)
downloadpure-ca1acb2be40c8c65af46ba83883cf20edb36c993.tar.gz
pure-ca1acb2be40c8c65af46ba83883cf20edb36c993.zip
Research 124's floors: each workload by hand as Pure could run it (its lists' representation, its meaning) bare, with the checks a compiler could hoist, and with every check where the meaning puts it: hoisted 0.64-1.02x C (0.90 by the geometric mean), naive up to 12x
Diffstat (limited to 'research/experiments/040-against-c/runs.sh')
-rw-r--r--research/experiments/040-against-c/runs.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/research/experiments/040-against-c/runs.sh b/research/experiments/040-against-c/runs.sh
index 3c83cf4..8c1620b 100644
--- a/research/experiments/040-against-c/runs.sh
+++ b/research/experiments/040-against-c/runs.sh
@@ -7,6 +7,8 @@
# Linux AArch64), the executor alone
# (PURE_JIT=0), and BFS without reading ahead
# (PURE_AHEAD=0)
+# runs.sh floor ROUNDS floor.c's three modes (bare, hoisted, naive),
+# each against natural.h's C
set -e
here=research/experiments/040-against-c
builds=$HOME/.cache/pure-040
@@ -33,6 +35,12 @@ suite)
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
+floor)
+ for mode in 0 1 2; do
+ cc -O2 -std=c17 -DMODE=$mode -o "$builds/floor-$mode" $here/floor.c -lm
+ quiet
+ python3 research/guard.py --most 2048 -- "$builds/floor-$mode" "$2" >> "$here/$day-floor.jsonl"
+ done ;;
+*) echo "runs.sh build NAME COMMIT | suite NAME ROUNDS | floor ROUNDS" >&2
exit 2 ;;
esac