1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Rise contempt when in advantage

This is a very discussed patch with many
argumentations pro and against. The fact is
it passed both STC:

LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 16305 W: 3001 L: 2855 D: 10449

And LTC
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 34273 W: 5180 L: 4931 D: 24162

Although it is true that a correct test should
include foreign engines, we commit it anyhow so
people can test it out in the wild, under broader
conditions.

bench: 7384368
This commit is contained in:
Leonid Pechenik 2014-04-17 12:49:57 -04:00 committed by Marco Costalba
parent 223ebe7b40
commit ef43e6b05d

View file

@ -45,6 +45,7 @@ namespace Search {
Color RootColor; Color RootColor;
Time::point SearchTime; Time::point SearchTime;
StateStackPtr SetupStates; StateStackPtr SetupStates;
Value Contempt[2]; // [bestValue > VALUE_DRAW]
} }
using std::string; using std::string;
@ -185,9 +186,8 @@ void Search::think() {
RootColor = RootPos.side_to_move(); RootColor = RootPos.side_to_move();
TimeMgr.init(Limits, RootPos.game_ply(), RootColor); TimeMgr.init(Limits, RootPos.game_ply(), RootColor);
int cf = Options["Contempt Factor"] * PawnValueEg / 100; // From centipawns Contempt[0] = Options["Contempt Factor"] * PawnValueEg / 100; // From centipawns
DrawValue[ RootColor] = VALUE_DRAW - Value(cf); Contempt[1] = (Options["Contempt Factor"] + 12) * PawnValueEg / 100;
DrawValue[~RootColor] = VALUE_DRAW + Value(cf);
if (RootMoves.empty()) if (RootMoves.empty())
{ {
@ -339,6 +339,9 @@ namespace {
{ {
bestValue = search<Root>(pos, ss, alpha, beta, depth * ONE_PLY, false); bestValue = search<Root>(pos, ss, alpha, beta, depth * ONE_PLY, false);
DrawValue[ RootColor] = VALUE_DRAW - Contempt[bestValue > VALUE_DRAW];
DrawValue[~RootColor] = VALUE_DRAW + Contempt[bestValue > VALUE_DRAW];
// Bring the best move to the front. It is critical that sorting // Bring the best move to the front. It is critical that sorting
// is done with a stable algorithm because all the values but the // is done with a stable algorithm because all the values but the
// first and eventually the new best one are set to -VALUE_INFINITE // first and eventually the new best one are set to -VALUE_INFINITE