Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into bugfix/propagate-isIn…
Browse files Browse the repository at this point in the history
…cremental-eval-clone-constructor
  • Loading branch information
eduherminio committed Jan 17, 2025
2 parents cb1b31b + fb020e9 commit c433e6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Lynx/Lynx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.StaticAnalysis" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
11 changes: 4 additions & 7 deletions src/Lynx/Model/Position.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,6 @@ public GameState MakeMove(Move move)
int piece = move.Piece();
int promotedPiece = move.PromotedPiece();

// King (and castling) moves require calculating king buckets twice, so skipping incremetal eval for those cases for now
_isIncrementalEval = _isIncrementalEval
&& !(piece == (int)Piece.K
|| piece == (int)Piece.k
//|| move.IsCastle() // Not needed for now, see CastlingMovesAreKingMoves test
);

var newPiece = piece;
if (promotedPiece != default)
{
Expand Down Expand Up @@ -166,6 +159,10 @@ public GameState MakeMove(Move move)
}
else if (piece == (int)Piece.K || piece == (int)Piece.k)
{
// King (and castling) moves require calculating king buckets twice and recalculating all related parameters, so skipping incremental eval for those cases for now
// No need to check for move.IsCastle(), see CastlingMovesAreKingMoves test
_isIncrementalEval = false;

_kingPawnUniqueIdentifier ^=
sourcePieceHash
^ targetPieceHash;
Expand Down

0 comments on commit c433e6e

Please sign in to comment.