Skip to content

Commit

Permalink
⚖ Allow bucketed PSQTs + implement friendly king related PSQTs (king/…
Browse files Browse the repository at this point in the history
…queenside) (#873)

- Allow bucketed PSQTs, with a constant (`PSQTBucketCount`) that determines the number of buckets/PSQT instances per conceptual PSQT.
  They're `short[PSQTBucketCount][64]` now, with `PackedPSQT` being `short[2][12][64]` (candidate for flattenning?)
-  Make `PSQTBucketCount = 2` and split PSQTs according to friendly king in kingside or queenside of the board.
  • Loading branch information
eduherminio authored Jul 30, 2024
1 parent 572c9b6 commit f5a2260
Show file tree
Hide file tree
Showing 8 changed files with 537 additions and 369 deletions.
24 changes: 12 additions & 12 deletions src/Lynx.Benchmark/EnumCasting_Benchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public int Constant(int iterations)
var sum = 0;
for (int i = 0; i < iterations; ++i)
{
sum += EvaluationConstants.MiddleGamePieceValues[Pawn];
sum += EvaluationConstants.MiddleGamePieceValues[Pawn];
sum += EvaluationConstants.MiddleGamePieceValues[Pawn];
sum += EvaluationConstants.MiddleGamePieceValues[Pawn];
sum += EvaluationConstants.MiddleGamePieceValues[Pawn];
sum += EvaluationConstants.MiddleGamePieceValues[Pawn];
sum += EvaluationConstants.MiddleGamePieceValues[0][Pawn];
sum += EvaluationConstants.MiddleGamePieceValues[0][Pawn];
sum += EvaluationConstants.MiddleGamePieceValues[0][Pawn];
sum += EvaluationConstants.MiddleGamePieceValues[0][Pawn];
sum += EvaluationConstants.MiddleGamePieceValues[0][Pawn];
sum += EvaluationConstants.MiddleGamePieceValues[0][Pawn];
}

return sum;
Expand All @@ -53,12 +53,12 @@ public int Cast(int iterations)
var sum = 0;
for (int i = 0; i < iterations; ++i)
{
sum += EvaluationConstants.MiddleGamePieceValues[(int)Piece.P];
sum += EvaluationConstants.MiddleGamePieceValues[(int)Piece.P];
sum += EvaluationConstants.MiddleGamePieceValues[(int)Piece.P];
sum += EvaluationConstants.MiddleGamePieceValues[(int)Piece.P];
sum += EvaluationConstants.MiddleGamePieceValues[(int)Piece.P];
sum += EvaluationConstants.MiddleGamePieceValues[(int)Piece.P];
sum += EvaluationConstants.MiddleGamePieceValues[0][(int)Piece.P];
sum += EvaluationConstants.MiddleGamePieceValues[0][(int)Piece.P];
sum += EvaluationConstants.MiddleGamePieceValues[0][(int)Piece.P];
sum += EvaluationConstants.MiddleGamePieceValues[0][(int)Piece.P];
sum += EvaluationConstants.MiddleGamePieceValues[0][(int)Piece.P];
sum += EvaluationConstants.MiddleGamePieceValues[0][(int)Piece.P];
}

return sum;
Expand Down
Loading

0 comments on commit f5a2260

Please sign in to comment.