Skip to content

Commit

Permalink
4 more patches bench 4970737
Browse files Browse the repository at this point in the history
Simplify capture bonus bench 5128885
official-stockfish/Stockfish@231103d

Quiet move soft fail high bonus bench 5021172
official-stockfish/Stockfish@528507b

Optimze contempt value (21) bench 4886199
official-stockfish/Stockfish@86e4675

Simplify capture pruning margin formula bench 4970737
official-stockfish/Stockfish@88de112
  • Loading branch information
CounterPly committed Sep 29, 2018
1 parent b086d07 commit 2172d88
Show file tree
Hide file tree
Showing 5 changed files with 288 additions and 337 deletions.
17 changes: 4 additions & 13 deletions benchMatch/src/search.cpp
Expand Up @@ -71,16 +71,6 @@ namespace {
return Value((175 - 50 * improving) * d / ONE_PLY);
}

// Margin for pruning capturing moves: almost linear in depth
constexpr int CapturePruneMargin[] = { 0,
1 * PawnValueEg * 1055 / 1000,
2 * PawnValueEg * 1042 / 1000,
3 * PawnValueEg * 963 / 1000,
4 * PawnValueEg * 1038 / 1000,
5 * PawnValueEg * 950 / 1000,
6 * PawnValueEg * 930 / 1000
};

// Futility and reductions lookup tables, initialized at startup
int FutilityMoveCounts[2][16]; // [improving][depth]
int Reductions[2][2][64][64]; // [pv][improving][depth][moveNumber]
Expand Down Expand Up @@ -950,7 +940,7 @@ namespace {
}
else if ( depth < 7 * ONE_PLY // (~20 Elo)
&& !extension
&& !pos.see_ge(move, -Value(CapturePruneMargin[depth / ONE_PLY])))
&& !pos.see_ge(move, -Value(PawnValueEg * (depth / ONE_PLY))))
continue;
}

Expand Down Expand Up @@ -1155,10 +1145,11 @@ namespace {
{
// Quiet best move: update move sorting heuristics
if (!pos.capture_or_promotion(bestMove))
update_quiet_stats(pos, ss, bestMove, quietsSearched, quietCount, stat_bonus(depth));
update_quiet_stats(pos, ss, bestMove, quietsSearched, quietCount,
stat_bonus(depth + (bestValue > beta + PawnValueMg ? ONE_PLY : DEPTH_ZERO)));
else
update_capture_stats(pos, bestMove, capturesSearched, captureCount,
stat_bonus(depth + (bestValue > beta + KnightValueMg ? ONE_PLY : DEPTH_ZERO)));
stat_bonus(depth + ONE_PLY));

// Extra penalty for a quiet TT move in previous ply when it gets refuted
if ((ss-1)->moveCount == 1 && !pos.captured_piece())
Expand Down
2 changes: 1 addition & 1 deletion benchMatch/src/ucioption.cpp
Expand Up @@ -59,7 +59,7 @@ void init(OptionsMap& o) {
constexpr int MaxHashMB = Is64Bit ? 131072 : 2048;

o["Debug Log File"] << Option("", on_logger);
o["Contempt"] << Option(12, -100, 100);
o["Contempt"] << Option(21, -100, 100);
o["Analysis Contempt"] << Option("Both var Off var White var Black var Both", "Both");
o["Threads"] << Option(1, 1, 512, on_threads);
o["Hash"] << Option(16, 1, MaxHashMB, on_hash_size);
Expand Down
Binary file modified benchMatch/stockfish_benchMatch_x64_gcc-8.1.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion x86/Def.asm
Expand Up @@ -20,7 +20,7 @@ CURRMOVE_MIN_TIME = 3000

; options options
OPTIONS_CONTEMPT_MIN = -100
OPTIONS_CONTEMPT_DEFAULT = 12
OPTIONS_CONTEMPT_DEFAULT = 21
OPTIONS_CONTEMPT_MAX = 100
OPTIONS_SLOWMOVER_DEFAULT = 84

Expand Down

0 comments on commit 2172d88

Please sign in to comment.