Skip to content

Commit

Permalink
Fix en passant hash and bench debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio committed Jan 2, 2024
1 parent 993fdc7 commit 5bad766
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static long AndTrick(int enPassantSquare)
return default;
}

var file = enPassantSquare & 0x03;
var file = enPassantSquare & 0x07;

return _table[file, (int)Piece.P];
}
Expand Down
3 changes: 3 additions & 0 deletions src/Lynx.Benchmark/MakeUnmakeMove_implementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,9 @@ public static long PositionHash(MakeMovePosition position)

public static class MakeMoveMoveGenerator
{
#if DEBUG
private static readonly NLog.Logger _logger = NLog.LogManager.GetCurrentClassLogger();
#endif
private const int TRUE = 1;

/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions src/Lynx.Benchmark/MakeUnmakeMove_integration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,10 @@ public static long PositionHash(MakeMovePosition position)

public static class MakeMoveMoveGenerator
{
#if DEBUG
private static readonly NLog.Logger _logger = NLog.LogManager.GetCurrentClassLogger();
#endif

private const int TRUE = 1;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Lynx/ZobristTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static long EnPassantHash(int enPassantSquare)
}
#endif

var file = enPassantSquare & 0x03; // enPassantSquare % 8
var file = enPassantSquare & 0x07; // enPassantSquare % 8

return _table[file, (int)Piece.P];
}
Expand Down

0 comments on commit 5bad766

Please sign in to comment.