Skip to content

Fastchess SPRT Test (Linux) #36

Fastchess SPRT Test (Linux)

Fastchess SPRT Test (Linux) #36

Workflow file for this run

name: Fastchess SPRT Test (Linux)
on:
workflow_dispatch:
inputs:
base_ref:
description: "Base branch, tag, or commit"
required: false
default: "HandcraftedEngine"
rounds:
description: "Max rounds for SPRT"
required: false
default: "6000"
tc:
description: "Time control (e.g. 60+0.5 or 10+0.1)"
required: false
default: "60+0.5"
output_exec:
description: "Executable output file name"
required: false
default: "chess_engine"
permissions:
contents: write
jobs:
build-new:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: test_chesslib
- name: Install deps
run: sudo apt update && sudo apt install -y build-essential cmake
- name: Build new engine
run: |
cd test_chesslib
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
- name: Upload new engine
uses: actions/upload-artifact@v4
with:
name: new-engine
path: test_chesslib/build/engine
build-base:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.base_ref }}
path: handcrafted
- name: Install deps
run: sudo apt update && sudo apt install -y build-essential cmake
- name: Build base engine
run: |
cd handcrafted
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
- name: Upload base engine
uses: actions/upload-artifact@v4
with:
name: base-engine
path: handcrafted/build/${{ github.event.inputs.output_exec }}
test:
runs-on: ubuntu-latest
needs: [build-new, build-base]
steps:
- name: Download engines
uses: actions/download-artifact@v4
- name: Install tools
run: |
sudo apt update
sudo apt install -y wget unzip
wget https://github.com/Disservin/fastchess/releases/download/v1.8.0-alpha/fastchess-linux-x86-64.tar
tar -xf fastchess-linux-x86-64.tar
chmod +x fastchess-linux-x86-64/fastchess
mv fastchess-linux-x86-64/fastchess fastchess
wget https://github.com/official-stockfish/books/raw/refs/heads/master/UHO_Lichess_4852_v1.epd.zip
unzip UHO_Lichess_4852_v1.epd.zip
wget https://github.com/michiguel/Ordo/releases/download/1.0/ordo-linux64
chmod +x ordo-linux64
chmod +x new-engine/engine
chmod +x base-engine/${{ github.event.inputs.output_exec }}
- name: Run fastchess
run: |
./fastchess -recover \
-engine cmd=new-engine/engine name=new \
-engine cmd=base-engine/${{ github.event.inputs.output_exec }} name=base \
-openings file=UHO_Lichess_4852_v1.epd format=epd order=random \
-each tc=${{ github.event.inputs.tc }} \
-rounds ${{ github.event.inputs.rounds }} \
-concurrency $(nproc) \
-pgnout notation=san nodes=true file=games.pgn \
-sprt elo0=0 elo1=2 alpha=0.05 beta=0.05
./ordo-linux64 -o ratings.txt -- games.pgn
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: results
path: |
games.pgn
ratings.txt