diff --git a/justfile b/justfile new file mode 100644 index 0000000..c5b5cda --- /dev/null +++ b/justfile @@ -0,0 +1,90 @@ +RELEASE_DIR := "target/release" +CUTECHESS_CLI_DIR := "$(pwd)/../cutechess-cli" + +# Run all tests +test-all: + cargo test -r + +# Run all tests except the perft suite +test: + cargo test -r -- --skip perft + +# Run only the perft suite +test-perft: + cargo test -r perft + +# Re-run tests (minus perft) on every change under src/ +watch: + cargo watch -c -w src -x 'test -r -- --skip perft' + +# Build, rotate current zeal -> zeal-old, install new as zeal (for SPRT). +release-switch: + #!/usr/bin/env bash + set -euo pipefail + cargo b -r + mv {{CUTECHESS_CLI_DIR}}/zeal {{CUTECHESS_CLI_DIR}}/zeal-old + cp {{RELEASE_DIR}}/zeal {{CUTECHESS_CLI_DIR}}/zeal + +# Build and install as zeal (no old-version rotation; for non-SPRT runs) +release: + #!/usr/bin/env bash + set -euo pipefail + cargo b -r + cp {{RELEASE_DIR}}/zeal {{CUTECHESS_CLI_DIR}}/zeal + +# Run SPRT tests between 2 zeal versions +run-sprt concurrency="1": + #!/usr/bin/env bash + set -euo pipefail + cd {{CUTECHESS_CLI_DIR}} + ./cutechess-cli \ + -engine cmd=./zeal name="zeal-new" proto=uci \ + -engine cmd=./zeal-old name="zeal-old" proto=uci \ + -openings file="8moves_v3.pgn" order=random format=pgn \ + -concurrency {{concurrency}} \ + -ratinginterval 100 \ + -games 10000 \ + -resign movecount=3 score=400 \ + -draw movenumber=40 movecount=3 score=10 \ + -repeat \ + -each tc=8+0.08 \ + -sprt elo0=0 elo1=10 alpha=0.05 beta=0.1 \ + -pgnout "$(pwd)/games.pgn" 2>&1 | tee {{CUTECHESS_CLI_DIR}}/sprt_log.txt + +# Run SPRT tests between 2 zeal versions with debug LOG enabled (10 games) +run-debug: + #!/usr/bin/env bash + set -euo pipefail + cd {{CUTECHESS_CLI_DIR}} + ./cutechess-cli \ + -engine cmd=./zeal name="zeal-new" proto=uci \ + -engine cmd=./zeal-old name="zeal-old" proto=uci \ + -openings file="8moves_v3.pgn" order=random format=pgn \ + -concurrency 1 \ + -ratinginterval 100 \ + -games 10 \ + -resign movecount=3 score=400 \ + -draw movenumber=40 movecount=3 score=10 \ + -repeat \ + -each tc=8+0.08 \ + -sprt elo0=0 elo1=10 alpha=0.05 beta=0.1 \ + -pgnout "$(pwd)/games.pgn" \ + -debug \ + 2> "$(pwd)/debug_log.txt" + +# Run tests between zeal and a stash version +run-ccrl: + #!/usr/bin/env bash + set -euo pipefail + cd {{CUTECHESS_CLI_DIR}} + ./cutechess-cli \ + -engine cmd=./zeal name="zeal" proto=uci \ + -engine cmd=./stash-15.0-linux-64 name="stash-15.0-linux-64" proto=uci \ + -openings file="8moves_v3.pgn" order=random format=pgn \ + -concurrency 6 \ + -ratinginterval 100 \ + -games 2000 \ + -resign movecount=3 score=400 \ + -draw movenumber=40 movecount=3 score=10 \ + -repeat \ + -each tc=8+0.08