Skip to content

Commit 9242770

Browse files
chore: add docs for Justfile
bench: 760228
1 parent bac728d commit 9242770

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Justfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@ set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"]
22

33
default: (build)
44

5+
[group('dev')]
6+
[doc('Build the project (default is debug)')]
57
build 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)')]
913
test config="debug":
1014
echo "Running tests..."
1115
cargo test --workspace --all-features {{ if config=="release" {"--release"} else {""} }} -- --include-ignored
1216

1317
export LLVM_PROFILE_FILE:="./target/coverage/byte_knight-%p-%m.profraw"
18+
19+
[group('dev')]
20+
[doc('Generate test coverage')]
1421
coverage: (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')]
2433
purge-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')]
3344
lint:
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.')]
3650
search-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')]
4157
perft 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')]
4563
perft-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')]
4970
perft-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')]
5376
magics:
5477
echo "Generating magics..."
5578
cargo run --release --bin generate_magics
5679

80+
[group('chess')]
81+
[doc('Verify that generated Zobrist hashes are unique')]
5782
verify-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.')]
6188
release 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.')]
6594
cache-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.')]
69101
compare-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

Comments
 (0)