@@ -2,15 +2,22 @@ set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"]
22
33default : (build )
44
5+ [group (' dev' )]
6+ [doc (' Build the project (default is debug)' )]
57build config = " debug":
68 echo " Building the project..."
79 cargo build --workspace --all-features {{ if config== " release" {" --release" } else {" " } }}
810
11+ [group (' dev' )]
12+ [doc (' Build and run tests (default is debug)' )]
913test config = " debug":
1014 echo " Running tests..."
1115 cargo test --workspace --all-features {{ if config== " release" {" --release" } else {" " } }} -- --include-ignored
1216
1317export LLVM_PROFILE_FILE := " ./target/coverage/byte_knight-%p-%m.profraw"
18+
19+ [group (' dev' )]
20+ [doc (' Generate test coverage' )]
1421coverage : (build " debug" )
1522 echo " Running tests with coverage..."
1623 mkdir -p target/ coverage
@@ -21,6 +28,8 @@ coverage: (build "debug")
2128 - -branch --keep-only " src/*" --keep-only " engine/*" --keep-only " chess/*" \
2229 - -ignore " src/bin/byte-knight/*" --ignore " chess/src/perft*"
2330
31+ [group (' dev' )]
32+ [doc (' Purge files generated by @coverage' )]
2433purge-coverage :
2534 echo " Purging coverage data..."
2635 rm -rf *.profraw
@@ -30,42 +39,65 @@ purge-coverage:
3039 rm -rf chess/ *.profraw
3140 rm -rf engine/ *.profraw
3241
42+ [group (' dev' )]
43+ [doc (' Run clippy' )]
3344lint :
3445 cargo clippy --all --all-features --tests -- -D warnings
3546
47+ [group (' chess' )]
48+ [group (' performance' )]
49+ [doc (' Run sarch benchmark - required before committing for OpenBench.' )]
3650search-bench :
3751 echo " Running search benchmark..."
3852 cargo rustc --release --bin byte-knight -- -C target-cpu=native
3953 ./ target/ release/ byte-knight bench
4054
55+ [group (' chess' )]
56+ [doc (' Run perft at a specified depth' )]
4157perft depth :
4258 echo " Running perft..."
4359 cargo run --release --bin perft -- -d {{ depth }}
4460
61+ [group (' chess' )]
62+ [doc (' Run perft over the EPD test suite' )]
4563perft-epd :
4664 echo " Running EPD perft test suite..."
4765 cargo run --release --bin perft -- --epd-file data/ standard.epd
4866
67+ [group (' chess' )]
68+ [group (' performance' )]
69+ [doc (' Run perft benchmark over the EPD test suite' )]
4970perft-bench :
5071 echo " Running perft benchmark..."
5172 cargo run --release --bin perft-bench -- -e data/ standard.epd
5273
74+ [group (' chess' )]
75+ [doc (' Generate magic numbers use for magic bitboards' )]
5376magics :
5477 echo " Generating magics..."
5578 cargo run --release --bin generate_magics
5679
80+ [group (' chess' )]
81+ [doc (' Verify that generated Zobrist hashes are unique' )]
5782verify-zobrist :
5883 echo " Verifying Zobrist hash..."
5984 cargo run --release --bin verify_zobrist
6085
86+ [group (' dev' )]
87+ [doc (' Generate release binaries for given target.' )]
6188release target :
6289 echo " Building release binaries..."
6390 cargo rustc --release --bin byte-knight --target={{ target }}
6491
92+ [group (' dev' )]
93+ [doc (' Caches the release binary to bk-main for testing.' )]
6594cache-main : (build " release" )
6695 echo " Caching binary for testing..."
6796 cp target/ release/ byte-knight ./ bk-main
6897
98+ [group (' dev' )]
99+ [group (' chess' )]
100+ [doc (' Run the engine against itself. Requires @cache-main to be run first and fastchess to be installed.' )]
69101compare-to-main engine1 : (build " release" )
70102 echo " Comparing {{ engine1 }} to bk-main"
71103 fastchess -engine cmd=" {{ engine1 }} " name=" dev" -engine cmd=" ./bk-main" name=" bk-main" -openings file=" ./data/Pohl.epd" format=epd order=random -each tc=10 + 0.1 -rounds 200 -repeat -concurrency 8 -sprt elo0=0 elo1=5 alpha=0.05 beta=0.1 model=normalized -output format=cutechess
0 commit comments