pgn2 1.5.0 → 2.0.1
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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +34 -3
- data/.github/workflows/native.yml +32 -0
- data/.github/workflows/publish.yml +44 -2
- data/.github/workflows/release-gems.yml +43 -0
- data/.github/workflows/release.yml +52 -5
- data/.gitignore +9 -1
- data/.rubocop.yml +46 -6
- data/CHANGELOG.md +215 -0
- data/Gemfile +3 -0
- data/NOTICE.md +21 -0
- data/README.md +134 -5
- data/Rakefile +53 -10
- data/TODO.md +44 -62
- data/bench/baseline_moves.txt +38 -4
- data/bench/baseline_parse.txt +4 -4
- data/bench/cross_check.rb +61 -0
- data/bench/legal_moves.rb +38 -0
- data/bench/perft.rb +32 -0
- data/bench/profile_moves.rb +93 -0
- data/docs/superpowers/plans/2026-08-13-attack-masks-plan.md +51 -0
- data/docs/superpowers/plans/2026-08-13-perf-internals-plan.md +883 -0
- data/docs/superpowers/plans/2026-08-13-rust-bitboard-perft-plan.md +2442 -0
- data/docs/superpowers/plans/2026-08-14-chessie-migration.md +722 -0
- data/docs/superpowers/plans/2026-08-14-rust-integration-plan.md +444 -0
- data/docs/superpowers/plans/2026-08-15-game-tree-api-plan.md +1014 -0
- data/docs/superpowers/plans/2026-08-15-small-medium-roadmap-plan.md +384 -0
- data/docs/superpowers/specs/2026-08-13-attack-masks-design.md +57 -0
- data/docs/superpowers/specs/2026-08-13-perf-internals-design.md +111 -0
- data/docs/superpowers/specs/2026-08-13-rust-bitboard-perft-design.md +270 -0
- data/docs/superpowers/specs/2026-08-14-rust-integration-design.md +217 -0
- data/docs/superpowers/specs/2026-08-15-game-tree-api-design.md +387 -0
- data/ext/pgn2_native/Cargo.lock +321 -0
- data/ext/pgn2_native/Cargo.toml +19 -0
- data/ext/pgn2_native/extconf.rb +8 -0
- data/ext/pgn2_native/pgn2-bitboard/Cargo.toml +10 -0
- data/ext/pgn2_native/pgn2-bitboard/src/board.rs +32 -0
- data/ext/pgn2_native/pgn2-bitboard/src/lib.rs +12 -0
- data/ext/pgn2_native/pgn2-bitboard/src/moves.rs +121 -0
- data/ext/pgn2_native/pgn2-bitboard/src/perft.rs +81 -0
- data/ext/pgn2_native/pgn2_native/Cargo.toml +11 -0
- data/ext/pgn2_native/pgn2_native/src/lib.rs +54 -0
- data/lib/pgn/attack.rb +97 -0
- data/lib/pgn/bitboard.rb +13 -0
- data/lib/pgn/board.rb +64 -0
- data/lib/pgn/epd.rb +81 -0
- data/lib/pgn/fen.rb +42 -46
- data/lib/pgn/game.rb +104 -16
- data/lib/pgn/move.rb +20 -16
- data/lib/pgn/move_calculator.rb +13 -1
- data/lib/pgn/node.rb +372 -0
- data/lib/pgn/notation.rb +26 -89
- data/lib/pgn/pgn_parser.rb +30 -31
- data/lib/pgn/pgn_parser.y +14 -15
- data/lib/pgn/position.rb +251 -19
- data/lib/pgn/serializer.rb +13 -18
- data/lib/pgn/version.rb +1 -1
- data/lib/pgn/zobrist.rb +53 -0
- data/lib/pgn.rb +5 -0
- data/pgn2.gemspec +17 -10
- data/spec/bitboard_spec.rb +54 -0
- data/spec/board_spec.rb +53 -0
- data/spec/castling_normalization_spec.rb +39 -0
- data/spec/comment_round_trip_spec.rb +35 -0
- data/spec/epd_spec.rb +44 -0
- data/spec/fen_spec.rb +71 -65
- data/spec/game_history_spec.rb +46 -0
- data/spec/game_spec.rb +112 -15
- data/spec/lexer_spec.rb +5 -5
- data/spec/movetext_clean_spec.rb +44 -0
- data/spec/node_spec.rb +240 -0
- data/spec/notation_spec.rb +5 -0
- data/spec/outcome_spec.rb +93 -0
- data/spec/parser_left_recursion_spec.rb +37 -0
- data/spec/parser_spec.rb +8 -1
- data/spec/position_attack_spec.rb +56 -0
- data/spec/position_legal_spec.rb +123 -0
- data/spec/position_spec.rb +128 -27
- data/spec/serializer_spec.rb +4 -4
- data/spec/zobrist_spec.rb +46 -0
- metadata +113 -35
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pgn2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stacey Touset
|
|
@@ -9,8 +9,64 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-08-
|
|
12
|
+
date: 2026-08-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: rb_sys
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
requirements:
|
|
18
|
+
- - "~>"
|
|
19
|
+
- !ruby/object:Gem::Version
|
|
20
|
+
version: 0.9.39
|
|
21
|
+
type: :runtime
|
|
22
|
+
prerelease: false
|
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
24
|
+
requirements:
|
|
25
|
+
- - "~>"
|
|
26
|
+
- !ruby/object:Gem::Version
|
|
27
|
+
version: 0.9.39
|
|
28
|
+
- !ruby/object:Gem::Dependency
|
|
29
|
+
name: rake-compiler
|
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
|
31
|
+
requirements:
|
|
32
|
+
- - "~>"
|
|
33
|
+
- !ruby/object:Gem::Version
|
|
34
|
+
version: '1.2'
|
|
35
|
+
type: :development
|
|
36
|
+
prerelease: false
|
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
38
|
+
requirements:
|
|
39
|
+
- - "~>"
|
|
40
|
+
- !ruby/object:Gem::Version
|
|
41
|
+
version: '1.2'
|
|
42
|
+
- !ruby/object:Gem::Dependency
|
|
43
|
+
name: rake-compiler-dock
|
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
|
45
|
+
requirements:
|
|
46
|
+
- - "~>"
|
|
47
|
+
- !ruby/object:Gem::Version
|
|
48
|
+
version: '1.6'
|
|
49
|
+
type: :development
|
|
50
|
+
prerelease: false
|
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
52
|
+
requirements:
|
|
53
|
+
- - "~>"
|
|
54
|
+
- !ruby/object:Gem::Version
|
|
55
|
+
version: '1.6'
|
|
56
|
+
- !ruby/object:Gem::Dependency
|
|
57
|
+
name: benchmark-ips
|
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
|
59
|
+
requirements:
|
|
60
|
+
- - ">="
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: '0'
|
|
63
|
+
type: :development
|
|
64
|
+
prerelease: false
|
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
66
|
+
requirements:
|
|
67
|
+
- - ">="
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: '0'
|
|
14
70
|
- !ruby/object:Gem::Dependency
|
|
15
71
|
name: bundler
|
|
16
72
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -26,7 +82,7 @@ dependencies:
|
|
|
26
82
|
- !ruby/object:Gem::Version
|
|
27
83
|
version: '2.3'
|
|
28
84
|
- !ruby/object:Gem::Dependency
|
|
29
|
-
name:
|
|
85
|
+
name: bundler-audit
|
|
30
86
|
requirement: !ruby/object:Gem::Requirement
|
|
31
87
|
requirements:
|
|
32
88
|
- - ">="
|
|
@@ -40,7 +96,7 @@ dependencies:
|
|
|
40
96
|
- !ruby/object:Gem::Version
|
|
41
97
|
version: '0'
|
|
42
98
|
- !ruby/object:Gem::Dependency
|
|
43
|
-
name:
|
|
99
|
+
name: memory_profiler
|
|
44
100
|
requirement: !ruby/object:Gem::Requirement
|
|
45
101
|
requirements:
|
|
46
102
|
- - ">="
|
|
@@ -54,7 +110,7 @@ dependencies:
|
|
|
54
110
|
- !ruby/object:Gem::Version
|
|
55
111
|
version: '0'
|
|
56
112
|
- !ruby/object:Gem::Dependency
|
|
57
|
-
name:
|
|
113
|
+
name: pry
|
|
58
114
|
requirement: !ruby/object:Gem::Requirement
|
|
59
115
|
requirements:
|
|
60
116
|
- - ">="
|
|
@@ -82,7 +138,7 @@ dependencies:
|
|
|
82
138
|
- !ruby/object:Gem::Version
|
|
83
139
|
version: '0'
|
|
84
140
|
- !ruby/object:Gem::Dependency
|
|
85
|
-
name:
|
|
141
|
+
name: rake
|
|
86
142
|
requirement: !ruby/object:Gem::Requirement
|
|
87
143
|
requirements:
|
|
88
144
|
- - ">="
|
|
@@ -96,7 +152,7 @@ dependencies:
|
|
|
96
152
|
- !ruby/object:Gem::Version
|
|
97
153
|
version: '0'
|
|
98
154
|
- !ruby/object:Gem::Dependency
|
|
99
|
-
name:
|
|
155
|
+
name: rspec
|
|
100
156
|
requirement: !ruby/object:Gem::Requirement
|
|
101
157
|
requirements:
|
|
102
158
|
- - ">="
|
|
@@ -128,11 +184,14 @@ email:
|
|
|
128
184
|
- stacey@touset.org
|
|
129
185
|
- muriloime@gmail.com
|
|
130
186
|
executables: []
|
|
131
|
-
extensions:
|
|
187
|
+
extensions:
|
|
188
|
+
- ext/pgn2_native/extconf.rb
|
|
132
189
|
extra_rdoc_files: []
|
|
133
190
|
files:
|
|
134
191
|
- ".github/workflows/ci.yml"
|
|
192
|
+
- ".github/workflows/native.yml"
|
|
135
193
|
- ".github/workflows/publish.yml"
|
|
194
|
+
- ".github/workflows/release-gems.yml"
|
|
136
195
|
- ".github/workflows/release.yml"
|
|
137
196
|
- ".gitignore"
|
|
138
197
|
- ".rspec"
|
|
@@ -140,6 +199,7 @@ files:
|
|
|
140
199
|
- CHANGELOG.md
|
|
141
200
|
- Gemfile
|
|
142
201
|
- LICENSE.txt
|
|
202
|
+
- NOTICE.md
|
|
143
203
|
- README.md
|
|
144
204
|
- Rakefile
|
|
145
205
|
- TODO.md
|
|
@@ -152,22 +212,51 @@ files:
|
|
|
152
212
|
- bench/baseline_parse.pre-quickwins.txt
|
|
153
213
|
- bench/baseline_parse.racc.txt
|
|
154
214
|
- bench/baseline_parse.txt
|
|
215
|
+
- bench/cross_check.rb
|
|
216
|
+
- bench/legal_moves.rb
|
|
217
|
+
- bench/perft.rb
|
|
155
218
|
- bench/profile_moves.rb
|
|
156
219
|
- bench/profile_parse.rb
|
|
157
220
|
- docs/superpowers/plans/2026-08-12-efficiency-optimizations.md
|
|
158
221
|
- docs/superpowers/plans/2026-08-12-efficiency-tests-and-profiling.md
|
|
159
222
|
- docs/superpowers/plans/2026-08-12-to-pgn-serialization.md
|
|
223
|
+
- docs/superpowers/plans/2026-08-13-attack-masks-plan.md
|
|
224
|
+
- docs/superpowers/plans/2026-08-13-perf-internals-plan.md
|
|
225
|
+
- docs/superpowers/plans/2026-08-13-rust-bitboard-perft-plan.md
|
|
160
226
|
- docs/superpowers/plans/2026-08-13-whittle-to-racc-migration.md
|
|
227
|
+
- docs/superpowers/plans/2026-08-14-chessie-migration.md
|
|
228
|
+
- docs/superpowers/plans/2026-08-14-rust-integration-plan.md
|
|
229
|
+
- docs/superpowers/plans/2026-08-15-game-tree-api-plan.md
|
|
230
|
+
- docs/superpowers/plans/2026-08-15-small-medium-roadmap-plan.md
|
|
161
231
|
- docs/superpowers/specs/2026-08-12-to-pgn-serialization-design.md
|
|
232
|
+
- docs/superpowers/specs/2026-08-13-attack-masks-design.md
|
|
233
|
+
- docs/superpowers/specs/2026-08-13-perf-internals-design.md
|
|
162
234
|
- docs/superpowers/specs/2026-08-13-pgn-performance-quick-wins-design.md
|
|
235
|
+
- docs/superpowers/specs/2026-08-13-rust-bitboard-perft-design.md
|
|
236
|
+
- docs/superpowers/specs/2026-08-14-rust-integration-design.md
|
|
237
|
+
- docs/superpowers/specs/2026-08-15-game-tree-api-design.md
|
|
163
238
|
- examples/immortal_game.pgn
|
|
239
|
+
- ext/pgn2_native/Cargo.lock
|
|
240
|
+
- ext/pgn2_native/Cargo.toml
|
|
241
|
+
- ext/pgn2_native/extconf.rb
|
|
242
|
+
- ext/pgn2_native/pgn2-bitboard/Cargo.toml
|
|
243
|
+
- ext/pgn2_native/pgn2-bitboard/src/board.rs
|
|
244
|
+
- ext/pgn2_native/pgn2-bitboard/src/lib.rs
|
|
245
|
+
- ext/pgn2_native/pgn2-bitboard/src/moves.rs
|
|
246
|
+
- ext/pgn2_native/pgn2-bitboard/src/perft.rs
|
|
247
|
+
- ext/pgn2_native/pgn2_native/Cargo.toml
|
|
248
|
+
- ext/pgn2_native/pgn2_native/src/lib.rs
|
|
164
249
|
- lib/pgn.rb
|
|
250
|
+
- lib/pgn/attack.rb
|
|
251
|
+
- lib/pgn/bitboard.rb
|
|
165
252
|
- lib/pgn/board.rb
|
|
253
|
+
- lib/pgn/epd.rb
|
|
166
254
|
- lib/pgn/fen.rb
|
|
167
255
|
- lib/pgn/game.rb
|
|
168
256
|
- lib/pgn/lexer.rb
|
|
169
257
|
- lib/pgn/move.rb
|
|
170
258
|
- lib/pgn/move_calculator.rb
|
|
259
|
+
- lib/pgn/node.rb
|
|
171
260
|
- lib/pgn/notation.rb
|
|
172
261
|
- lib/pgn/parser.rb
|
|
173
262
|
- lib/pgn/pgn_parser.rb
|
|
@@ -175,15 +264,25 @@ files:
|
|
|
175
264
|
- lib/pgn/position.rb
|
|
176
265
|
- lib/pgn/serializer.rb
|
|
177
266
|
- lib/pgn/version.rb
|
|
267
|
+
- lib/pgn/zobrist.rb
|
|
178
268
|
- pgn2.gemspec
|
|
269
|
+
- spec/bitboard_spec.rb
|
|
179
270
|
- spec/board_spec.rb
|
|
271
|
+
- spec/castling_normalization_spec.rb
|
|
272
|
+
- spec/comment_round_trip_spec.rb
|
|
273
|
+
- spec/epd_spec.rb
|
|
180
274
|
- spec/fen_spec.rb
|
|
275
|
+
- spec/game_history_spec.rb
|
|
181
276
|
- spec/game_spec.rb
|
|
182
277
|
- spec/lexer_spec.rb
|
|
183
278
|
- spec/move_calculator_spec.rb
|
|
184
279
|
- spec/move_spec.rb
|
|
280
|
+
- spec/movetext_clean_spec.rb
|
|
281
|
+
- spec/node_spec.rb
|
|
185
282
|
- spec/notation_spec.rb
|
|
283
|
+
- spec/outcome_spec.rb
|
|
186
284
|
- spec/parser_explicit_spec.rb
|
|
285
|
+
- spec/parser_left_recursion_spec.rb
|
|
187
286
|
- spec/parser_spec.rb
|
|
188
287
|
- spec/pgn_files/alternate_castling.pgn
|
|
189
288
|
- spec/pgn_files/annotations.pgn
|
|
@@ -199,17 +298,22 @@ files:
|
|
|
199
298
|
- spec/pgn_files/two_annotations.pgn
|
|
200
299
|
- spec/pgn_files/two_games.pgn
|
|
201
300
|
- spec/pgn_files/variations.pgn
|
|
301
|
+
- spec/position_attack_spec.rb
|
|
302
|
+
- spec/position_legal_spec.rb
|
|
202
303
|
- spec/position_spec.rb
|
|
203
304
|
- spec/serializer_spec.rb
|
|
204
305
|
- spec/spec_helper.rb
|
|
306
|
+
- spec/zobrist_spec.rb
|
|
205
307
|
homepage: https://github.com/muriloime/pgn
|
|
206
308
|
licenses:
|
|
207
309
|
- MIT
|
|
310
|
+
- MPL-2.0
|
|
208
311
|
metadata:
|
|
209
312
|
homepage_uri: https://github.com/muriloime/pgn
|
|
210
313
|
source_code_uri: https://github.com/muriloime/pgn
|
|
211
314
|
bug_tracker_uri: https://github.com/muriloime/pgn/issues
|
|
212
315
|
changelog_uri: https://github.com/muriloime/pgn/blob/main/CHANGELOG.md
|
|
316
|
+
rubygems_mfa_required: 'true'
|
|
213
317
|
post_install_message:
|
|
214
318
|
rdoc_options: []
|
|
215
319
|
require_paths:
|
|
@@ -229,30 +333,4 @@ rubygems_version: 3.5.22
|
|
|
229
333
|
signing_key:
|
|
230
334
|
specification_version: 4
|
|
231
335
|
summary: A PGN parser for Ruby
|
|
232
|
-
test_files:
|
|
233
|
-
- spec/board_spec.rb
|
|
234
|
-
- spec/fen_spec.rb
|
|
235
|
-
- spec/game_spec.rb
|
|
236
|
-
- spec/lexer_spec.rb
|
|
237
|
-
- spec/move_calculator_spec.rb
|
|
238
|
-
- spec/move_spec.rb
|
|
239
|
-
- spec/notation_spec.rb
|
|
240
|
-
- spec/parser_explicit_spec.rb
|
|
241
|
-
- spec/parser_spec.rb
|
|
242
|
-
- spec/pgn_files/alternate_castling.pgn
|
|
243
|
-
- spec/pgn_files/annotations.pgn
|
|
244
|
-
- spec/pgn_files/comments.pgn
|
|
245
|
-
- spec/pgn_files/doublequotes.pgn
|
|
246
|
-
- spec/pgn_files/empty_variation_move.pgn
|
|
247
|
-
- spec/pgn_files/fen.pgn
|
|
248
|
-
- spec/pgn_files/multiline_comments.pgn
|
|
249
|
-
- spec/pgn_files/nested_comments.pgn
|
|
250
|
-
- spec/pgn_files/no_moves.pgn
|
|
251
|
-
- spec/pgn_files/specialcharacters.pgn
|
|
252
|
-
- spec/pgn_files/test.pgn
|
|
253
|
-
- spec/pgn_files/two_annotations.pgn
|
|
254
|
-
- spec/pgn_files/two_games.pgn
|
|
255
|
-
- spec/pgn_files/variations.pgn
|
|
256
|
-
- spec/position_spec.rb
|
|
257
|
-
- spec/serializer_spec.rb
|
|
258
|
-
- spec/spec_helper.rb
|
|
336
|
+
test_files: []
|