@fortemate/dicechess-engine-wasm 0.7.2 → 0.8.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.
@@ -66,6 +66,36 @@ export interface DiceChessApi {
66
66
  */
67
67
  getLegalUciMoves(dfen: string): string[];
68
68
 
69
+ /**
70
+ * Executes perft (performance test) counting leaf nodes at given depth.
71
+ * @param dfen The position in DFEN notation.
72
+ * @param depth Search depth (0 or greater).
73
+ */
74
+ perft(dfen: string, depth: number): number;
75
+
76
+ /**
77
+ * Generates all pseudo-legal moves for the active color and dice pool (or all moves if dice pool is empty).
78
+ * @param dfen The position in DFEN notation.
79
+ */
80
+ generateMoves(dfen: string): string[];
81
+
82
+ /**
83
+ * Benchmarks MoveGenerator.generateMoves in a tight loop without repeated FEN parsing.
84
+ * Returns total move count generated across all iterations.
85
+ * @param dfen The position in DFEN notation.
86
+ * @param iterations Number of iterations to execute.
87
+ */
88
+ benchGenerateMoves(dfen: string, iterations: number): number;
89
+
90
+ /**
91
+ * Benchmarks LegalMovesFilter.filterMaximalMoves in a tight loop without repeated FEN parsing.
92
+ * Returns total move count generated across all iterations.
93
+ * @param dfen The position in DFEN notation.
94
+ * @param iterations Number of iterations to execute.
95
+ */
96
+ benchFilterMaximalMoves(dfen: string, iterations: number): number;
97
+
98
+
69
99
  /**
70
100
  * Returns the piece type associated with a dice roll.
71
101
  */
package/main.js CHANGED
@@ -1,6 +1,12 @@
1
1
  import { load as __load } from "./__loader.js";
2
+ let exportedbenchFilterMaximalMoves;
3
+ export { exportedbenchFilterMaximalMoves as benchFilterMaximalMoves };
2
4
  let exportedshouldBotAcceptDouble;
3
5
  export { exportedshouldBotAcceptDouble as shouldBotAcceptDouble };
6
+ let exportedgenerateMoves;
7
+ export { exportedgenerateMoves as generateMoves };
8
+ let exportedperft;
9
+ export { exportedperft as perft };
4
10
  let exportedDiceChess;
5
11
  export { exportedDiceChess as DiceChess };
6
12
  let exportedendTurn;
@@ -9,8 +15,6 @@ let exportedestimateEquity;
9
15
  export { exportedestimateEquity as estimateEquity };
10
16
  let exportedgetAvailableTimePolicies;
11
17
  export { exportedgetAvailableTimePolicies as getAvailableTimePolicies };
12
- let exportedshouldBotAcceptDraw;
13
- export { exportedshouldBotAcceptDraw as shouldBotAcceptDraw };
14
18
  let exportedapplyMove;
15
19
  export { exportedapplyMove as applyMove };
16
20
  let exportedshouldBotOfferDraw;
@@ -25,6 +29,10 @@ let exportedgetBestMove;
25
29
  export { exportedgetBestMove as getBestMove };
26
30
  let exportedgetPieceFromDice;
27
31
  export { exportedgetPieceFromDice as getPieceFromDice };
32
+ let exportedshouldBotAcceptDraw;
33
+ export { exportedshouldBotAcceptDraw as shouldBotAcceptDraw };
34
+ let exportedbenchGenerateMoves;
35
+ export { exportedbenchGenerateMoves as benchGenerateMoves };
28
36
  let exportedshouldBotOfferDouble;
29
37
  export { exportedshouldBotOfferDouble as shouldBotOfferDouble };
30
38
  let exportedcanonicalKey;
@@ -40,9 +48,18 @@ export { exportedEngineFacade as EngineFacade };
40
48
  let exportedgetBotMove;
41
49
  export { exportedgetBotMove as getBotMove };
42
50
  (await __load("./main.wasm", ({
51
+ "benchFilterMaximalMoves": ((x) => {
52
+ exportedbenchFilterMaximalMoves = x;
53
+ }),
43
54
  "shouldBotAcceptDouble": ((x) => {
44
55
  exportedshouldBotAcceptDouble = x;
45
56
  }),
57
+ "generateMoves": ((x) => {
58
+ exportedgenerateMoves = x;
59
+ }),
60
+ "perft": ((x) => {
61
+ exportedperft = x;
62
+ }),
46
63
  "DiceChess": ((x) => {
47
64
  exportedDiceChess = x;
48
65
  }),
@@ -55,9 +72,6 @@ export { exportedgetBotMove as getBotMove };
55
72
  "getAvailableTimePolicies": ((x) => {
56
73
  exportedgetAvailableTimePolicies = x;
57
74
  }),
58
- "shouldBotAcceptDraw": ((x) => {
59
- exportedshouldBotAcceptDraw = x;
60
- }),
61
75
  "applyMove": ((x) => {
62
76
  exportedapplyMove = x;
63
77
  }),
@@ -79,6 +93,12 @@ export { exportedgetBotMove as getBotMove };
79
93
  "getPieceFromDice": ((x) => {
80
94
  exportedgetPieceFromDice = x;
81
95
  }),
96
+ "shouldBotAcceptDraw": ((x) => {
97
+ exportedshouldBotAcceptDraw = x;
98
+ }),
99
+ "benchGenerateMoves": ((x) => {
100
+ exportedbenchGenerateMoves = x;
101
+ }),
82
102
  "shouldBotOfferDouble": ((x) => {
83
103
  exportedshouldBotOfferDouble = x;
84
104
  }),
@@ -386,58 +406,70 @@ export { exportedgetBotMove as getBotMove };
386
406
  "222": ((x, x1) => x[x1]),
387
407
  "223": ((x) => x[0]),
388
408
  "224": ((x) => x[0]),
389
- "225": ((f) => (function(arg, arg$2, arg$3) {
409
+ "225": ((f) => (function(arg, arg$2) {
410
+ return f(arg, arg$2);
411
+ })),
412
+ "226": ((f) => (function(arg, arg$2, arg$3) {
390
413
  return f(arg, arg$2, arg$3);
391
414
  })),
392
- "226": ((f) => (function(arg) {
415
+ "227": ((f) => (function(arg) {
393
416
  return f(arg);
394
417
  })),
395
- "227": ((f) => (function(arg, arg$2) {
418
+ "228": ((f) => (function(arg, arg$2) {
396
419
  return f(arg, arg$2);
397
420
  })),
398
- "228": ((f) => (function() {
399
- return f();
421
+ "229": ((f) => (function(arg) {
422
+ return f(arg);
400
423
  })),
401
- "229": ((f) => (function(arg, arg$2) {
424
+ "230": ((f) => (function(arg, arg$2) {
402
425
  return f(arg, arg$2);
403
426
  })),
404
- "230": ((f) => (function(arg, arg$2, arg$3, arg$4) {
427
+ "231": ((f) => (function() {
428
+ return f();
429
+ })),
430
+ "232": ((f) => (function(arg, arg$2, arg$3, arg$4) {
405
431
  return f(arg, arg$2, arg$3, arg$4);
406
432
  })),
407
- "231": ((f) => (function(arg, arg$2) {
433
+ "233": ((f) => (function(arg, arg$2) {
408
434
  return f(arg, arg$2);
409
435
  })),
410
- "232": ((f) => (function() {
436
+ "234": ((f) => (function() {
411
437
  return f();
412
438
  })),
413
- "233": ((f) => (function(arg, arg$2, arg$3, arg$4) {
439
+ "235": ((f) => (function(arg, arg$2, arg$3, arg$4) {
414
440
  return f(arg, arg$2, arg$3, arg$4);
415
441
  })),
416
- "234": ((f) => (function(arg) {
442
+ "236": ((f) => (function(arg) {
417
443
  return f(arg);
418
444
  })),
419
- "235": ((f) => (function(arg, arg$2) {
445
+ "237": ((f) => (function(arg, arg$2) {
420
446
  return f(arg, arg$2);
421
447
  })),
422
- "236": ((f) => (function(arg) {
448
+ "238": ((f) => (function(arg) {
423
449
  return f(arg);
424
450
  })),
425
- "237": ((f) => (function(arg, arg$2, arg$3) {
451
+ "239": ((f) => (function(arg, arg$2) {
452
+ return f(arg, arg$2);
453
+ })),
454
+ "240": ((f) => (function(arg, arg$2) {
455
+ return f(arg, arg$2);
456
+ })),
457
+ "241": ((f) => (function(arg, arg$2, arg$3) {
426
458
  return f(arg, arg$2, arg$3);
427
459
  })),
428
- "238": ((f) => (function(arg) {
460
+ "242": ((f) => (function(arg) {
429
461
  return f(arg);
430
462
  })),
431
- "239": ((f) => (function(arg, arg$2, arg$3, arg$4) {
463
+ "243": ((f) => (function(arg, arg$2, arg$3, arg$4) {
432
464
  return f(arg, arg$2, arg$3, arg$4);
433
465
  })),
434
- "240": ((f) => (function(arg, arg$2) {
466
+ "244": ((f) => (function(arg, arg$2) {
435
467
  return f(arg, arg$2);
436
468
  })),
437
- "241": ((f) => (function(arg) {
469
+ "245": ((f) => (function(arg) {
438
470
  return f(arg);
439
471
  })),
440
- "242": ((f) => (function(arg, ...rest) {
472
+ "246": ((f) => (function(arg, ...rest) {
441
473
  return f(arg, rest);
442
474
  }))
443
475
  }), ({})));
package/main.wasm CHANGED
Binary file