AngeloWolff commited on
Commit
6f2fca7
·
verified ·
1 Parent(s): 66d0974

Snail Chess Data (part 2)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
README.md ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ pretty_name: Snail Chess Data
4
+ tags:
5
+ - chess
6
+ - self-play
7
+ - evaluation
8
+ size_categories:
9
+ - 10M<n<100M
10
+ viewer: false
11
+ ---
12
+
13
+ # Snail Chess Data
14
+
15
+ Chess positions from self-play games of [Snail Chess](https://github.com/CodeAdopter/Snail-Chess), the engine behind [Snail Chess GUI](https://github.com/CodeAdopter/Snail-Chess-Gui). Each position has the engine's search score and the game result. This is the data that trained **Shell**, Snail's evaluation network.
16
+
17
+ | | |
18
+ |---|---|
19
+ | Positions | 77.1 million |
20
+ | Games | 922,413 |
21
+ | Download | 0.7 GB (2.5 GB unpacked) |
22
+ | License | CC BY 4.0 |
23
+
24
+ ## Quick start
25
+
26
+ ```sh
27
+ pip install -U huggingface_hub numpy
28
+ hf download AngeloWolff/snail-chess-data --repo-type dataset --local-dir snail-chess-data
29
+ ```
30
+
31
+ Add `--include "data/gen6/*" --include "*.py"` to download a single generation.
32
+
33
+ ```python
34
+ import snail_data
35
+
36
+ records = snail_data.read("snail-chess-data/data/gen6/part00.bin.xz")
37
+
38
+ print(snail_data.to_fen(records[0])) # r1bqkb1r/ppp1ppp1/2np1n1p/8/3P4/3QPN2/PPP1BPPP/RNB1K2R b - - 0 1
39
+ print(records[0]["score"]) # search score in centipawns, White's view
40
+ print(records[0]["result"]) # 0 = black won, 1 = draw, 2 = white won
41
+
42
+ batch = records[:4096]
43
+ x = snail_data.planes(batch) # one-hot piece planes, shape (4096, 768)
44
+ y = snail_data.target(batch) # sigmoid(score / 120), the training target
45
+ ```
46
+
47
+ ## Generations
48
+
49
+ Snail learned by playing itself. Its old hand-written eval played the first games, a Shell net was trained on them, and each new net played the next generation.
50
+
51
+ | Generation | Positions | Played by | Nodes per move |
52
+ |---|---|---|---|
53
+ | gen0 | 10,962,132 | Snail Chess 1.15 (hand-written eval) | 5,000 |
54
+ | gen0b | 11,819,836 | Snail Chess 1.15 (hand-written eval) | 5,000 |
55
+ | gen1 | 9,154,571 | gen0b net | 5,000 |
56
+ | gen2 | 6,978,633 | gen1 net | 8,000 |
57
+ | gen3 | 7,500,400 | gen2 net | 8,000 |
58
+ | gen4 | 8,082,566 | Snail Chess 1.16 (gen3 net) | 20,000 |
59
+ | gen5 | 11,227,776 | gen4 net | 50,000 |
60
+ | gen6 | 11,374,723 | gen5 net | 100,000 |
61
+
62
+ - Games start from Snail's [opening books](#opening-books) plus one or two random moves. Each part's `.fen` file lists its openings.
63
+ - gen0 started from random moves instead. Its positions were too unusual, so later nets didn't use it.
64
+ - Only quiet positions were saved: not in check, best move not a capture or promotion, no mate score.
65
+
66
+ ## Opening books
67
+
68
+ The four books in `books/` were generated by Snail Chess 1.15:
69
+
70
+ | Book | Positions | Depth | Snail uses it for |
71
+ |---|---|---|---|
72
+ | `master.txt` | 24,794 | 20 plies | full strength |
73
+ | `neutral.txt` | 17,812 | 16 plies | the Balanced style |
74
+ | `gambit.txt` | 18,777 | 16 plies | the Aggressive style, lines that give up material |
75
+ | `passive.txt` | 17,678 | 16 plies | the Passive style, quiet lines with few captures |
76
+
77
+ Each line is a sequence of moves in UCI notation, a colon, then the next moves with their weights. A line starting with `:` gives the moves from the starting position:
78
+
79
+ ```
80
+ d2d4 : g8f6 100 d7d5 67 e7e6 42
81
+ ```
82
+
83
+ `openings.py` makes openings the way the games here started: a short weighted walk through a random book, plus random moves. It needs `pip install chess`.
84
+
85
+ ```sh
86
+ python openings.py openings.txt --count 160000 --random-plies 2
87
+ ```
88
+
89
+ ## How Shell was trained
90
+
91
+ | Net | Trained on | Released in |
92
+ |---|---|---|
93
+ | gen3 | gen0b–gen3 | Snail Chess 1.16 |
94
+ | gen4 | gen0b–gen4 | - |
95
+ | gen5 | gen2–gen5 | - |
96
+ | gen6 | gen3–gen6 | Snail Chess 1.17 |
97
+
98
+ - **Target:** `sigmoid(score / s)`, from search scores only, with `s` fitted to the data (120 for gen6).
99
+ - **Model:** Shell, a tiny gated network (a split-input clipped ReGLU) added to a small base eval.
100
+ - **Training:** mean squared error, Adam, 60 epochs.
101
+ - **Skipped:** positions with flag bit 1 set (about 14%), which the engine scales separately.
102
+
103
+ ## Record format
104
+
105
+ Each `data/genN/partNN.bin.xz` decompresses to an array of 32-byte little-endian records:
106
+
107
+ | Bytes | Field | Type | Meaning |
108
+ |---|---|---|---|
109
+ | 0–7 | `occupied` | u64 | bit *i* set = square *i* has a piece (a1 = 0, h8 = 63) |
110
+ | 8–23 | `pieces` | 32 × 4 bits | piece code of each occupied square, lowest square first, low nibble first |
111
+ | 24–25 | `score` | i16 | search score, centipawns, White's view |
112
+ | 26–27 | `base` | i16 | base eval, White's view |
113
+ | 28–29 | `eval` | i16 | full static eval, White's view |
114
+ | 30 | `flags` | u8 | bit 0: black to move; bit 1: endgame scaling |
115
+ | 31 | `result` | u8 | 0 = black won, 1 = draw, 2 = white won |
116
+
117
+ | | Pawn | Knight | Bishop | Rook | Queen | King |
118
+ |---|---|---|---|---|---|---|
119
+ | White | 2 | 4 | 6 | 8 | 10 | 12 |
120
+ | Black | 3 | 5 | 7 | 9 | 11 | 13 |
121
+
122
+ Castling rights and en passant squares are not stored.
123
+
124
+ ## License
125
+
126
+ CC BY 4.0. Snail Chess itself is GPL-3.0.
data/gen4/part09.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d880152b258572c48e0238c650e6d698eb22351e371ed2f3aca0ceb763115196
3
+ size 2285684
data/gen4/part09.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part10.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7bec56394060c88dfe248c30f418f303f24263ed979e18b51948e3dcb99bf325
3
+ size 2249028
data/gen4/part10.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part11.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09b724e48f05df2cbf380dd187a6df25d47c69f81d9c520d3f29b36067ffacd1
3
+ size 2262996
data/gen4/part11.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part12.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf70a8bb137e209521b3fbc1f9275b8986c1bb914b37db5d96ec2a71fed765d9
3
+ size 2259968
data/gen4/part12.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part13.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43fb1af2cdf04c7f6f9d9e62166f0c8ae2b6c0ec78e4d1bc4b68a82d9ddf0e5d
3
+ size 2268864
data/gen4/part13.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part14.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61df972fcae22d3b8060d0b476f6bb07184d987351938ec787126a343030b609
3
+ size 2255224
data/gen4/part14.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part15.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b67a2d1622705636d4b1ee15dc59aeb92e8b9eb8bbdf324670c1df356a94fb6e
3
+ size 2274640
data/gen4/part15.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part16.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b812eb35dc6fa525136333a7b3356e4f3ce7ef5eebe140a8c11e0f9d6d850be6
3
+ size 2246436
data/gen4/part16.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part17.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85c060819bf76437135c29ad46b3f3cafc1a2ce9f86e92db57f05c675aff6813
3
+ size 2242584
data/gen4/part17.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part18.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af2e8234e24a83fd6b1ab4122397e6a1f0a0aa3acfe9ed90d57b4469d2614cc1
3
+ size 2257384
data/gen4/part18.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part19.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44e5caaf2e0e922210c1095c6f9fadab60e7473f61471f44ca19be6624eaf1ca
3
+ size 2250800
data/gen4/part19.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part20.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b723c69152f8f12f454c8f7598b0b27c5f4305f124627e10e3260ee1687d6cc
3
+ size 2270880
data/gen4/part20.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part21.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5bc8123531b0a491b61b555f6994f31df249a5991a2069949ae60de21dbd4bb
3
+ size 2258852
data/gen4/part21.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part22.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a685a9ff63c955595bade00b40464122f2c3e2c05943f887b360c02607ccaf7
3
+ size 2267616
data/gen4/part22.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part23.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d1777690845e58480f80d2ec74f2f637700142a76fb2d4e56af4beecc9bcd81
3
+ size 2252980
data/gen4/part23.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part24.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:315866ec1df4900892b1fe1e143c4975357ceace8a12643d652d88229ca23897
3
+ size 2255360
data/gen4/part24.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part25.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d25848ef5c6e5747d932d03ce82d8592ee49440673d91278ab6e4383d84f1a0
3
+ size 2215024
data/gen4/part25.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part26.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3869c2ff2d1ec5ab0dd0de06c74f178d3423c88d34d6152b6e7a1678fd341c3
3
+ size 2245056
data/gen4/part26.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part27.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b2e8eba510e67a693e8f6ac9afc14d66429dd8ab76b077561a6c6f3d06bf7d5
3
+ size 2250232
data/gen4/part27.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part28.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:88173faa722b29066d98acfa88c5f2000b57e968010da39e2248aec31754c7d2
3
+ size 2258856
data/gen4/part28.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part29.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f51ed1d98597d4376572a81921466bb900cdc531626c32818514e1ef9168449
3
+ size 2262568
data/gen4/part29.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part30.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a5fa4c11eea0537b905f344edb35cfa140c9f4fa8df4127355bf52575c490f3
3
+ size 2246940
data/gen4/part30.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen4/part31.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73c9d82ba9d00c8e218ced36c958a404687c369a469b8ca1b36050507ee041bd
3
+ size 2258176
data/gen4/part31.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen5/part00.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10aa170cc5f270b6bcfb0d2fdb2efafc9a4da82211394bb695fb920150ffaf7f
3
+ size 3076024
data/gen5/part00.fen ADDED
The diff for this file is too large to render. See raw diff
 
data/gen5/part01.bin.xz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:708155c03b002d5668d11c1ee68401aa9bc0420223423ae93e2a63c981572ce2
3
+ size 3099084