From 983a7290ca8a25fea10e1f0d00df57e86fa81e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20C=C3=A1ceres?= Date: Sat, 11 Jan 2025 02:52:00 +0100 Subject: [PATCH] Hey, let's try --- src/Lynx/Model/Position.cs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Lynx/Model/Position.cs b/src/Lynx/Model/Position.cs index 8628751ea..1613c4f8e 100644 --- a/src/Lynx/Model/Position.cs +++ b/src/Lynx/Model/Position.cs @@ -624,8 +624,8 @@ public bool WasProduceByAValidMove() var pieceSquareIndex = bitboard.GetLS1BIndex(); bitboard.ResetLS1B(); - _incrementalEvalAccumulator += PSQT(0, whiteBucket, pieceIndex, pieceSquareIndex) - + PSQT(1, blackBucket, pieceIndex, pieceSquareIndex); + _incrementalEvalAccumulator += PSQT(0, whiteBucket, pieceIndex, pieceSquareIndex); + _incrementalEvalAccumulator += PSQT(1, blackBucket, pieceIndex, pieceSquareIndex); gamePhase += GamePhaseByPiece[pieceIndex]; @@ -647,8 +647,8 @@ public bool WasProduceByAValidMove() var pieceSquareIndex = bitboard.GetLS1BIndex(); bitboard.ResetLS1B(); - _incrementalEvalAccumulator += PSQT(0, blackBucket, pieceIndex, pieceSquareIndex) - + PSQT(1, whiteBucket, pieceIndex, pieceSquareIndex); + _incrementalEvalAccumulator += PSQT(0, blackBucket, pieceIndex, pieceSquareIndex); + _incrementalEvalAccumulator += PSQT(1, whiteBucket, pieceIndex, pieceSquareIndex); gamePhase += GamePhaseByPiece[pieceIndex]; @@ -657,19 +657,17 @@ public bool WasProduceByAValidMove() } // Kings - _incrementalEvalAccumulator += - PSQT(0, whiteBucket, (int)Piece.K, whiteKing) - + PSQT(1, blackBucket, (int)Piece.K, whiteKing) - + PSQT(0, blackBucket, (int)Piece.k, blackKing) - + PSQT(1, whiteBucket, (int)Piece.k, blackKing); + _incrementalEvalAccumulator += PSQT(0, whiteBucket, (int)Piece.K, whiteKing); + _incrementalEvalAccumulator += PSQT(1, blackBucket, (int)Piece.K, whiteKing); + _incrementalEvalAccumulator += PSQT(0, blackBucket, (int)Piece.k, blackKing); + _incrementalEvalAccumulator += PSQT(1, whiteBucket, (int)Piece.k, blackKing); packedScore += _incrementalEvalAccumulator; _isIncrementalEval = true; } - packedScore += - KingAdditionalEvaluation(whiteKing, (int)Side.White, blackPawnAttacks) - - KingAdditionalEvaluation(blackKing, (int)Side.Black, whitePawnAttacks); + packedScore += KingAdditionalEvaluation(whiteKing, (int)Side.White, blackPawnAttacks); + packedScore -= KingAdditionalEvaluation(blackKing, (int)Side.Black, whitePawnAttacks); // Bishop pair bonus if (PieceBitBoards[(int)Piece.B].CountBits() >= 2)