pgn2 1.4.0 → 2.0.0
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 +40 -0
- data/.github/workflows/release.yml +52 -5
- data/.gitignore +9 -1
- data/.rubocop.yml +46 -6
- data/CHANGELOG.md +183 -1
- data/Gemfile +3 -0
- data/NOTICE.md +21 -0
- data/README.md +107 -5
- data/Rakefile +35 -10
- data/TODO.md +102 -31
- 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/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/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/bitboard.rb +13 -0
- data/lib/pgn/board.rb +103 -10
- data/lib/pgn/fen.rb +35 -46
- data/lib/pgn/game.rb +22 -13
- data/lib/pgn/lexer.rb +9 -6
- data/lib/pgn/move.rb +19 -15
- data/lib/pgn/move_calculator.rb +46 -20
- data/lib/pgn/notation.rb +24 -29
- data/lib/pgn/position.rb +60 -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 +2 -0
- data/pgn2.gemspec +17 -10
- data/spec/bitboard_spec.rb +54 -0
- data/spec/board_spec.rb +53 -0
- data/spec/fen_spec.rb +65 -65
- data/spec/game_spec.rb +52 -15
- data/spec/lexer_spec.rb +5 -5
- data/spec/notation_spec.rb +5 -0
- data/spec/parser_spec.rb +8 -1
- data/spec/position_spec.rb +128 -27
- data/spec/serializer_spec.rb +4 -4
- data/spec/zobrist_spec.rb +46 -0
- metadata +101 -36
metadata
CHANGED
|
@@ -1,15 +1,72 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pgn2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stacey Touset
|
|
8
8
|
- Murilo Vasconcelos
|
|
9
|
+
autorequire:
|
|
9
10
|
bindir: bin
|
|
10
11
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
+
date: 2026-08-14 00:00:00.000000000 Z
|
|
12
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'
|
|
13
70
|
- !ruby/object:Gem::Dependency
|
|
14
71
|
name: bundler
|
|
15
72
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -25,7 +82,7 @@ dependencies:
|
|
|
25
82
|
- !ruby/object:Gem::Version
|
|
26
83
|
version: '2.3'
|
|
27
84
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
85
|
+
name: bundler-audit
|
|
29
86
|
requirement: !ruby/object:Gem::Requirement
|
|
30
87
|
requirements:
|
|
31
88
|
- - ">="
|
|
@@ -39,7 +96,7 @@ dependencies:
|
|
|
39
96
|
- !ruby/object:Gem::Version
|
|
40
97
|
version: '0'
|
|
41
98
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
99
|
+
name: memory_profiler
|
|
43
100
|
requirement: !ruby/object:Gem::Requirement
|
|
44
101
|
requirements:
|
|
45
102
|
- - ">="
|
|
@@ -53,7 +110,7 @@ dependencies:
|
|
|
53
110
|
- !ruby/object:Gem::Version
|
|
54
111
|
version: '0'
|
|
55
112
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
113
|
+
name: pry
|
|
57
114
|
requirement: !ruby/object:Gem::Requirement
|
|
58
115
|
requirements:
|
|
59
116
|
- - ">="
|
|
@@ -81,7 +138,7 @@ dependencies:
|
|
|
81
138
|
- !ruby/object:Gem::Version
|
|
82
139
|
version: '0'
|
|
83
140
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name:
|
|
141
|
+
name: rake
|
|
85
142
|
requirement: !ruby/object:Gem::Requirement
|
|
86
143
|
requirements:
|
|
87
144
|
- - ">="
|
|
@@ -95,7 +152,7 @@ dependencies:
|
|
|
95
152
|
- !ruby/object:Gem::Version
|
|
96
153
|
version: '0'
|
|
97
154
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name:
|
|
155
|
+
name: rspec
|
|
99
156
|
requirement: !ruby/object:Gem::Requirement
|
|
100
157
|
requirements:
|
|
101
158
|
- - ">="
|
|
@@ -127,11 +184,14 @@ email:
|
|
|
127
184
|
- stacey@touset.org
|
|
128
185
|
- muriloime@gmail.com
|
|
129
186
|
executables: []
|
|
130
|
-
extensions:
|
|
187
|
+
extensions:
|
|
188
|
+
- ext/pgn2_native/extconf.rb
|
|
131
189
|
extra_rdoc_files: []
|
|
132
190
|
files:
|
|
133
191
|
- ".github/workflows/ci.yml"
|
|
192
|
+
- ".github/workflows/native.yml"
|
|
134
193
|
- ".github/workflows/publish.yml"
|
|
194
|
+
- ".github/workflows/release-gems.yml"
|
|
135
195
|
- ".github/workflows/release.yml"
|
|
136
196
|
- ".gitignore"
|
|
137
197
|
- ".rspec"
|
|
@@ -139,6 +199,7 @@ files:
|
|
|
139
199
|
- CHANGELOG.md
|
|
140
200
|
- Gemfile
|
|
141
201
|
- LICENSE.txt
|
|
202
|
+
- NOTICE.md
|
|
142
203
|
- README.md
|
|
143
204
|
- Rakefile
|
|
144
205
|
- TODO.md
|
|
@@ -151,16 +212,39 @@ files:
|
|
|
151
212
|
- bench/baseline_parse.pre-quickwins.txt
|
|
152
213
|
- bench/baseline_parse.racc.txt
|
|
153
214
|
- bench/baseline_parse.txt
|
|
215
|
+
- bench/cross_check.rb
|
|
216
|
+
- bench/legal_moves.rb
|
|
217
|
+
- bench/perft.rb
|
|
154
218
|
- bench/profile_moves.rb
|
|
155
219
|
- bench/profile_parse.rb
|
|
156
220
|
- docs/superpowers/plans/2026-08-12-efficiency-optimizations.md
|
|
157
221
|
- docs/superpowers/plans/2026-08-12-efficiency-tests-and-profiling.md
|
|
158
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
|
|
159
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
|
|
160
229
|
- docs/superpowers/specs/2026-08-12-to-pgn-serialization-design.md
|
|
230
|
+
- docs/superpowers/specs/2026-08-13-attack-masks-design.md
|
|
231
|
+
- docs/superpowers/specs/2026-08-13-perf-internals-design.md
|
|
161
232
|
- docs/superpowers/specs/2026-08-13-pgn-performance-quick-wins-design.md
|
|
233
|
+
- docs/superpowers/specs/2026-08-13-rust-bitboard-perft-design.md
|
|
234
|
+
- docs/superpowers/specs/2026-08-14-rust-integration-design.md
|
|
162
235
|
- examples/immortal_game.pgn
|
|
236
|
+
- ext/pgn2_native/Cargo.lock
|
|
237
|
+
- ext/pgn2_native/Cargo.toml
|
|
238
|
+
- ext/pgn2_native/extconf.rb
|
|
239
|
+
- ext/pgn2_native/pgn2-bitboard/Cargo.toml
|
|
240
|
+
- ext/pgn2_native/pgn2-bitboard/src/board.rs
|
|
241
|
+
- ext/pgn2_native/pgn2-bitboard/src/lib.rs
|
|
242
|
+
- ext/pgn2_native/pgn2-bitboard/src/moves.rs
|
|
243
|
+
- ext/pgn2_native/pgn2-bitboard/src/perft.rs
|
|
244
|
+
- ext/pgn2_native/pgn2_native/Cargo.toml
|
|
245
|
+
- ext/pgn2_native/pgn2_native/src/lib.rs
|
|
163
246
|
- lib/pgn.rb
|
|
247
|
+
- lib/pgn/bitboard.rb
|
|
164
248
|
- lib/pgn/board.rb
|
|
165
249
|
- lib/pgn/fen.rb
|
|
166
250
|
- lib/pgn/game.rb
|
|
@@ -174,7 +258,9 @@ files:
|
|
|
174
258
|
- lib/pgn/position.rb
|
|
175
259
|
- lib/pgn/serializer.rb
|
|
176
260
|
- lib/pgn/version.rb
|
|
261
|
+
- lib/pgn/zobrist.rb
|
|
177
262
|
- pgn2.gemspec
|
|
263
|
+
- spec/bitboard_spec.rb
|
|
178
264
|
- spec/board_spec.rb
|
|
179
265
|
- spec/fen_spec.rb
|
|
180
266
|
- spec/game_spec.rb
|
|
@@ -201,14 +287,18 @@ files:
|
|
|
201
287
|
- spec/position_spec.rb
|
|
202
288
|
- spec/serializer_spec.rb
|
|
203
289
|
- spec/spec_helper.rb
|
|
290
|
+
- spec/zobrist_spec.rb
|
|
204
291
|
homepage: https://github.com/muriloime/pgn
|
|
205
292
|
licenses:
|
|
206
293
|
- MIT
|
|
294
|
+
- MPL-2.0
|
|
207
295
|
metadata:
|
|
208
296
|
homepage_uri: https://github.com/muriloime/pgn
|
|
209
297
|
source_code_uri: https://github.com/muriloime/pgn
|
|
210
298
|
bug_tracker_uri: https://github.com/muriloime/pgn/issues
|
|
211
299
|
changelog_uri: https://github.com/muriloime/pgn/blob/main/CHANGELOG.md
|
|
300
|
+
rubygems_mfa_required: 'true'
|
|
301
|
+
post_install_message:
|
|
212
302
|
rdoc_options: []
|
|
213
303
|
require_paths:
|
|
214
304
|
- lib
|
|
@@ -223,33 +313,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
223
313
|
- !ruby/object:Gem::Version
|
|
224
314
|
version: '0'
|
|
225
315
|
requirements: []
|
|
226
|
-
rubygems_version:
|
|
316
|
+
rubygems_version: 3.5.22
|
|
317
|
+
signing_key:
|
|
227
318
|
specification_version: 4
|
|
228
319
|
summary: A PGN parser for Ruby
|
|
229
|
-
test_files:
|
|
230
|
-
- spec/board_spec.rb
|
|
231
|
-
- spec/fen_spec.rb
|
|
232
|
-
- spec/game_spec.rb
|
|
233
|
-
- spec/lexer_spec.rb
|
|
234
|
-
- spec/move_calculator_spec.rb
|
|
235
|
-
- spec/move_spec.rb
|
|
236
|
-
- spec/notation_spec.rb
|
|
237
|
-
- spec/parser_explicit_spec.rb
|
|
238
|
-
- spec/parser_spec.rb
|
|
239
|
-
- spec/pgn_files/alternate_castling.pgn
|
|
240
|
-
- spec/pgn_files/annotations.pgn
|
|
241
|
-
- spec/pgn_files/comments.pgn
|
|
242
|
-
- spec/pgn_files/doublequotes.pgn
|
|
243
|
-
- spec/pgn_files/empty_variation_move.pgn
|
|
244
|
-
- spec/pgn_files/fen.pgn
|
|
245
|
-
- spec/pgn_files/multiline_comments.pgn
|
|
246
|
-
- spec/pgn_files/nested_comments.pgn
|
|
247
|
-
- spec/pgn_files/no_moves.pgn
|
|
248
|
-
- spec/pgn_files/specialcharacters.pgn
|
|
249
|
-
- spec/pgn_files/test.pgn
|
|
250
|
-
- spec/pgn_files/two_annotations.pgn
|
|
251
|
-
- spec/pgn_files/two_games.pgn
|
|
252
|
-
- spec/pgn_files/variations.pgn
|
|
253
|
-
- spec/position_spec.rb
|
|
254
|
-
- spec/serializer_spec.rb
|
|
255
|
-
- spec/spec_helper.rb
|
|
320
|
+
test_files: []
|