#!/bin/bash # Direct test of the sign rules for an antipodal set U (IIS-Q-0003), in the clean environment. # Step 1: q3_signtest.py on the two layers. The matrix files are the files of the climbs of # run_target.sh and run_tight.sh (lines "k MATRIX"). # Step 2: a short summary of the two logs. # Clean environment: lean_env.sh sets the variables and removes the variables that can hold a secret. # usage (from the root of the workspace): /bin/bash -c '. work/lean_env.sh && bash work/capset/q0003/run_signtest.sh [PERK]' W=$(cd "$(dirname "$0")/../../.." && pwd) # the root of the workspace; this script is in work/capset/q0003 D=$W/work/capset/q0003 L=$D/logs T=$D/target PY3=/opt/homebrew/bin/python3 PERK=${1:-30} { echo "start $(date -u +%Y-%m-%dT%H:%M:%SZ)" echo "script sha256 $(shasum -a 256 "$D/q3_signtest.py" | cut -d' ' -f1)" echo "model log sha256 $(shasum -a 256 "$L/q3_cases.log" | cut -d' ' -f1)" echo "matrices for each k in the files: $(cat "$T"/target_L*_S*.txt | awk '{print $1}' | sort -n | uniq -c | tr -s ' \n' ';' | tr '\n' ' ')" echo "PERK $PERK" } > "$L/q3_signtest_run.log" 2>&1 for LAYER in 0 1; do "$PY3" -I "$D/q3_signtest.py" "$LAYER" "$PERK" "$L/q3_cases.log" "$T"/target_L${LAYER}_S*.txt > "$L/q3_signtest_L$LAYER.log" 2>&1 & done wait for LAYER in 0 1; do { echo "layer $LAYER exit lines"; /usr/bin/grep -c "" "$L/q3_signtest_L$LAYER.log"; /usr/bin/grep -n "Traceback\|Error\|SystemExit" "$L/q3_signtest_L$LAYER.log"; } >> "$L/q3_signtest_run.log" 2>&1 done { echo "end $(date -u +%Y-%m-%dT%H:%M:%SZ)"; } >> "$L/q3_signtest_run.log"