Equations for edges and corners.

This is a functional simplification that removes the large arrays in endgames.cpp.
It also fixes a recently introduced bug (960d59d541) in KNBvK,
now using flip_file() instead of ~.

One fen added to bench to increase endgame coverage.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 174724 W: 33325 L: 33404 D: 107995
Ptnml(0-2): 2503, 19607, 43181, 19608, 2463
http://tests.stockfishchess.org/tests/view/5e6448ffe42a5c3b3ca2e287

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 35640 W: 4679 L: 4621 D: 26340
Ptnml(0-2): 189, 2991, 11424, 3005, 211
http://tests.stockfishchess.org/tests/view/5e650b24e42a5c3b3ca2e2d8

closes https://github.com/official-stockfish/Stockfish/pull/2577

Bench: 5527957
This commit is contained in:
protonspring
2020-03-09 22:11:08 +01:00
committed by Joost VandeVondele
parent 37e3863927
commit 47be966d30
8 changed files with 24 additions and 38 deletions

View File

@@ -255,6 +255,8 @@ template<> inline int distance<File>(Square x, Square y) { return std::abs(file_
template<> inline int distance<Rank>(Square x, Square y) { return std::abs(rank_of(x) - rank_of(y)); }
template<> inline int distance<Square>(Square x, Square y) { return SquareDistance[x][y]; }
inline File edge_distance(File f) { return std::min(f, File(FILE_H - f)); }
inline Rank edge_distance(Rank r) { return std::min(r, Rank(RANK_8 - r)); }
/// attacks_bb() returns a bitboard representing all the squares attacked by a
/// piece of type Pt (bishop or rook) placed on 's'.