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

@@ -21,6 +21,7 @@
#include <algorithm>
#include "types.h"
#include "bitboard.h"
namespace PSQT {
@@ -111,7 +112,7 @@ void init() {
for (Square s = SQ_A1; s <= SQ_H8; ++s)
{
File f = map_to_queenside(file_of(s));
File f = edge_distance(file_of(s));
psq[ pc][ s] = score + (type_of(pc) == PAWN ? PBonus[rank_of(s)][file_of(s)]
: Bonus[pc][rank_of(s)][f]);
psq[~pc][flip_rank(s)] = -psq[pc][s];