gigachess 0.6.0 → 0.7.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.
- package/README.md +82 -49
- package/dist/attacks.d.ts +7 -4
- package/dist/attacks.d.ts.map +1 -1
- package/dist/attacks.js +36 -15
- package/dist/chess960.d.ts +2 -9
- package/dist/chess960.d.ts.map +1 -1
- package/dist/chess960.js +2 -18
- package/dist/chessjs.d.ts +1 -1
- package/dist/chessjs.d.ts.map +1 -1
- package/dist/chessjs.js +1 -1
- package/dist/chessops/board.d.ts +1 -1
- package/dist/chessops/board.d.ts.map +1 -1
- package/dist/chessops/board.js +1 -1
- package/dist/chessops/chess.d.ts +6 -10
- package/dist/chessops/chess.d.ts.map +1 -1
- package/dist/chessops/chess.js +73 -97
- package/dist/chessops/convert.d.ts +1 -1
- package/dist/chessops/convert.d.ts.map +1 -1
- package/dist/chessops/convert.js +1 -1
- package/dist/chessops/debug.d.ts.map +1 -1
- package/dist/chessops/debug.js +7 -0
- package/dist/chessops/fen.d.ts.map +1 -1
- package/dist/chessops/fen.js +13 -2
- package/dist/chessops/fenInternal.d.ts +1 -1
- package/dist/chessops/fenInternal.d.ts.map +1 -1
- package/dist/chessops/fenInternal.js +1 -1
- package/dist/chessops/nativeBridge.d.ts +14 -0
- package/dist/chessops/nativeBridge.d.ts.map +1 -0
- package/dist/chessops/nativeBridge.js +87 -0
- package/dist/chessops/san.d.ts.map +1 -1
- package/dist/chessops/san.js +12 -10
- package/dist/chesstree.d.ts.map +1 -1
- package/dist/chesstree.js +23 -62
- package/dist/core.d.ts +6 -8
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +5 -10
- package/dist/fast/index.js +1 -1
- package/dist/fast.d.ts +1 -11
- package/dist/fast.d.ts.map +1 -1
- package/dist/fast.js +2 -11
- package/dist/index.d.ts +1 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -19
- package/dist/native96.d.ts +16 -0
- package/dist/native96.d.ts.map +1 -0
- package/dist/native96.js +6 -0
- package/dist/nativeBoard96.d.ts +118 -0
- package/dist/nativeBoard96.d.ts.map +1 -0
- package/dist/nativeBoard96.js +1077 -0
- package/dist/nativeChess.d.ts +97 -0
- package/dist/nativeChess.d.ts.map +1 -0
- package/dist/nativeChess.js +201 -0
- package/dist/nativeMovegen96.d.ts +2 -0
- package/dist/nativeMovegen96.d.ts.map +1 -0
- package/dist/{standardMovegen.js → nativeMovegen96.js} +77 -48
- package/dist/nativePublicTypes.d.ts +3 -0
- package/dist/nativePublicTypes.d.ts.map +1 -0
- package/dist/nativePublicTypes.js +1 -0
- package/dist/perftCompact.d.ts +7 -0
- package/dist/perftCompact.d.ts.map +1 -1
- package/dist/perftCompact.js +124 -62
- package/dist/pgn.d.ts +2 -3
- package/dist/pgn.d.ts.map +1 -1
- package/dist/pgn.js +2 -5
- package/dist/setupBoard.d.ts +54 -0
- package/dist/setupBoard.d.ts.map +1 -0
- package/dist/setupBoard.js +249 -0
- package/dist/{fen.d.ts → setupFen.d.ts} +1 -1
- package/dist/setupFen.d.ts.map +1 -0
- package/dist/{fen.js → setupFen.js} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/zobrist.d.ts +2 -2
- package/dist/zobrist.d.ts.map +1 -1
- package/package.json +10 -7
- package/dist/board.d.ts +0 -242
- package/dist/board.d.ts.map +0 -1
- package/dist/board.js +0 -1403
- package/dist/chess.d.ts +0 -259
- package/dist/chess.d.ts.map +0 -1
- package/dist/chess.js +0 -2314
- package/dist/fen.d.ts.map +0 -1
- package/dist/san.d.ts +0 -38
- package/dist/san.d.ts.map +0 -1
- package/dist/san.js +0 -523
- package/dist/standardMovegen.d.ts +0 -3
- package/dist/standardMovegen.d.ts.map +0 -1
package/dist/chessops/chess.js
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
// position, exactly like baseline) while delegating all rules to the immutable
|
|
4
4
|
// gigachess engine. Caller-provided values (Setup, Move) are never mutated.
|
|
5
5
|
import { Result } from "./result.js";
|
|
6
|
-
import * as engine from "../chess.js";
|
|
7
6
|
import * as engineAttacks from "../attacks.js";
|
|
8
7
|
import { Board, boardEquals } from "./board.js";
|
|
9
8
|
import { SquareSet } from "./squareSet.js";
|
|
10
|
-
import {
|
|
9
|
+
import { boardToEngine } from "./convert.js";
|
|
11
10
|
import { isDrop } from "./types.js";
|
|
12
|
-
import {
|
|
11
|
+
import { parseFen as parseFenInternal } from "./fen.js";
|
|
13
12
|
import { INITIAL_FEN } from "./fenInternal.js";
|
|
13
|
+
import { nativeFromSetup, nativeBoardProjection, nativeRights, nativeWord, nativePosition } from "./nativeBridge.js";
|
|
14
14
|
export var IllegalSetup;
|
|
15
15
|
(function (IllegalSetup) {
|
|
16
16
|
IllegalSetup["Empty"] = "ERR_EMPTY";
|
|
@@ -98,7 +98,6 @@ export class Castles {
|
|
|
98
98
|
}
|
|
99
99
|
export class Position {
|
|
100
100
|
constructor(rules) {
|
|
101
|
-
this._epos = null;
|
|
102
101
|
this.rules = rules;
|
|
103
102
|
this.board = Board.empty();
|
|
104
103
|
this.pockets = undefined;
|
|
@@ -128,22 +127,6 @@ export class Position {
|
|
|
128
127
|
this.fullmoves = setup.fullmoves;
|
|
129
128
|
this.invalidate();
|
|
130
129
|
}
|
|
131
|
-
/** Lazily rebuilt engine position (rebuilt after every mutation). Built
|
|
132
|
-
* directly from the raw fields — NOT via toSetup(), whose legalEpSquare
|
|
133
|
-
* filter would recurse. The raw ep square is what baseline keeps on the
|
|
134
|
-
* position too; the legal-ep filter only applies to toSetup(). */
|
|
135
|
-
epos() {
|
|
136
|
-
if (this._epos === null) {
|
|
137
|
-
const sets = { white: new Set(), black: new Set() };
|
|
138
|
-
for (const s of this.castles.castlingRights) {
|
|
139
|
-
const p = this.board.get(s);
|
|
140
|
-
if (p && p.role === "rook")
|
|
141
|
-
(p.color === "white" ? sets.white : sets.black).add(s);
|
|
142
|
-
}
|
|
143
|
-
this._epos = setupToEngine(this.toSetupRaw());
|
|
144
|
-
}
|
|
145
|
-
return this._epos;
|
|
146
|
-
}
|
|
147
130
|
/** baseline keeps the RAW ep square on the position (toSetup() applies the
|
|
148
131
|
* legalEpSquare filter); this internal view mirrors that. */
|
|
149
132
|
toSetupRaw() {
|
|
@@ -159,7 +142,18 @@ export class Position {
|
|
|
159
142
|
};
|
|
160
143
|
}
|
|
161
144
|
invalidate() {
|
|
162
|
-
this.
|
|
145
|
+
this._native = undefined;
|
|
146
|
+
}
|
|
147
|
+
/** Internal playable native projection. Public facade setters replace
|
|
148
|
+
* board._b; metadata identities/values invalidate the projection too. */
|
|
149
|
+
[nativePosition]() {
|
|
150
|
+
const prev = this._native;
|
|
151
|
+
const board = this.board._b, rights = this.castles.castlingRights;
|
|
152
|
+
if (prev && prev.board === board && prev.rights === rights && prev.turn === this.turn && prev.ep === this.epSquare && prev.half === this.halfmoves && prev.full === this.fullmoves)
|
|
153
|
+
return prev.position;
|
|
154
|
+
const position = nativeFromSetup(this.toSetupRaw());
|
|
155
|
+
this._native = { board, rights, turn: this.turn, ep: this.epSquare, half: this.halfmoves, full: this.fullmoves, position };
|
|
156
|
+
return position;
|
|
163
157
|
}
|
|
164
158
|
toSetup() {
|
|
165
159
|
return {
|
|
@@ -178,20 +172,9 @@ export class Position {
|
|
|
178
172
|
legalEpSquare() {
|
|
179
173
|
if (this.epSquare === undefined)
|
|
180
174
|
return undefined;
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const attackers = engineAttacks.pawnAttacks(themColor, this.epSquare);
|
|
185
|
-
const ourPawns = this.board.pieces(this.turn, "pawn");
|
|
186
|
-
const candidates = toFacadeSet({ lo: attackers.lo & ourPawns.lo, hi: attackers.hi & ourPawns.hi });
|
|
187
|
-
for (const from of candidates) {
|
|
188
|
-
const d = engine.dests(epos, from);
|
|
189
|
-
const has = this.epSquare < 32
|
|
190
|
-
? ((d.lo >>> this.epSquare) & 1) === 1
|
|
191
|
-
: ((d.hi >>> (this.epSquare - 32)) & 1) === 1;
|
|
192
|
-
if (has)
|
|
193
|
-
return this.epSquare;
|
|
194
|
-
}
|
|
175
|
+
const native = this[nativePosition]();
|
|
176
|
+
if (native)
|
|
177
|
+
return native.hasLegalEp() ? this.epSquare : undefined;
|
|
195
178
|
return undefined;
|
|
196
179
|
}
|
|
197
180
|
kingAttackers(square, attacker, occupied) {
|
|
@@ -240,17 +223,26 @@ export class Position {
|
|
|
240
223
|
}
|
|
241
224
|
/** Internal: drop the cached engine position after any mutation. */
|
|
242
225
|
dropCache() {
|
|
243
|
-
this.
|
|
244
|
-
}
|
|
245
|
-
/** Internal: engine position for sibling facade modules (san/fen/debug). */
|
|
246
|
-
eposInternal() {
|
|
247
|
-
return this.epos();
|
|
226
|
+
this.invalidate();
|
|
248
227
|
}
|
|
249
228
|
dropDests(_ctx) {
|
|
250
229
|
return SquareSet.empty();
|
|
251
230
|
}
|
|
252
231
|
dests(square, _ctx) {
|
|
253
|
-
|
|
232
|
+
const native = this[nativePosition]();
|
|
233
|
+
if (native) {
|
|
234
|
+
let lo = 0, hi = 0;
|
|
235
|
+
for (const word of native.legalMoves())
|
|
236
|
+
if ((word & 63) === square) {
|
|
237
|
+
const to = (word >>> 6) & 63;
|
|
238
|
+
if (to < 32)
|
|
239
|
+
lo |= 1 << to;
|
|
240
|
+
else
|
|
241
|
+
hi |= 1 << (to - 32);
|
|
242
|
+
}
|
|
243
|
+
return new SquareSet(lo, hi);
|
|
244
|
+
}
|
|
245
|
+
return SquareSet.empty();
|
|
254
246
|
}
|
|
255
247
|
isVariantEnd() {
|
|
256
248
|
return false;
|
|
@@ -282,42 +274,33 @@ export class Position {
|
|
|
282
274
|
return !(dark && light);
|
|
283
275
|
}
|
|
284
276
|
isInsufficientMaterial() {
|
|
285
|
-
return
|
|
277
|
+
return this[nativePosition]()?.isInsufficientMaterial() ?? false;
|
|
286
278
|
}
|
|
287
279
|
hasDests(_ctx) {
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
continue;
|
|
292
|
-
const d = engine.dests(epos, s);
|
|
293
|
-
if (d.lo !== 0 || d.hi !== 0)
|
|
294
|
-
return true;
|
|
295
|
-
}
|
|
280
|
+
const native = this[nativePosition]();
|
|
281
|
+
if (native)
|
|
282
|
+
return native.countLegalMoves() > 0;
|
|
296
283
|
return false;
|
|
297
284
|
}
|
|
298
285
|
isLegal(move, _ctx) {
|
|
299
286
|
if (isDrop(move))
|
|
300
287
|
return false;
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
303
|
-
return
|
|
304
|
-
|
|
305
|
-
return false;
|
|
306
|
-
if (piece.role === "pawn" && (move.to >= 56 || move.to < 8) && !move.promotion)
|
|
307
|
-
return false;
|
|
308
|
-
return true;
|
|
288
|
+
const native = this[nativePosition]();
|
|
289
|
+
if (native)
|
|
290
|
+
return native.isLegal(nativeWord(move));
|
|
291
|
+
return false;
|
|
309
292
|
}
|
|
310
293
|
isCheck() {
|
|
311
|
-
return
|
|
294
|
+
return this[nativePosition]()?.inCheck() ?? false;
|
|
312
295
|
}
|
|
313
296
|
isEnd(_ctx) {
|
|
314
297
|
return this.isVariantEnd() || this.isCheckmate() || this.isStalemate();
|
|
315
298
|
}
|
|
316
299
|
isCheckmate(_ctx) {
|
|
317
|
-
return
|
|
300
|
+
return this[nativePosition]()?.isCheckmate() ?? false;
|
|
318
301
|
}
|
|
319
302
|
isStalemate(_ctx) {
|
|
320
|
-
return
|
|
303
|
+
return this[nativePosition]()?.isStalemate() ?? false;
|
|
321
304
|
}
|
|
322
305
|
outcome(_ctx) {
|
|
323
306
|
if (this.isVariantEnd())
|
|
@@ -331,41 +314,37 @@ export class Position {
|
|
|
331
314
|
allDests(_ctx) {
|
|
332
315
|
// baseline-exact: one entry per OWN piece, including empty dests for
|
|
333
316
|
// pieces with no legal moves (e.g. the black backrank after 1.d4).
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
317
|
+
const native = this[nativePosition]();
|
|
318
|
+
if (native) {
|
|
319
|
+
const out = new Map();
|
|
320
|
+
for (const [s, piece] of this.board)
|
|
321
|
+
if (piece.color === this.turn)
|
|
322
|
+
out.set(s, SquareSet.empty());
|
|
323
|
+
for (const word of native.legalMoves()) {
|
|
324
|
+
const from = word & 63, to = (word >>> 6) & 63;
|
|
325
|
+
out.set(from, out.get(from).with(to));
|
|
326
|
+
}
|
|
327
|
+
return out;
|
|
340
328
|
}
|
|
341
|
-
return
|
|
329
|
+
return new Map();
|
|
342
330
|
}
|
|
343
331
|
play(move) {
|
|
344
332
|
if (isDrop(move))
|
|
345
333
|
throw new Error("Drops are not supported in standard chess");
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
board: this.board,
|
|
361
|
-
pockets: undefined,
|
|
362
|
-
turn: this.turn,
|
|
363
|
-
castlingRights: rights,
|
|
364
|
-
epSquare: undefined,
|
|
365
|
-
remainingChecks: undefined,
|
|
366
|
-
halfmoves: 0,
|
|
367
|
-
fullmoves: 1,
|
|
368
|
-
});
|
|
334
|
+
const native = this[nativePosition](), word = nativeWord(move);
|
|
335
|
+
if (native && native.isLegal(word)) {
|
|
336
|
+
native.playTrusted(word);
|
|
337
|
+
this.board._b = nativeBoardProjection(native);
|
|
338
|
+
this.turn = native.turn ? "white" : "black";
|
|
339
|
+
this.epSquare = native.epSquare ?? undefined;
|
|
340
|
+
this.halfmoves = native.halfmove;
|
|
341
|
+
this.fullmoves = native.fullmove;
|
|
342
|
+
this.castles = Castles.fromSetup({ ...this.toSetupRaw(), castlingRights: nativeRights(native) });
|
|
343
|
+
this.invalidate();
|
|
344
|
+
this._native = { board: this.board._b, rights: this.castles.castlingRights, turn: this.turn, ep: this.epSquare, half: this.halfmoves, full: this.fullmoves, position: native };
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
throw new PositionError("Illegal move or non-playable setup");
|
|
369
348
|
}
|
|
370
349
|
}
|
|
371
350
|
export class Chess extends Position {
|
|
@@ -381,12 +360,9 @@ export class Chess extends Position {
|
|
|
381
360
|
static fromSetup(setup) {
|
|
382
361
|
const pos = new Chess();
|
|
383
362
|
pos.setupUnchecked(setup);
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
if (r.isErr)
|
|
388
|
-
return Result.err(new PositionError(r.error.message));
|
|
389
|
-
return Result.ok(pos);
|
|
363
|
+
if (pos[nativePosition]())
|
|
364
|
+
return Result.ok(pos);
|
|
365
|
+
return Result.err(new PositionError("Invalid playable Board96 setup"));
|
|
390
366
|
}
|
|
391
367
|
static fromSetupUnchecked(setup) {
|
|
392
368
|
const pos = new Chess();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BoardLike as EngineBoard } from "../
|
|
1
|
+
import type { BoardLike as EngineBoard } from "../setupBoard.js";
|
|
2
2
|
import type { Move as EngineMove, Position as EnginePosition } from "../types.js";
|
|
3
3
|
import { Role as ERole, Color as EColor } from "../types.js";
|
|
4
4
|
import type { CastlingRights as EngineCastlingRights } from "../types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/chessops/convert.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/chessops/convert.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,IAAI,IAAI,KAAK,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CAAC,MAAM,CAAC,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,GAAG,oBAAoB,CASrG;AAED,yCAAyC;AACzC,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,CAU1D;AAED,yCAAyC;AACzC,wBAAgB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,KAAK,CAiB1D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CAoBhF;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,gBAAgB,CAI5D"}
|
package/dist/chessops/convert.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/baseline/convert.ts — internal engine <-> facade converters (ADR-014).
|
|
2
2
|
// Not part of the public API. The facade never mutates caller-provided values;
|
|
3
3
|
// conversions produce fresh engine positions (the engine itself is immutable).
|
|
4
|
-
import * as engineBoardMod from "../
|
|
4
|
+
import * as engineBoardMod from "../setupBoard.js";
|
|
5
5
|
import { Role as ERole, Color as EColor } from "../types.js";
|
|
6
6
|
import { Board } from "./board.js";
|
|
7
7
|
import { SquareSet } from "./squareSet.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/chessops/debug.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/chessops/debug.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAQ,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGtD,eAAO,MAAM,SAAS,GAAI,SAAS,SAAS,KAAG,MAAiD,CAAC;AAEjG,eAAO,MAAM,KAAK,GAAI,GAAG,KAAK,KAAG,MAAgC,CAAC;AAElE,eAAO,MAAM,KAAK,GAAI,GAAG,KAAK,KAAG,MAWhC,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,IAAI,MAAM,KAAG,MAAwB,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,QAAQ,KAAG,MAW1C,CAAC;AAGF,eAAO,MAAM,KAAK,GAAI,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,KAAG,MAC8D,CAAC;AAEjH,eAAO,MAAM,KAAK,GAAI,KAAK,QAAQ,EAAE,OAAO,MAAM,EAAE,aAAW,KAAG,MAgCjE,CAAC"}
|
package/dist/chessops/debug.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// src/baseline/debug.ts — baseline-exact debug helpers (ADR-014).
|
|
2
|
+
import { nativePosition } from "./nativeBridge.js";
|
|
1
3
|
import { makeSquare, roleToChar } from "./util.js";
|
|
2
4
|
export const squareSet = (squares) => [...squares].map(makeSquare).join(", ");
|
|
3
5
|
export const piece = (p) => `${p.color} ${p.role}`;
|
|
@@ -33,6 +35,11 @@ export const debugBoard = (pos) => {
|
|
|
33
35
|
};
|
|
34
36
|
export const dests = (d) => [...d.entries()].map(([from, set]) => `${makeSquare(from)}: ${[...set].map(makeSquare).join(" ")}`).join("\n");
|
|
35
37
|
export const perft = (pos, depth, log = false) => {
|
|
38
|
+
if (!log) {
|
|
39
|
+
const native = pos[nativePosition]();
|
|
40
|
+
if (native)
|
|
41
|
+
return native.perft(depth);
|
|
42
|
+
}
|
|
36
43
|
if (depth === 0)
|
|
37
44
|
return 1;
|
|
38
45
|
if (depth === 1) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fen.d.ts","sourceRoot":"","sources":["../../src/chessops/fen.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,E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G,MAGtD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,KAAG,MAE3C,CAAC"}
|
package/dist/chessops/fen.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
// immutable engine parser (which additionally accepts unreachable ep squares
|
|
3
3
|
// and 4-field FENs per the purechess-rules spec — baseline-compatible).
|
|
4
4
|
import { Result } from "./result.js";
|
|
5
|
-
import * as engineFen from "../
|
|
5
|
+
import * as engineFen from "../setupFen.js";
|
|
6
|
+
import { Board } from "./board.js";
|
|
7
|
+
import { Board96 } from "../nativeBoard96.js";
|
|
8
|
+
import { nativeFromSetup, nativeBoardProjection, nativeRights } from "./nativeBridge.js";
|
|
6
9
|
import { SquareSet } from "./squareSet.js";
|
|
7
10
|
import { boardFromEngine, boardToEngine, setupFromEngine, setupToEngine } from "./convert.js";
|
|
8
11
|
import { EMPTY_BOARD_FEN, EMPTY_EPD, EMPTY_FEN, INITIAL_BOARD_FEN, INITIAL_EPD, INITIAL_FEN, engineBoardFromPlacement, engineMakePlacement, } from "./fenInternal.js";
|
|
@@ -60,13 +63,21 @@ export const parseCastlingFen = (board, castlingPart) => {
|
|
|
60
63
|
return Result.ok(rights);
|
|
61
64
|
};
|
|
62
65
|
export const parseFen = (fen) => {
|
|
66
|
+
// Native playable FEN includes X-FEN/Shredder castling. Retain the
|
|
67
|
+
// historical parser for permissive setup values outside Board96.
|
|
68
|
+
try {
|
|
69
|
+
const n = Board96.fromFen(fen), board = Board.empty();
|
|
70
|
+
board._b = nativeBoardProjection(n);
|
|
71
|
+
return Result.ok({ board, pockets: undefined, turn: n.turn ? "white" : "black", castlingRights: nativeRights(n), epSquare: n.epSquare ?? undefined, remainingChecks: undefined, halfmoves: n.halfmove, fullmoves: n.fullmove });
|
|
72
|
+
}
|
|
73
|
+
catch { }
|
|
63
74
|
const r = engineFen.parseFen(fen);
|
|
64
75
|
if (!r.ok)
|
|
65
76
|
return Result.err(new FenError(r.error?.code ?? InvalidFen.Fen));
|
|
66
77
|
return Result.ok(setupFromEngine(r.value));
|
|
67
78
|
};
|
|
68
79
|
export const makeFen = (setup, opts) => {
|
|
69
|
-
const full = engineFen.makeFen(setupToEngine(setup));
|
|
80
|
+
const full = nativeFromSetup(setup)?.toFen() ?? engineFen.makeFen(setupToEngine(setup));
|
|
70
81
|
return opts?.epd ? full.split(" ").slice(0, 4).join(" ") : full;
|
|
71
82
|
};
|
|
72
83
|
export const makeBoardFen = (board) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BoardLike as EngineBoard } from "../
|
|
1
|
+
import type { BoardLike as EngineBoard } from "../setupBoard.js";
|
|
2
2
|
export declare const INITIAL_BOARD_FEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR";
|
|
3
3
|
export declare const INITIAL_EPD = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -";
|
|
4
4
|
export declare const INITIAL_FEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fenInternal.d.ts","sourceRoot":"","sources":["../../src/chessops/fenInternal.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fenInternal.d.ts","sourceRoot":"","sources":["../../src/chessops/fenInternal.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIjE,eAAO,MAAM,iBAAiB,gDAAgD,CAAC;AAC/E,eAAO,MAAM,WAAW,yDAAyD,CAAC;AAClF,eAAO,MAAM,WAAW,6DAA6D,CAAC;AACtF,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,SAAS,0BAA0B,CAAC;AACjD,eAAO,MAAM,SAAS,8BAA8B,CAAC;AAErD;gCACgC;AAChC,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,CAIvE;AAWD;;kCAEkC;AAClC,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAU9D"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// facade modules (ADR-014). Not part of the public API. Single-sourced FEN
|
|
3
3
|
// constants + placement codecs (gigachess-adopt task 3.2; formerly
|
|
4
4
|
// `gigachess`, ADR-015).
|
|
5
|
-
import { parseFen as engineParseFen, makeFen as engineMakeFen } from "../
|
|
5
|
+
import { parseFen as engineParseFen, makeFen as engineMakeFen } from "../setupFen.js";
|
|
6
6
|
import { Color } from "../types.js";
|
|
7
7
|
export const INITIAL_BOARD_FEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR";
|
|
8
8
|
export const INITIAL_EPD = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Board96 } from "../nativeBoard96.js";
|
|
2
|
+
import type { BoardLike } from "../setupBoard.js";
|
|
3
|
+
export declare function nativeBoardProjection(b: Board96): BoardLike;
|
|
4
|
+
import type { Setup } from "./setup.js";
|
|
5
|
+
import type { NormalMove } from "./types.js";
|
|
6
|
+
import { SquareSet } from "./squareSet.js";
|
|
7
|
+
export declare const nativePosition: unique symbol;
|
|
8
|
+
/** Returns null for legacy editor/unchecked states not representable in
|
|
9
|
+
* the playable Board96 contract. Never silently discard such metadata. */
|
|
10
|
+
export declare function nativeFromSetup(setup: Setup): Board96 | null;
|
|
11
|
+
export declare function nativeRights(b: Board96): SquareSet;
|
|
12
|
+
export declare function nativeWord(move: NormalMove): number;
|
|
13
|
+
export declare function nativeMove(word: number): NormalMove;
|
|
14
|
+
//# sourceMappingURL=nativeBridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeBridge.d.ts","sourceRoot":"","sources":["../../src/chessops/nativeBridge.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,wBAAgB,qBAAqB,CAAC,CAAC,EAAC,OAAO,GAAE,SAAS,CAIzD;AACD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,eAAO,MAAM,cAAc,eAA4C,CAAC;AAIxE;0EAC0E;AAC1E,wBAAgB,eAAe,CAAC,KAAK,EAAC,KAAK,GAAE,OAAO,GAAC,IAAI,CAuBxD;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAC,OAAO,GAAE,SAAS,CAIhD;AACD,wBAAgB,UAAU,CAAC,IAAI,EAAC,UAAU,GAAE,MAAM,CAMjD;AACD,wBAAgB,UAAU,CAAC,IAAI,EAAC,MAAM,GAAE,UAAU,CAIjD"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// MIT GigaChess — explicit setup/projection boundary for chessops facade.
|
|
2
|
+
// Playable positions use the direct native Board96 engine. The facade's
|
|
3
|
+
// editable Board and non-playable setup values remain independent values.
|
|
4
|
+
import { Board96 } from "../nativeBoard96.js";
|
|
5
|
+
export function nativeBoardProjection(b) {
|
|
6
|
+
const w = new Uint32Array(16);
|
|
7
|
+
b.readBitboardsInto(w);
|
|
8
|
+
const mask = (i) => ({ lo: w[i], hi: w[i + 1] });
|
|
9
|
+
return { pawn: mask(0), knight: mask(2), bishop: mask(4), rook: mask(6), queen: mask(8), king: mask(10), black: mask(12), white: mask(14), occupied: { lo: (w[12] | w[14]) >>> 0, hi: (w[13] | w[15]) >>> 0 }, promoted: { lo: 0, hi: 0 }, kingSq: [b.kingSquare(1), b.kingSquare(0)] };
|
|
10
|
+
}
|
|
11
|
+
import { SquareSet } from "./squareSet.js";
|
|
12
|
+
// Module-internal symbol; the public facade does not expose a mutable native board.
|
|
13
|
+
export const nativePosition = Symbol("gigachess.chessops.nativePosition");
|
|
14
|
+
const roles = ["pawn", "knight", "bishop", "rook", "queen", "king"];
|
|
15
|
+
const standardRooks = [7, 0, 63, 56];
|
|
16
|
+
/** Returns null for legacy editor/unchecked states not representable in
|
|
17
|
+
* the playable Board96 contract. Never silently discard such metadata. */
|
|
18
|
+
export function nativeFromSetup(setup) {
|
|
19
|
+
if (setup.pockets !== undefined || setup.remainingChecks !== undefined)
|
|
20
|
+
return null;
|
|
21
|
+
const b = setup.board._b;
|
|
22
|
+
if (b.promoted.lo || b.promoted.hi)
|
|
23
|
+
return null;
|
|
24
|
+
if ((b.occupied.lo >>> 0) !== ((b.black.lo | b.white.lo) >>> 0) || (b.occupied.hi >>> 0) !== ((b.black.hi | b.white.hi) >>> 0))
|
|
25
|
+
return null;
|
|
26
|
+
const words = new Uint32Array(16);
|
|
27
|
+
for (let r = 0; r < 6; r++) {
|
|
28
|
+
const p = b[roles[r]];
|
|
29
|
+
words[2 * r] = p.lo;
|
|
30
|
+
words[2 * r + 1] = p.hi;
|
|
31
|
+
}
|
|
32
|
+
words[12] = b.black.lo;
|
|
33
|
+
words[13] = b.black.hi;
|
|
34
|
+
words[14] = b.white.lo;
|
|
35
|
+
words[15] = b.white.hi;
|
|
36
|
+
const kings = [setup.board.kingOf("black"), setup.board.kingOf("white")];
|
|
37
|
+
if (kings[0] === undefined || kings[1] === undefined)
|
|
38
|
+
return null;
|
|
39
|
+
const rooks = [undefined, undefined, undefined, undefined];
|
|
40
|
+
let variant = false;
|
|
41
|
+
for (const square of setup.castlingRights) {
|
|
42
|
+
const p = setup.board.get(square);
|
|
43
|
+
if (!p || p.role !== "rook")
|
|
44
|
+
return null;
|
|
45
|
+
const side = p.color === "white" ? 1 : 0, k = kings[side];
|
|
46
|
+
const i = (side ? 0 : 2) + ((square & 7) > (k & 7) ? 0 : 1);
|
|
47
|
+
if (rooks[i] !== undefined)
|
|
48
|
+
return null;
|
|
49
|
+
rooks[i] = square;
|
|
50
|
+
if (square !== standardRooks[i] || k !== (side ? 4 : 60))
|
|
51
|
+
variant = true;
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
return Board96.fromFields({ bitboards: words, turn: setup.turn === "white" ? 1 : 0, castleRooks: rooks, epSquare: setup.epSquare ?? null, halfmove: setup.halfmoves, fullmove: setup.fullmoves, isChess960: variant });
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export function nativeRights(b) {
|
|
61
|
+
let lo = 0, hi = 0;
|
|
62
|
+
for (let i = 0; i < 4; i++) {
|
|
63
|
+
const r = b.castleRookSquare(i);
|
|
64
|
+
if (r !== undefined) {
|
|
65
|
+
if (r < 32)
|
|
66
|
+
lo |= 1 << r;
|
|
67
|
+
else
|
|
68
|
+
hi |= 1 << (r - 32);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return new SquareSet(lo, hi);
|
|
72
|
+
}
|
|
73
|
+
export function nativeWord(move) {
|
|
74
|
+
const p = move.promotion === undefined ? 0 : roles.indexOf(move.promotion);
|
|
75
|
+
// Only the four legal promotion roles are representable.
|
|
76
|
+
if (move.promotion !== undefined && (p < 1 || p > 4))
|
|
77
|
+
return -1;
|
|
78
|
+
if (!Number.isInteger(move.from) || !Number.isInteger(move.to) || move.from < 0 || move.from > 63 || move.to < 0 || move.to > 63)
|
|
79
|
+
return -1;
|
|
80
|
+
return move.from | (move.to << 6) | (p << 12);
|
|
81
|
+
}
|
|
82
|
+
export function nativeMove(word) {
|
|
83
|
+
const move = { from: word & 63, to: (word >>> 6) & 63 };
|
|
84
|
+
if (word >>> 12)
|
|
85
|
+
move.promotion = roles[word >>> 12];
|
|
86
|
+
return move;
|
|
87
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"san.d.ts","sourceRoot":"","sources":["../../src/chessops/san.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"san.d.ts","sourceRoot":"","sources":["../../src/chessops/san.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIvC,eAAO,MAAM,OAAO,GAAI,KAAK,QAAQ,EAAE,MAAM,IAAI,KAAG,MAKnD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,KAAK,QAAQ,EAAE,MAAM,IAAI,KAAG,MAI1D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,KAAK,QAAQ,EAAE,WAAW,IAAI,EAAE,KAAG,MASnE,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,KAAK,QAAQ,EAAE,KAAK,MAAM,KAAG,IAAI,GAAG,SAI5D,CAAC"}
|
package/dist/chessops/san.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
// src/baseline/san.ts — baseline-exact SAN API (ADR-014): position-first
|
|
2
|
-
// signatures, `parseSan` returns `Move | undefined`.
|
|
3
|
-
import * as engineSan from "../san.js";
|
|
4
1
|
import { isDrop } from "./types.js";
|
|
5
|
-
import {
|
|
2
|
+
import { nativeMove, nativeWord, nativePosition } from "./nativeBridge.js";
|
|
6
3
|
export const makeSan = (pos, move) => {
|
|
7
4
|
if (isDrop(move))
|
|
8
5
|
throw new Error("Drops are not supported in standard chess");
|
|
9
|
-
const
|
|
10
|
-
|
|
6
|
+
const native = pos[nativePosition](), word = nativeWord(move);
|
|
7
|
+
if (native && native.isLegal(word))
|
|
8
|
+
return native.toSan(word);
|
|
9
|
+
throw Error("Illegal move or non-playable setup");
|
|
11
10
|
};
|
|
12
11
|
export const makeSanAndPlay = (pos, move) => {
|
|
13
12
|
const san = makeSan(pos, move);
|
|
@@ -26,8 +25,11 @@ export const makeSanVariation = (pos, variation) => {
|
|
|
26
25
|
return parts.join(" ");
|
|
27
26
|
};
|
|
28
27
|
export const parseSan = (pos, san) => {
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
const native = pos[nativePosition]();
|
|
29
|
+
if (native) {
|
|
30
|
+
const word = native.parseSan(san, false);
|
|
31
|
+
if (word !== null && word !== 65535)
|
|
32
|
+
return nativeMove(word);
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
33
35
|
};
|
package/dist/chesstree.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chesstree.d.ts","sourceRoot":"","sources":["../src/chesstree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chesstree.d.ts","sourceRoot":"","sources":["../src/chesstree.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAE1B,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;6DAE6D;AAC7D,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAwB/D,CAAC;AAEH;uDACuD;AACvD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAG9C;AAED,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,C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