PK wrote:Another classic way to break transposition table is to save moves and scores when search is already timed-out.
If the error disappears when you run your engine in fixed depth mode, then this is the reason.
In the begining of the search I check for timout:
Code: Select all
int search(...) {
if (!inCheck && depth <= 0) {
return qsearch(alpha, beta, board, params, pv);
}
CheckInputAndTime(params);
if (params->stop)
return 0;
...
And after getting score
Code: Select all
score = -search(-beta, -alpha, depth - 1, board, params, givesCheck, new_pv);
UnmakeMove(board);
if (params->stop)
return 0;
I don't think that is the problem, because when analysing, makes blunder moves, with the HGM position it's taking too much time
I have modified the PST for pawns and kings and added material draw to see if that could be the problem but keeps blundering....
Code: Select all
FEN: 4k3/8/8/8/8/8/4P3/4K3 w - - 0 1
Skiull 0.2 x64 popcnt:
1 00:00 7 7 +1,19 Ke1-d2
2 00:00 24 24 +0,99 Ke1-d2 Ke8-d7
3 00:00 100 100 +1,29 Ke1-d2 Ke8-d7 Kd2-d3
4 00:00 248 248 +0,99 Ke1-d2 Ke8-d7 Kd2-d3 Kd7-d6
5 00:00 672 672 +1,09 Ke1-d2 Ke8-d7 Kd2-d3 Kd7-d6 e2-e4
6 00:00 1.442 1.442 +1,09 Ke1-d2 Ke8-d7 Kd2-d3 Kd7-d6 Kd3-d4 Kd6-e6
7 00:00 3.140 3.140 +1,19 Ke1-d2 Ke8-d7 Kd2-d3 Kd7-d6 Kd3-d4 Kd6-e6 e2-e4
8 00:00 7.707 7.707 +1,19 Ke1-d2 Ke8-d7 Kd2-d3 Kd7-d6 Kd3-d4 Kd6-e6 e2-e4 Ke6-d6
9 00:00 19.487 1.217.938 +1,19 Ke1-d2 Ke8-d7 e2-e4 Kd7-d6 Kd2-c3 Kd6-c5 Kc3-d3
10 00:00 47.810 2.988.125 +1,19 Ke1-d2 Ke8-e7 e2-e4 Ke7-d6 Kd2-e2 Kd6-c5 Ke2-d3 Kc5-c6 Kd3-d4
11 00:00 91.815 5.738.438 +1,27 Ke1-d2 Ke8-d7 e2-e4 Kd7-c6 Kd2-e3 Kc6-d6 Ke3-d4 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1,47 Ke1-d2 Ke8-d7 Kd2-d3 Kd7-d6 Kd3-d4 Kd6-c6 e2-e4 Kc6-d6 e4-e5+ Kd6-e6 Kd4-d3 Ke6-d5 Kd3-e3 Kd5-e6 Ke3-e4 Ke6-f7 Ke4-e3 Kf7-g6 Ke3-f4 Kg6-h5
21 10:12 6.482.104.051 10.589.372 +1,69 Ke1-d2 Ke8-e7 Kd2-e3 Ke7-d6 Ke3-d4 Kd6-e6 e2-e4 Ke6-d6 e4-e5+ Kd6-c6 Kd4-c4 Kc6-b6 Kc4-d5 Kb6-b7 Kd5-c5 Kb7-c7 Kc5-d5 Kc7-d7 e5-e6+ Kd7-e7 Kd5-e5
22 21:45 13.251.181.920 10.147.522 +1,79 Ke1-d2 Ke8-d7 Kd2-c3 Kd7-d6 Kc3-d4 Kd6-e6 e2-e4 Ke6-d6 e4-e5+ Kd6-c6 Kd4-e4 Kc6-c5 e5-e6 Kc5-d6 Ke4-f5 Kd6-e7 Kf5-e5 Ke7-f8 Ke5-e4 Kf8-e8 Ke4-f5 Ke8-d8
This is the new PST for pawns:
BLACK = 0
WHITE = 0
Code: Select all
const int16_t PawnTable[2][64] = {
{
0, 0, 0, 0, 0, 0, 0, 0,
7, 11, 23, 39, 39, 23, 11, 7,
-5, 1, 14, 29, 29, 14, 1, -5,
-14, -8, 6, 17, 17, 6, -8, -14,
-21, -16, -1, 9, 9, -1, -16, -21,
-21, -16, -6, 4, 4, -6, -16, -21,
-21, -16, -6, -1, -1, -6, -16, -21,
0, 0, 0, 0, 0, 0, 0, 0
},
{
0, 0, 0, 0, 0, 0, 0, 0,
-21, -16, -6, -1, -1, -6, -16, -21,
-21, -16, -6, 4, 4, -6, -16, -21,
-21, -16, -1, 9, 9, -1, -16, -21,
-14, -8, 6, 17, 17, 6, -8, -14,
-5, 1, 14, 29, 29, 14, 1, -5,
7, 11, 23, 39, 39, 23, 11, 7,
0, 0, 0, 0, 0, 0, 0, 0
}
};
Kings:
Code: Select all
const int16_t KingEG[2][64] = {
{
-10, 10, 15, 20, 20, 15, 10, -10,
0, 20, 35, 45, 45, 35, 20, 0,
10, 25, 40, 50, 50, 40, 25, 10,
10, 25, 40, 50, 50, 40, 25, 10,
10, 25, 40, 50, 50, 40, 25, 10,
0, 15, 30, 40, 40, 30, 15, 0,
-15, -10, 0, 10, 10, 0, -10, -15,
-30, -25, -15, -10, -10, -15, -25, -30,
},
{
-30, -25, -15, -10, -10, -15, -25, -30,
-15, -10, 0, 10, 10, 0, -10, -15,
0, 15, 30, 40, 40, 30, 15, 0,
10, 25, 40, 50, 50, 40, 25, 10,
10, 25, 40, 50, 50, 40, 25, 10,
10, 25, 40, 50, 50, 40, 25, 10,
0, 20, 35, 45, 45, 35, 20, 0,
-10, 10, 15, 20, 20, 15, 10, -10
}
};
const int16_t KingMG[2][64] = {
{
-70, -70, -70, -70, -70, -70, -70, -70,
-70, -70, -70, -70, -70, -70, -70, -70,
-70, -70, -70, -70, -70, -70, -70, -70,
-70, -70, -70, -70, -70, -70, -70, -70,
-70, -70, -70, -70, -70, -70, -70, -70,
-50, -50, -50, -50, -50, -50, -50, -50,
-30, -30, -30, -30, -30, -30, -30, -30,
0, 5, 5, -10, -10, 0, 10, 5,
},
{
0, 5, 5, -10, -10, 0, 10, 5,
-30, -30, -30, -30, -30, -30, -30, -30,
-50, -50, -50, -50, -50, -50, -50, -50,
-70, -70, -70, -70, -70, -70, -70, -70,
-70, -70, -70, -70, -70, -70, -70, -70,
-70, -70, -70, -70, -70, -70, -70, -70,
-70, -70, -70, -70, -70, -70, -70, -70,
-70, -70, -70, -70, -70, -70, -70, -70
}
};
To know if it's endgame I have this (same as Vice)
Code: Select all
#define ENDGAME_MAT (1 * PieceValue(WHITE_ROOK) + 2 * PieceValue(WHITE_KNIGHT) + 2 * PieceValue(WHITE_PAWN) + PieceValue(WHITE_KING))
I'm starting to think that the problem could be the eval function, it's too basic