Skip to content

Commit 5413fda

Browse files
committed
Revert dynamic contempt
On a final fixed game number test it failed to prove better than standard version. STC 15+0.05 ELO: -0.86 +-1.7 (95%) LOS: 15.8% Total: 57578 W: 10070 L: 10213 D: 37295 bench: 8802105
1 parent 145d293 commit 5413fda

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/search.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ namespace Search {
4545
Color RootColor;
4646
Time::point SearchTime;
4747
StateStackPtr SetupStates;
48-
Value Contempt[2]; // [bestValue > VALUE_DRAW]
4948
}
5049

5150
using std::string;
@@ -186,9 +185,9 @@ void Search::think() {
186185
RootColor = RootPos.side_to_move();
187186
TimeMgr.init(Limits, RootPos.game_ply(), RootColor);
188187

189-
DrawValue[0] = DrawValue[1] = VALUE_DRAW;
190-
Contempt[0] = Options["Contempt Factor"] * PawnValueEg / 100; // From centipawns
191-
Contempt[1] = (Options["Contempt Factor"] + 12) * PawnValueEg / 100;
188+
int cf = Options["Contempt Factor"] * PawnValueEg / 100; // From centipawns
189+
DrawValue[ RootColor] = VALUE_DRAW - Value(cf);
190+
DrawValue[~RootColor] = VALUE_DRAW + Value(cf);
192191

193192
if (RootMoves.empty())
194193
{
@@ -340,9 +339,6 @@ namespace {
340339
{
341340
bestValue = search<Root>(pos, ss, alpha, beta, depth * ONE_PLY, false);
342341

343-
DrawValue[ RootColor] = VALUE_DRAW - Contempt[bestValue > VALUE_DRAW];
344-
DrawValue[~RootColor] = VALUE_DRAW + Contempt[bestValue > VALUE_DRAW];
345-
346342
// Bring the best move to the front. It is critical that sorting
347343
// is done with a stable algorithm because all the values but the
348344
// first and eventually the new best one are set to -VALUE_INFINITE

0 commit comments

Comments
 (0)