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/yang/blob/main/scripts/check_dyadic_grid.sh # yang This project has not described itself yet. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `yang / scripts / check_dyadic_grid.sh` 47 lines ยท 2143 bytes Raw Blame History 1 #!/bin/sh 2 # Runs on Spark after build_and_run_spark.sh has synchronized the checkout. 3 set -eu 4 root=$1 5 omc=$2 6 build=$(mktemp -d) 7 trap 'rm -rf "$build"' EXIT 8 pin=$(sed -n 's/^omc_sha256=//p' "$root/PIN") 9 echo "$pin $omc" | sha256sum -c - 10 { echo om2; cat "$root/src/ufbi_math.om" "$root/src/ufbi_ivmath.om" "$root/scripts/dyadic_grid_dump.om"; } > "$build/unit.om" 11 "$omc" < "$build/unit.om" > "$build/dump" 12 chmod +x "$build/dump" 13 "$build/dump" > "$build/omega.tsv" 14 { echo om2; cat "$root/src/ufbi_math.om" "$root/src/ufbi_ivmath.om" "$root/src/ufbi_w2_dyadic.om" "$root/scripts/dyadic_w2_dump.om"; } > "$build/w2.om" 15 "$omc" < "$build/w2.om" > "$build/w2" 16 chmod +x "$build/w2" 17 "$build/w2" > "$build/w2-omega.tsv" 18 cd "${YANG_LEAN_BRIDGE:-$HOME/workspace/yang-lean-bridge}" 19 export PATH="$HOME/.elan/bin:$PATH" 20 lake env sh -ec ' 21 export LEAN_PATH="$1:$LEAN_PATH" 22 cd "$2" 23 for m in OpenAiYmBridge DobrushinShlosman WilsonPolymerBridge PhaseFourBridge OneLinkTransport DyadicTrig DyadicExp DyadicPartition DyadicPolarFlux DyadicEnergyReplay; do 24 lean -DmaxHeartbeats=450000 -R proofs -o "$1/$m.olean" "proofs/$m.lean" 25 done 26 lean --run scripts/ReplayDyadicTrig.lean > "$1/lean.tsv" 27 lean --run scripts/ReplayDyadicW2.lean > "$1/w2-lean.tsv" 28 ' sh "$build" "$root" 29 cmp "$build/omega.tsv" "$build/lean.tsv" 30 test "$(wc -l < "$build/lean.tsv")" = 2048 31 sha256sum "$build/lean.tsv" 32 echo 'DYADIC_GRID_REPLAY cells=2048 status=PASS' 33 cmp "$build/w2-omega.tsv" "$build/w2-lean.tsv" 34 test "$(wc -l < "$build/w2-lean.tsv")" = 2048 35 sha256sum "$build/w2-lean.tsv" 36 # A one-unit change to the computed polar energy must disagree with the reference. 37 sed 's/^par = fluxEnergy zLo$/par = add 1 fluxEnergy zLo/' "$build/w2.om" > "$build/w2-mutant.om" 38 "$omc" < "$build/w2-mutant.om" > "$build/w2-mutant" 39 chmod +x "$build/w2-mutant" 40 "$build/w2-mutant" > "$build/mutant.tsv" 41 test "$(wc -l < "$build/mutant.tsv")" = 2048 42 if cmp -s "$build/mutant.tsv" "$build/w2-lean.tsv"; then 43 echo 'W2_MUTATION undetected' >&2 44 exit 1 45 fi 46 echo 'W2_MUTATION polar_energy_plus_one detected' 47 echo 'DYADIC_W2_REPLAY couplings=16 field_boxes=2048 angle_cells_per_box=2048 status=PASS'