Skip to content

Commit 9b44a1a

Browse files
authored
3.6.1: penalize bad captures (#310)
Elo | 8.30 +- 4.00 (95%) SPRT | 10.0+0.10s Threads=1 Hash=8MB LLR | 2.95 (-2.94, 2.94) [0.00, 3.00] Games | N: 8706 W: 2347 L: 2139 D: 4220 Penta | [61, 945, 2150, 1119, 78] http://chess.grantnet.us/test/39221/ Elo | 2.89 +- 2.04 (95%) SPRT | 60.0+0.60s Threads=1 Hash=64MB LLR | 2.96 (-2.94, 2.94) [0.00, 3.00] Games | N: 27406 W: 6907 L: 6679 D: 13820 Penta | [50, 3036, 7308, 3254, 55] http://chess.grantnet.us/test/39222/ bench: 1169306
1 parent 2be6b08 commit 9b44a1a

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/moveeval.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ const EVAL SORT_VALUE[14] = { 0, 0, VAL_P, VAL_P, VAL_N, VAL_N, VAL_B, VAL_B, VA
7474
EVAL s_promotion = SORT_VALUE[mv.Promotion()];
7575

7676
mvlist[j].m_score = s_SortCapture + 10 * (s_captured + s_promotion) - s_piece;
77+
78+
if (mv.Captured() && !mv.Promotion()) { // add SEE score for captures if it's negative (losing captures)
79+
auto see = MoveEval::SEE(pSearch, mv);
80+
if (see < 0)
81+
mvlist[j].m_score = s_SortBadCapture + see; // penalize bad captures, but still keep them above non-captures
82+
}
7783
}
7884
else if (mv == pSearch->m_killerMoves[ply][0] || mv == pSearch->m_killerMoves[ply][1])
7985
mvlist[j].m_score = s_SortKiller;

src/moveeval.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ class MoveEval
3838
static EVAL SEE(Search * pSearch, const Move & mv);
3939

4040
private:
41-
static constexpr int s_SortHash = 7000000;
42-
static constexpr int s_SortCapture = 6000000;
43-
static constexpr int s_SortKiller = 5000000;
41+
static constexpr int s_SortHash = 7000000;
42+
static constexpr int s_SortCapture = 6000000;
43+
static constexpr int s_SortKiller = 5000000;
44+
static constexpr int s_SortBadCapture = 1000000;
4445
};
4546

4647
#endif // MOVEVAL_H

src/uci.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <iostream>
3232
#include <sstream>
3333

34-
const std::string VERSION = "3.6.0";
34+
const std::string VERSION = "3.6.1";
3535
const std::string ARCHITECTURE = " 64 "
3636

3737
#if _BTYPE==0

0 commit comments

Comments
 (0)