1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Simplify condition in space definition

We remove an unnecessary condition in the definition of safe squares
in the space evaluation. Only the squares which are occupied by our
pawns or attacked by our opponent's pawns are now excluded.

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 21096 W: 4321 L: 4199 D: 12576
http://tests.stockfishchess.org/tests/view/5acbf7510ebc59547e537d4e

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 23437 W: 3577 L: 3460 D: 16400
http://tests.stockfishchess.org/tests/view/5acc0f750ebc59547e537d6a

It may be possible to further refine the definition of such safe squares.

Bench: 5351765
This commit is contained in:
Jerry Donald Watson 2018-04-10 00:28:26 +01:00 committed by Stéphane Nicolet
parent b88374b14a
commit 62619fa228

View file

@ -738,8 +738,7 @@ namespace {
// pawn, or if it is undefended and attacked by an enemy piece. // pawn, or if it is undefended and attacked by an enemy piece.
Bitboard safe = SpaceMask Bitboard safe = SpaceMask
& ~pos.pieces(Us, PAWN) & ~pos.pieces(Us, PAWN)
& ~attackedBy[Them][PAWN] & ~attackedBy[Them][PAWN];
& (attackedBy[Us][ALL_PIECES] | ~attackedBy[Them][ALL_PIECES]);
// Find all squares which are at most three squares behind some friendly pawn // Find all squares which are at most three squares behind some friendly pawn
Bitboard behind = pos.pieces(Us, PAWN); Bitboard behind = pos.pieces(Us, PAWN);