From dc7f7407e08f54e4a2a3c1d1723b2a7d6959532d Mon Sep 17 00:00:00 2001 From: Moon Flower Date: Wed, 14 Oct 2026 09:09:21 +0330 Subject: docs: archive the frozen stage code as one compressed tarball docs/history kept six stages with a full copy of the project under code/, 3.8 mb of sources duplicated from stage to stage and already superseded. store them as docs/history/code-snapshots.tar.gz, 0.66 mb, and extract one in place to read it. every stage's notes.md stays browsable, and the index says where the code went and how to get it back. the top-level README points at the archive too. its other two links into docs/history, 21-micro and 35-bench, were notes that were never kept and do not resolve; the index now records that. --- docs/history/15-o3/code/bench.sh | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100755 docs/history/15-o3/code/bench.sh (limited to 'docs/history/15-o3/code/bench.sh') diff --git a/docs/history/15-o3/code/bench.sh b/docs/history/15-o3/code/bench.sh deleted file mode 100755 index c5e5a83..0000000 --- a/docs/history/15-o3/code/bench.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# o3 against plain code: each kernel in tests/bench.zc on each backend, with -# the time to start up and compile (the 'z' run) taken off. needs bc. -cd "$(dirname "$0")"; T=$(mktemp -d); trap 'rm -rf $T' EXIT -gcc -O2 -w -DJTYPE=int core.c io_linux.c -o $T/zy -vms=("$T/zy"); names=("interp") -if command -v llvm-config >/dev/null; then - gcc -O2 -w -DJTYPE=int -DZYLLVM $(llvm-config --cflags) core.c io_linux.c -o $T/zyl $(llvm-config --ldflags --libs) && { vms+=("$T/zyl"); names+=("llvm"); } -fi -if command -v aarch64-linux-gnu-gcc >/dev/null && command -v qemu-aarch64 >/dev/null; then - aarch64-linux-gnu-gcc -O2 -w -DJTYPE=int -static core.c io_linux.c -o $T/zyj && { vms+=("qemu-aarch64 $T/zyj"); names+=("arm64 (qemu)"); } -fi -# seconds per run of kernel $2 on vm $1: the slope between $3 runs and 1 run, -# best of three each, so starting up and compiling cancel out -t(){ local s e; s=$(date +%s.%N); (cat tests/bench.zc; printf '`'$2$3) | $1 >/dev/null; e=$(date +%s.%N); echo "$e - $s" | bc; } -best(){ local b=999 x i; for i in 1 2 3; do x=$(t "$1" $2 $3); b=$(echo "if ($x < $b) $x else $b" | bc); done; echo $b; } -per(){ echo "scale=5; ($(best "$1" $2 $3) - $(best "$1" $2 1)) / ($3 - 1)" | bc; } -printf "%-14s %-8s %10s %10s %8s\n" backend kernel "plain ms" "o3 ms" speedup -for i in "${!vms[@]}"; do - n=41; [ "${names[$i]}" = interp ] && n=5 - for k in "collatz a b" "sieve c d" "digits e f" "fib g h"; do - set -- $k - p=$(per "${vms[$i]}" $2 5); o=$(per "${vms[$i]}" $3 $n) - printf "%-14s %-8s %10.2f %10.2f %7.1fx\n" "${names[$i]}" $1 $(echo "$p * 1000" | bc) $(echo "$o * 1000" | bc) $(echo "scale=2; $p / $o" | bc) - done -done -- cgit v1.2.3