#!/bin/bash # Tests of q3_check at each even overlap from 26 to 64, with one full enumeration for each matrix. # The matrices come from q3_target.py (climbs) and from the signed permutation matrices. # 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_target.sh [PERK]' W=$(cd "$(dirname "$0")/../../.." && pwd) # the root of the workspace; this script is in work/capset/q0003 D=$W/work/capset/q0003 Q=$D/q3_check L=$D/logs T=$D/target PERK=${1:-10} mkdir -p "$L" { echo "start $(date -u +%Y-%m-%dT%H:%M:%SZ)" echo "binary sha256 $(shasum -a 256 "$Q" | cut -d' ' -f1)" for LAYER in 0 1; do python3 -I "$D/q3_target_select.py" "$LAYER" "$PERK" "$T" "$T/used_L$LAYER.txt"; done echo "matrices selected $(date -u +%Y-%m-%dT%H:%M:%SZ)" for LAYER in 0 1; do for G in 0 1 2 3; do { echo "=== layer $LAYER group $G start $(date -u +%Y-%m-%dT%H:%M:%SZ)" awk -v g="$G" '{ k=$1; if (int((k-26)/2)%4==g) print }' "$T/used_L$LAYER.txt" | while read k m; do echo "=== k $k start $(date -u +%Y-%m-%dT%H:%M:%SZ)" "$Q" one "$LAYER" "$m" 0 2000 echo "=== exit $?" done echo "=== layer $LAYER group $G end $(date -u +%Y-%m-%dT%H:%M:%SZ)"; } > "$L/q3_target_L${LAYER}_G$G.log" 2>&1 & done done wait for LAYER in 0 1; do cat "$L/q3_target_L${LAYER}_G0.log" "$L/q3_target_L${LAYER}_G1.log" "$L/q3_target_L${LAYER}_G2.log" "$L/q3_target_L${LAYER}_G3.log" > "$L/q3_target_L$LAYER.log"; done python3 -I "$D/q3_target_collect.py" "$L/q3_target_L0.log" "$L/q3_target_L1.log" > "$L/q3_target_collected.log" 2>&1 echo "end $(date -u +%Y-%m-%dT%H:%M:%SZ)" } > "$L/q3_target_run.log" 2>&1