-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (105 loc) · 3.69 KB
/
games.yml
File metadata and controls
129 lines (105 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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 | tee results.txt
./ordo-linux64 -o ratings.txt -- games.pgn
sed -n '/Results of new vs base/,/^--------------------------------------------------$/p' results.txt >> ratings.txt
sed -n '/Total Time/,/^--------------------------------------------------$/p' results.txt >> ratings.txt
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: results
path: |
games.pgn
ratings.txt