Datasets:
File size: 1,432 Bytes
870b85a 3f15e9f 870b85a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #!/bin/bash
# Run the real chain (build-shell, prepare, execute) on one converted RPLAN plan per kind, one after the other, on a fixed code snapshot.
# usage: run_trials.sh <trial dir from pick_trials.py> <name prefix> <kind> [<kind> ...]
set -u
TREE=$(cd "$(dirname "$0")/../.." && pwd)
resolve_path() {
PYTHONPATH="$TREE${PYTHONPATH:+:$PYTHONPATH}" python3 -B -c 'import rhg_paths,sys; print(rhg_paths.resolve(sys.argv[1] or sys.argv[2]))' "$1" "$2"
}
H=$(resolve_path "${RHG_TRIAL_HOME:-}" '${RHG_WORKSPACE_ROOT}/hayfung') || exit 1
SNAP=$(resolve_path "${RHG_TRIAL_SNAPSHOT:-}" '${RHG_WORKSPACE_ROOT}/generic_20261101/snap_envelope_20261108_2132g') || exit 1
DRIVER=$(resolve_path "${RHG_TRIAL_DRIVER:-}" '${RHG_WORKSPACE_ROOT}/random_e2e_20261104/driver/run_random_e2e_v6.py') || exit 1
TRIALS=$1; PREFIX=$2; shift 2
for kind in "$@"; do
exp=$H/validation/${PREFIX}_$kind
seed=$(/usr/bin/python3 -c "import random; print(random.Random('$kind').randrange(2**31))")
export RHG_RPLAN_SEEDS=$TRIALS/$kind.json
/usr/bin/python3 $DRIVER setup --root $SNAP --exp $exp --seeds $seed \
--seed-origin "seed fixed by the kind name; the library holds one converted RPLAN plan ($kind), see hayfung/rplan_full"
/usr/bin/python3 $DRIVER run --exp $exp > $exp.driver.log 2>&1
echo "$(date +%T) $kind finished: $(/usr/bin/python3 -c "import json;print([r['status'] for r in json.load(open('$exp/results.json'))])" 2>&1)"
done
|