Skip to content

Commit b917cd2

Browse files
joergostermcostalba
authored andcommitted
Dynamic draw value
Try to avoid repetition draws at early midgame, this should give an edge against weaker opponents and reduce draw rate. Tested for regressions with SPRT[-3, 1] and passed both short TC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 68498 W: 12928 L: 12891 D: 42679 And long TC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 40212 W: 6386 L: 6295 D: 27531 bench: 7990513
1 parent 0949f06 commit b917cd2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/search.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ void Search::think() {
206206
}
207207
}
208208

209-
if (Options["Contempt Factor"] && !Options["UCI_AnalyseMode"])
209+
if (!Options["UCI_AnalyseMode"])
210210
{
211-
int cf = Options["Contempt Factor"] * PawnValueMg / 100; // From centipawns
212-
cf = cf * Material::game_phase(RootPos) / PHASE_MIDGAME; // Scale down with phase
211+
// Dynamic draw value: try to avoid repetition draws at early midgame
212+
int cf = std::max(70 - RootPos.game_ply(), 0);
213213
DrawValue[ RootColor] = VALUE_DRAW - Value(cf);
214214
DrawValue[~RootColor] = VALUE_DRAW + Value(cf);
215215
}

0 commit comments

Comments
 (0)