Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/evidence/om4-fn-table/probe.sh # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / evidence / om4-fn-table / probe.sh` 40 lines ยท 2287 bytes Raw Blame History 1 #!/bin/sh 2 # Probe for the om4 function-table prototype. Run from the repo root: sh evidence/om4-fn-table/probe.sh 3 set -u 4 W=build/om4probe; mkdir -p $W 5 NEW=seed/rung4/om4.bin 6 OLD=$W/om4.old; git -c gc.auto=0 show `57a4135d`:seed/rung4/om4.bin > $OLD; chmod +x $OLD 7 OMC=seed/out/omc 8 grow() { # k -> $W/g$k.om = omc.om + k one-line functions 9 { cat seed/omc/omc.om; awk -v k=$1 'BEGIN{for(i=0;i $W/g$1.om 10 } 11 run() { # bin src out -> prints rc and first stderr line 12 "$1" < "$2" > "$3" 2> "$3.err"; rc=$?; printf 'rc=%s %s' $rc "$(head -c 60 "$3.err")" 13 } 14 echo "== program mode: omc.om (495 fns) + k" 15 for k in 0 17 18 100 3601 3602; do 16 grow $k 17 o=$(run $OLD $W/g$k.om $W/old$k); n=$(run $NEW $W/g$k.om $W/new$k); c=$(run $OMC $W/g$k.om $W/omc$k) 18 same=$(cmp -s $W/new$k $W/omc$k && echo same || echo DIFF) 19 echo "k=$k total=$((495+k)) old:[$o] new:[$n] omc:[$c] new-vs-omc:$same" 20 done 21 echo "== grown compiler (k=100) birth: om4new -> g1 -> g2 -> g3" 22 chmod +x $W/new100; $W/new100 < $W/g100.om > $W/g2; chmod +x $W/g2; $W/g2 < $W/g100.om > $W/g3 23 for f in new100 g2 g3; do sha256sum $W/$f | cut -c1-16; done 24 echo "== function mode chains" 25 chain() { # n dir -> $W/c$2$1.om ; dir up: fK calls f(K-1); dir down: fK calls f(K+1) 26 awk -v n=$1 -v d=$2 'BEGIN{for(i=0;i $W/c$2$1.om 30 } 31 for spec in "512 up" "513 up" "4096 up" "4097 up" "512 down" "1024 down" "2048 down" "4096 down"; do 32 set -- $spec; chain $1 $2 33 t0=$(date +%s.%N); n=$(run $NEW $W/c$2$1.om $W/fn$2$1); t1=$(date +%s.%N) 34 o=$(run $OLD $W/c$2$1.om $W/fo$2$1); c=$(run $OMC $W/c$2$1.om $W/fc$2$1) 35 same=$(cmp -s $W/fn$2$1 $W/fc$2$1 && echo same || echo DIFF) 36 echo "fn-mode $2 n=$1 new:[$n] $(echo "$t1 - $t0" | bc)s old:[$o] omc:[$c] new-vs-omc:$same" 37 done 38 echo "== function mode cycle, 4096 functions (g_k calls g_(k+1) mod 4096)" 39 awk 'BEGIN{n=4096;for(i=0;i $W/cyc.om 40 for b in $NEW $OMC; do t0=$(date +%s.%N); r=$(run $b $W/cyc.om $W/cyc.out); echo "cycle $b [$r] $(echo "$(date +%s.%N) - $t0" | bc)s"; done