esca 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. {esca-0.2.0 → esca-0.3.0}/Cargo.lock +72 -2
  2. {esca-0.2.0 → esca-0.3.0}/PKG-INFO +27 -3
  3. {esca-0.2.0/esca → esca-0.3.0}/README.md +26 -2
  4. {esca-0.2.0 → esca-0.3.0}/esca/Cargo.toml +17 -1
  5. {esca-0.2.0 → esca-0.3.0/esca}/README.md +26 -2
  6. esca-0.3.0/esca/data/openings/a.tsv +818 -0
  7. esca-0.3.0/esca/data/openings/b.tsv +773 -0
  8. esca-0.3.0/esca/data/openings/c.tsv +1251 -0
  9. esca-0.3.0/esca/data/openings/d.tsv +615 -0
  10. esca-0.3.0/esca/data/openings/e.tsv +358 -0
  11. esca-0.3.0/esca/python/tests/test_explain.py +859 -0
  12. esca-0.3.0/esca/python/tests/test_openings.py +107 -0
  13. esca-0.3.0/esca/python/tests/test_polyglot.py +408 -0
  14. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_stubs.py +12 -0
  15. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_uci.py +9 -51
  16. esca-0.3.0/esca/python/tests/test_uci_async.py +455 -0
  17. esca-0.3.0/esca/python/tests/test_uci_protocol.py +392 -0
  18. esca-0.3.0/esca/src/explain.rs +751 -0
  19. {esca-0.2.0 → esca-0.3.0}/esca/src/facts/mod.rs +1 -1
  20. {esca-0.2.0 → esca-0.3.0}/esca/src/lib.rs +6 -0
  21. esca-0.3.0/esca/src/openings.rs +105 -0
  22. esca-0.3.0/esca/src/polyglot/build.rs +102 -0
  23. esca-0.3.0/esca/src/polyglot/mod.rs +363 -0
  24. {esca-0.2.0 → esca-0.3.0}/esca/src/position.rs +20 -1
  25. {esca-0.2.0 → esca-0.3.0}/esca/src/python/board.rs +95 -2
  26. {esca-0.2.0 → esca-0.3.0}/esca/src/python/convert.rs +11 -0
  27. esca-0.3.0/esca/src/python/explain.rs +682 -0
  28. {esca-0.2.0 → esca-0.3.0}/esca/src/python/mod.rs +26 -0
  29. esca-0.3.0/esca/src/python/openings.rs +69 -0
  30. esca-0.3.0/esca/src/python/polyglot.rs +356 -0
  31. {esca-0.2.0 → esca-0.3.0}/esca/src/python/uci.rs +327 -1
  32. {esca-0.2.0 → esca-0.3.0}/esca/src/uci/engine.rs +55 -19
  33. esca-0.3.0/esca/src/uci/lines.rs +73 -0
  34. {esca-0.2.0 → esca-0.3.0}/esca/src/uci/mod.rs +8 -2
  35. esca-0.3.0/esca/src/uci/tokio.rs +656 -0
  36. esca-0.3.0/esca/src/zobrist.rs +274 -0
  37. esca-0.3.0/esca/tests/data/tiny.bin +0 -0
  38. esca-0.3.0/esca/tests/double/mod.rs +92 -0
  39. esca-0.3.0/esca/tests/explain.rs +887 -0
  40. {esca-0.2.0 → esca-0.3.0}/esca/tests/fixtures/fake_engine.py +8 -0
  41. esca-0.3.0/esca/tests/openings.rs +118 -0
  42. esca-0.3.0/esca/tests/polyglot.rs +469 -0
  43. {esca-0.2.0 → esca-0.3.0}/esca/tests/uci_engine.rs +53 -82
  44. esca-0.3.0/esca/tests/uci_tokio.rs +624 -0
  45. {esca-0.2.0 → esca-0.3.0}/pyproject.toml +1 -1
  46. {esca-0.2.0 → esca-0.3.0}/python/esca/__init__.py +4 -1
  47. {esca-0.2.0 → esca-0.3.0}/python/esca/__init__.pyi +4 -1
  48. {esca-0.2.0 → esca-0.3.0}/python/esca/_esca.pyi +350 -0
  49. esca-0.3.0/python/esca/explain.py +43 -0
  50. esca-0.3.0/python/esca/explain.pyi +35 -0
  51. esca-0.3.0/python/esca/openings.py +7 -0
  52. esca-0.3.0/python/esca/openings.pyi +5 -0
  53. esca-0.3.0/python/esca/polyglot.py +54 -0
  54. esca-0.3.0/python/esca/polyglot.pyi +24 -0
  55. esca-0.3.0/python/esca/uci/__init__.py +556 -0
  56. esca-0.3.0/python/esca/uci/protocol.py +10 -0
  57. esca-0.2.0/python/esca/uci.py +0 -232
  58. {esca-0.2.0 → esca-0.3.0}/Cargo.toml +0 -0
  59. {esca-0.2.0 → esca-0.3.0}/esca/CLAUDE.md +0 -0
  60. {esca-0.2.0 → esca-0.3.0}/esca/benches/facts.rs +0 -0
  61. {esca-0.2.0 → esca-0.3.0}/esca/examples/fixtures.rs +0 -0
  62. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/conftest.py +0 -0
  63. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_board.py +0 -0
  64. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_encode.py +0 -0
  65. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts.py +0 -0
  66. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_attacks.py +0 -0
  67. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_endgame.py +0 -0
  68. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_exchange.py +0 -0
  69. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_history.py +0 -0
  70. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_king.py +0 -0
  71. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_material.py +0 -0
  72. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_mobility.py +0 -0
  73. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_moves.py +0 -0
  74. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_pawns.py +0 -0
  75. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_pieces.py +0 -0
  76. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_placement.py +0 -0
  77. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_planes.py +0 -0
  78. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_state.py +0 -0
  79. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_tactics.py +0 -0
  80. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_facts_threats.py +0 -0
  81. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_lichess.py +0 -0
  82. {esca-0.2.0 → esca-0.3.0}/esca/python/tests/test_pgn.py +0 -0
  83. {esca-0.2.0 → esca-0.3.0}/esca/src/error.rs +0 -0
  84. {esca-0.2.0 → esca-0.3.0}/esca/src/facts/encode.rs +0 -0
  85. {esca-0.2.0 → esca-0.3.0}/esca/src/facts/endgame.rs +0 -0
  86. {esca-0.2.0 → esca-0.3.0}/esca/src/facts/exchange.rs +0 -0
  87. {esca-0.2.0 → esca-0.3.0}/esca/src/facts/history.rs +0 -0
  88. {esca-0.2.0 → esca-0.3.0}/esca/src/facts/king.rs +0 -0
  89. {esca-0.2.0 → esca-0.3.0}/esca/src/facts/pawns.rs +0 -0
  90. {esca-0.2.0 → esca-0.3.0}/esca/src/facts/pieces.rs +0 -0
  91. {esca-0.2.0 → esca-0.3.0}/esca/src/facts/scan.rs +0 -0
  92. {esca-0.2.0 → esca-0.3.0}/esca/src/facts/tactics.rs +0 -0
  93. {esca-0.2.0 → esca-0.3.0}/esca/src/facts/threats.rs +0 -0
  94. {esca-0.2.0 → esca-0.3.0}/esca/src/fen.rs +0 -0
  95. {esca-0.2.0 → esca-0.3.0}/esca/src/game.rs +0 -0
  96. {esca-0.2.0 → esca-0.3.0}/esca/src/lichess.rs +0 -0
  97. {esca-0.2.0 → esca-0.3.0}/esca/src/moves.rs +0 -0
  98. {esca-0.2.0 → esca-0.3.0}/esca/src/pgn/mod.rs +0 -0
  99. {esca-0.2.0 → esca-0.3.0}/esca/src/pgn/read.rs +0 -0
  100. {esca-0.2.0 → esca-0.3.0}/esca/src/pgn/write.rs +0 -0
  101. {esca-0.2.0 → esca-0.3.0}/esca/src/python/encode.rs +0 -0
  102. {esca-0.2.0 → esca-0.3.0}/esca/src/python/facts.rs +0 -0
  103. {esca-0.2.0 → esca-0.3.0}/esca/src/python/lichess.rs +0 -0
  104. {esca-0.2.0 → esca-0.3.0}/esca/src/python/pgn.rs +0 -0
  105. {esca-0.2.0 → esca-0.3.0}/esca/src/schema.rs +0 -0
  106. {esca-0.2.0 → esca-0.3.0}/esca/src/types.rs +0 -0
  107. {esca-0.2.0 → esca-0.3.0}/esca/src/uci/protocol.rs +0 -0
  108. {esca-0.2.0 → esca-0.3.0}/esca/src/variant/chess960.rs +0 -0
  109. {esca-0.2.0 → esca-0.3.0}/esca/src/variant/classic.rs +0 -0
  110. {esca-0.2.0 → esca-0.3.0}/esca/src/variant/mod.rs +0 -0
  111. {esca-0.2.0 → esca-0.3.0}/esca/src/variant/rules.rs +0 -0
  112. {esca-0.2.0 → esca-0.3.0}/esca/tests/common/mod.rs +0 -0
  113. {esca-0.2.0 → esca-0.3.0}/esca/tests/data/fens_chess960.txt +0 -0
  114. {esca-0.2.0 → esca-0.3.0}/esca/tests/data/fens_classic.txt +0 -0
  115. {esca-0.2.0 → esca-0.3.0}/esca/tests/data/lichess_sample.jsonl.zst +0 -0
  116. {esca-0.2.0 → esca-0.3.0}/esca/tests/data/schema_v1.txt +0 -0
  117. {esca-0.2.0 → esca-0.3.0}/esca/tests/data/schema_v1_id.txt +0 -0
  118. {esca-0.2.0 → esca-0.3.0}/esca/tests/data/vectors_chess960.bin +0 -0
  119. {esca-0.2.0 → esca-0.3.0}/esca/tests/data/vectors_classic.bin +0 -0
  120. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts.rs +0 -0
  121. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_attacks.rs +0 -0
  122. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_endgame.rs +0 -0
  123. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_exchange.rs +0 -0
  124. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_history.rs +0 -0
  125. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_king.rs +0 -0
  126. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_material.rs +0 -0
  127. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_mobility.rs +0 -0
  128. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_moves.rs +0 -0
  129. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_pawns.rs +0 -0
  130. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_pieces.rs +0 -0
  131. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_placement.rs +0 -0
  132. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_planes.rs +0 -0
  133. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_state.rs +0 -0
  134. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_tactics.rs +0 -0
  135. {esca-0.2.0 → esca-0.3.0}/esca/tests/facts_threats.rs +0 -0
  136. {esca-0.2.0 → esca-0.3.0}/esca/tests/fen.rs +0 -0
  137. {esca-0.2.0 → esca-0.3.0}/esca/tests/game.rs +0 -0
  138. {esca-0.2.0 → esca-0.3.0}/esca/tests/lichess.rs +0 -0
  139. {esca-0.2.0 → esca-0.3.0}/esca/tests/movetext.rs +0 -0
  140. {esca-0.2.0 → esca-0.3.0}/esca/tests/perft.rs +0 -0
  141. {esca-0.2.0 → esca-0.3.0}/esca/tests/pgn.rs +0 -0
  142. {esca-0.2.0 → esca-0.3.0}/esca/tests/properties.rs +0 -0
  143. {esca-0.2.0 → esca-0.3.0}/esca/tests/schema.rs +0 -0
  144. {esca-0.2.0 → esca-0.3.0}/esca/tests/uci_protocol.rs +0 -0
  145. {esca-0.2.0 → esca-0.3.0}/python/esca/lichess.py +0 -0
  146. {esca-0.2.0 → esca-0.3.0}/python/esca/lichess.pyi +0 -0
  147. {esca-0.2.0 → esca-0.3.0}/python/esca/pgn.py +0 -0
  148. {esca-0.2.0 → esca-0.3.0}/python/esca/pgn.pyi +0 -0
  149. {esca-0.2.0 → esca-0.3.0}/python/esca/py.typed +0 -0
@@ -19,7 +19,7 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
19
19
 
20
20
  [[package]]
21
21
  name = "anglerfish-core"
22
- version = "0.2.0"
22
+ version = "0.3.0"
23
23
  dependencies = [
24
24
  "env_logger",
25
25
  "esca",
@@ -136,6 +136,12 @@ version = "3.20.3"
136
136
  source = "registry+https://github.com/rust-lang/crates.io-index"
137
137
  checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
138
138
 
139
+ [[package]]
140
+ name = "bytes"
141
+ version = "1.12.1"
142
+ source = "registry+https://github.com/rust-lang/crates.io-index"
143
+ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
144
+
139
145
  [[package]]
140
146
  name = "cast"
141
147
  version = "0.3.0"
@@ -398,12 +404,13 @@ dependencies = [
398
404
 
399
405
  [[package]]
400
406
  name = "esca"
401
- version = "0.2.0"
407
+ version = "0.3.0"
402
408
  dependencies = [
403
409
  "blake3",
404
410
  "cozy-chess",
405
411
  "criterion",
406
412
  "log",
413
+ "memmap2",
407
414
  "numpy",
408
415
  "proptest",
409
416
  "pyo3",
@@ -411,6 +418,7 @@ dependencies = [
411
418
  "rstest",
412
419
  "serde",
413
420
  "serde_json",
421
+ "tokio",
414
422
  "zstd",
415
423
  ]
416
424
 
@@ -632,6 +640,26 @@ version = "2.8.3"
632
640
  source = "registry+https://github.com/rust-lang/crates.io-index"
633
641
  checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
634
642
 
643
+ [[package]]
644
+ name = "memmap2"
645
+ version = "0.9.11"
646
+ source = "registry+https://github.com/rust-lang/crates.io-index"
647
+ checksum = "d1219ed1b7f229ee7104d281dd01d6802fe28bb6e95d292942c4daacdeb798c0"
648
+ dependencies = [
649
+ "libc",
650
+ ]
651
+
652
+ [[package]]
653
+ name = "mio"
654
+ version = "1.2.3"
655
+ source = "registry+https://github.com/rust-lang/crates.io-index"
656
+ checksum = "4b18443e9c262bfe8fa82f51666e2642c53393f7e5c27b3e1aeab922cff5b9d8"
657
+ dependencies = [
658
+ "libc",
659
+ "wasi",
660
+ "windows-sys",
661
+ ]
662
+
635
663
  [[package]]
636
664
  name = "ndarray"
637
665
  version = "0.17.2"
@@ -1136,6 +1164,16 @@ version = "2.0.1"
1136
1164
  source = "registry+https://github.com/rust-lang/crates.io-index"
1137
1165
  checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
1138
1166
 
1167
+ [[package]]
1168
+ name = "signal-hook-registry"
1169
+ version = "1.4.8"
1170
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1171
+ checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
1172
+ dependencies = [
1173
+ "errno",
1174
+ "libc",
1175
+ ]
1176
+
1139
1177
  [[package]]
1140
1178
  name = "slab"
1141
1179
  version = "0.4.12"
@@ -1213,6 +1251,32 @@ dependencies = [
1213
1251
  "serde_json",
1214
1252
  ]
1215
1253
 
1254
+ [[package]]
1255
+ name = "tokio"
1256
+ version = "1.53.1"
1257
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1258
+ checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"
1259
+ dependencies = [
1260
+ "bytes",
1261
+ "libc",
1262
+ "mio",
1263
+ "pin-project-lite",
1264
+ "signal-hook-registry",
1265
+ "tokio-macros",
1266
+ "windows-sys",
1267
+ ]
1268
+
1269
+ [[package]]
1270
+ name = "tokio-macros"
1271
+ version = "2.7.2"
1272
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1273
+ checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e"
1274
+ dependencies = [
1275
+ "proc-macro2",
1276
+ "quote",
1277
+ "syn 3.0.4",
1278
+ ]
1279
+
1216
1280
  [[package]]
1217
1281
  name = "unarray"
1218
1282
  version = "0.1.4"
@@ -1250,6 +1314,12 @@ dependencies = [
1250
1314
  "winapi-util",
1251
1315
  ]
1252
1316
 
1317
+ [[package]]
1318
+ name = "wasi"
1319
+ version = "0.11.1+wasi-snapshot-preview1"
1320
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1321
+ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
1322
+
1253
1323
  [[package]]
1254
1324
  name = "wasip2"
1255
1325
  version = "1.0.4+wasi-0.2.12"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: esca
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -25,6 +25,13 @@ Project-URL: Repository, https://github.com/AnglerfishChess/anglerfish
25
25
 
26
26
  # esca
27
27
 
28
+ [![crates.io](https://img.shields.io/crates/v/esca)](https://crates.io/crates/esca)
29
+ [![docs.rs](https://img.shields.io/docsrs/esca)](https://docs.rs/esca)
30
+ [![PyPI](https://img.shields.io/pypi/v/esca)](https://pypi.org/project/esca/)
31
+ [![Python](https://img.shields.io/pypi/pyversions/esca)](https://pypi.org/project/esca/)
32
+ [![CI](https://github.com/AnglerfishChess/anglerfish/actions/workflows/ci.yml/badge.svg)](https://github.com/AnglerfishChess/anglerfish/actions/workflows/ci.yml)
33
+ [![MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/AnglerfishChess/anglerfish/blob/main/LICENSE)
34
+
28
35
  A chess model that answers what is true about a position — a Rust crate and a Python package built
29
36
  from it.
30
37
 
@@ -60,8 +67,9 @@ println!("{}", facts.encode(schema, schema.all()).len());
60
67
  ```
61
68
 
62
69
  Cargo features, none on by default: `lichess` (streaming reader for the Lichess evaluation
63
- dump), `pgn` (reading and writing games as PGN) and `python` (the PyO3 module the wheel is
64
- built from).
70
+ dump), `pgn` (reading and writing games as PGN), `polyglot` (opening books), `openings` (the
71
+ bundled ECO catalogue) and `python` (the PyO3 module the wheel is built from).
72
+ `Position::polyglot_key` needs no feature.
65
73
 
66
74
  ## Python
67
75
 
@@ -103,6 +111,8 @@ encoded batches with their targets.
103
111
  mover's view.
104
112
  - `Schema`, a versioned manifest with a `schema_id`, and batch encoders that write `f32` rows
105
113
  without allocating.
114
+ - Polyglot opening books: the format's own key on every `Position`, books read, drawn from and
115
+ built, and an ECO code and name for some 3,800 named positions.
106
116
 
107
117
  ## Documentation
108
118
 
@@ -115,3 +125,17 @@ encoded batches with their targets.
115
125
 
116
126
  MIT — see [LICENSE](https://github.com/AnglerfishChess/anglerfish/blob/main/LICENSE).
117
127
 
128
+ ## Acknowledgements
129
+
130
+ - [cozy-chess](https://github.com/analog-hors/cozy-chess) (MIT) — the move generator esca
131
+ stands on.
132
+ - [Lichess](https://lichess.org) — the evaluation dump the trainer learns from, the game
133
+ database, and [lichess-org/chess-openings](https://github.com/lichess-org/chess-openings),
134
+ whose opening names the `openings` feature bundles (CC0 1.0 Universal Public Domain
135
+ Dedication).
136
+ - The Polyglot opening-book format and its key scheme, by Fabien Letouzey; the key constants
137
+ are those published in [polyglot-book-rs](https://crates.io/crates/polyglot-book-rs)
138
+ (MIT OR Apache-2.0).
139
+ - [Stockfish](https://stockfishchess.org) and [Leela Chess Zero](https://lczero.org), the
140
+ engines the UCI client is tested against.
141
+
@@ -1,5 +1,12 @@
1
1
  # esca
2
2
 
3
+ [![crates.io](https://img.shields.io/crates/v/esca)](https://crates.io/crates/esca)
4
+ [![docs.rs](https://img.shields.io/docsrs/esca)](https://docs.rs/esca)
5
+ [![PyPI](https://img.shields.io/pypi/v/esca)](https://pypi.org/project/esca/)
6
+ [![Python](https://img.shields.io/pypi/pyversions/esca)](https://pypi.org/project/esca/)
7
+ [![CI](https://github.com/AnglerfishChess/anglerfish/actions/workflows/ci.yml/badge.svg)](https://github.com/AnglerfishChess/anglerfish/actions/workflows/ci.yml)
8
+ [![MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/AnglerfishChess/anglerfish/blob/main/LICENSE)
9
+
3
10
  A chess model that answers what is true about a position — a Rust crate and a Python package built
4
11
  from it.
5
12
 
@@ -35,8 +42,9 @@ println!("{}", facts.encode(schema, schema.all()).len());
35
42
  ```
36
43
 
37
44
  Cargo features, none on by default: `lichess` (streaming reader for the Lichess evaluation
38
- dump), `pgn` (reading and writing games as PGN) and `python` (the PyO3 module the wheel is
39
- built from).
45
+ dump), `pgn` (reading and writing games as PGN), `polyglot` (opening books), `openings` (the
46
+ bundled ECO catalogue) and `python` (the PyO3 module the wheel is built from).
47
+ `Position::polyglot_key` needs no feature.
40
48
 
41
49
  ## Python
42
50
 
@@ -78,6 +86,8 @@ encoded batches with their targets.
78
86
  mover's view.
79
87
  - `Schema`, a versioned manifest with a `schema_id`, and batch encoders that write `f32` rows
80
88
  without allocating.
89
+ - Polyglot opening books: the format's own key on every `Position`, books read, drawn from and
90
+ built, and an ECO code and name for some 3,800 named positions.
81
91
 
82
92
  ## Documentation
83
93
 
@@ -89,3 +99,17 @@ encoded batches with their targets.
89
99
  ## License
90
100
 
91
101
  MIT — see [LICENSE](https://github.com/AnglerfishChess/anglerfish/blob/main/LICENSE).
102
+
103
+ ## Acknowledgements
104
+
105
+ - [cozy-chess](https://github.com/analog-hors/cozy-chess) (MIT) — the move generator esca
106
+ stands on.
107
+ - [Lichess](https://lichess.org) — the evaluation dump the trainer learns from, the game
108
+ database, and [lichess-org/chess-openings](https://github.com/lichess-org/chess-openings),
109
+ whose opening names the `openings` feature bundles (CC0 1.0 Universal Public Domain
110
+ Dedication).
111
+ - The Polyglot opening-book format and its key scheme, by Fabien Letouzey; the key constants
112
+ are those published in [polyglot-book-rs](https://crates.io/crates/polyglot-book-rs)
113
+ (MIT OR Apache-2.0).
114
+ - [Stockfish](https://stockfishchess.org) and [Leela Chess Zero](https://lczero.org), the
115
+ engines the UCI client is tested against.
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "esca"
3
- version = "0.2.0"
3
+ version = "0.3.0"
4
4
  description = "A chess model that answers what is true about a position: variants, positions, games, and move text."
5
5
  keywords = ["chess", "chess960", "fen", "san", "position"]
6
6
  categories = ["games", "game-development"]
@@ -20,23 +20,39 @@ crate-type = ["cdylib", "rlib"]
20
20
  default = []
21
21
  # The dump reader.
22
22
  lichess = ["dep:serde", "dep:serde_json", "dep:zstd"]
23
+ # The bundled ECO catalogue.
24
+ openings = []
23
25
  # PGN reading and writing.
24
26
  pgn = []
27
+ # Opening books in the Polyglot format.
28
+ polyglot = ["dep:memmap2"]
25
29
  # The PyO3 module and its batch encoders. A wheel adds
26
30
  # `pyo3/extension-module` on top; a test binary links the interpreter instead.
27
31
  python = ["dep:numpy", "dep:pyo3", "dep:rayon"]
28
32
  # The UCI client: the protocol as values, and engines as subprocesses.
29
33
  uci = ["dep:log"]
34
+ # The same client on a tokio runtime: `uci::tokio::Engine`.
35
+ tokio = ["uci", "dep:tokio"]
30
36
 
31
37
  [dependencies]
32
38
  blake3 = "1"
33
39
  cozy-chess = "0.3.4"
34
40
  log = { version = "0.4", optional = true }
41
+ memmap2 = { version = "0.9", optional = true }
35
42
  numpy = { version = "0.29", optional = true }
36
43
  pyo3 = { version = "0.29", optional = true, features = ["abi3-py312"] }
37
44
  rayon = { version = "1", optional = true }
38
45
  serde = { version = "1", optional = true, features = ["derive"] }
39
46
  serde_json = { version = "1", optional = true }
47
+ # `macros` is what `#[tokio::test]` needs; the rest is the client itself.
48
+ tokio = { version = "1", optional = true, features = [
49
+ "io-util",
50
+ "macros",
51
+ "process",
52
+ "rt",
53
+ "sync",
54
+ "time",
55
+ ] }
40
56
  zstd = { version = "0.13", optional = true }
41
57
 
42
58
  [dev-dependencies]
@@ -1,5 +1,12 @@
1
1
  # esca
2
2
 
3
+ [![crates.io](https://img.shields.io/crates/v/esca)](https://crates.io/crates/esca)
4
+ [![docs.rs](https://img.shields.io/docsrs/esca)](https://docs.rs/esca)
5
+ [![PyPI](https://img.shields.io/pypi/v/esca)](https://pypi.org/project/esca/)
6
+ [![Python](https://img.shields.io/pypi/pyversions/esca)](https://pypi.org/project/esca/)
7
+ [![CI](https://github.com/AnglerfishChess/anglerfish/actions/workflows/ci.yml/badge.svg)](https://github.com/AnglerfishChess/anglerfish/actions/workflows/ci.yml)
8
+ [![MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/AnglerfishChess/anglerfish/blob/main/LICENSE)
9
+
3
10
  A chess model that answers what is true about a position — a Rust crate and a Python package built
4
11
  from it.
5
12
 
@@ -35,8 +42,9 @@ println!("{}", facts.encode(schema, schema.all()).len());
35
42
  ```
36
43
 
37
44
  Cargo features, none on by default: `lichess` (streaming reader for the Lichess evaluation
38
- dump), `pgn` (reading and writing games as PGN) and `python` (the PyO3 module the wheel is
39
- built from).
45
+ dump), `pgn` (reading and writing games as PGN), `polyglot` (opening books), `openings` (the
46
+ bundled ECO catalogue) and `python` (the PyO3 module the wheel is built from).
47
+ `Position::polyglot_key` needs no feature.
40
48
 
41
49
  ## Python
42
50
 
@@ -78,6 +86,8 @@ encoded batches with their targets.
78
86
  mover's view.
79
87
  - `Schema`, a versioned manifest with a `schema_id`, and batch encoders that write `f32` rows
80
88
  without allocating.
89
+ - Polyglot opening books: the format's own key on every `Position`, books read, drawn from and
90
+ built, and an ECO code and name for some 3,800 named positions.
81
91
 
82
92
  ## Documentation
83
93
 
@@ -89,3 +99,17 @@ encoded batches with their targets.
89
99
  ## License
90
100
 
91
101
  MIT — see [LICENSE](https://github.com/AnglerfishChess/anglerfish/blob/main/LICENSE).
102
+
103
+ ## Acknowledgements
104
+
105
+ - [cozy-chess](https://github.com/analog-hors/cozy-chess) (MIT) — the move generator esca
106
+ stands on.
107
+ - [Lichess](https://lichess.org) — the evaluation dump the trainer learns from, the game
108
+ database, and [lichess-org/chess-openings](https://github.com/lichess-org/chess-openings),
109
+ whose opening names the `openings` feature bundles (CC0 1.0 Universal Public Domain
110
+ Dedication).
111
+ - The Polyglot opening-book format and its key scheme, by Fabien Letouzey; the key constants
112
+ are those published in [polyglot-book-rs](https://crates.io/crates/polyglot-book-rs)
113
+ (MIT OR Apache-2.0).
114
+ - [Stockfish](https://stockfishchess.org) and [Leela Chess Zero](https://lczero.org), the
115
+ engines the UCI client is tested against.