#!/bin/bash # Clean-room check of the Zenodo archive on Linux: unzip into an empty directory, install only the # simbracket wheel from the archive (dependencies from the existing environment, nothing downloaded), # run the verifier and the equivalence test from source/, and recompute Appendix D from the bundled # history. Usage: cleanroom_check.sh set -e export OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 PY=~/torchenv/bin/python Z=$(readlink -f "$1") R=~/zenodo_cleanroom rm -rf $R && mkdir -p $R && cd $R $PY -c "import zipfile,sys; zipfile.ZipFile(sys.argv[1]).extractall('.')" "$Z" D=$(ls -d sim-numerics-*/) cd $R/$D echo "== checksums"; sha256sum -c --quiet SHA256SUMS && echo "all match" $PY -m pip install --quiet --no-deps --target $R/site wheels/simbracket-*-linux_x86_64.whl cd source export PYTHONPATH=$R/site:. $PY -c "import simbracket, simroot.pure; print('simbracket', simbracket.__file__); print('reference', simroot.pure.__file__)" echo "== verify_article.py" $PY -u verify_article.py > $R/verify.log 2>&1 || true echo "OK $(grep -c '^ OK' $R/verify.log) BAD $(grep -c '^ BAD' $R/verify.log)" grep '^ BAD' $R/verify.log || true grep -A6 '^Traceback' $R/verify.log || true tail -1 $R/verify.log echo "== equivalence test" $PY -m pytest tests/test_simbracket_equivalence.py -q -p no:cacheprovider 2>&1 | tail -1 echo "== Appendix D from the bundled history" cd $R && git clone --quiet $R/$D/sim-numerics.bundle hist && cd hist $PY -u check_prereg_order.py | grep '^| `' > $R/appD_from_history.txt grep '^| `' $R/$D/source/results_prereg_order.txt > $R/appD_in_archive.txt if diff -q $R/appD_from_history.txt $R/appD_in_archive.txt; then echo "Appendix D reproduced from the history: identical"; else echo "Appendix D DIFFERS"; fi grep -c '^| `' $R/appD_from_history.txt echo "=== CLEANROOM DONE ==="