Skip to content

Commit

Permalink
- Tweak return value in futility pruning : official-stockfish/Stockf…
Browse files Browse the repository at this point in the history
…ish@08cdbca

- Skip LMR for 2nd move at the root only : official-stockfish/Stockfish@85403a8
  - Simplify quietMoveMalus malus : official-stockfish/Stockfish@7dc40ac
- Simplify doDeeperSearch : official-stockfish/Stockfish@f17db46
  • Loading branch information
yaneurao committed Dec 2, 2023
1 parent dac37b1 commit 27abace
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/engine/yaneuraou-engine/yaneuraou-search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo

if (is_ok((ss-1)->currentMove) && !(ss-1)->inCheck && !priorCapture)
{
int bonus = std::clamp(-18 * int((ss-1)->staticEval + ss->staticEval), -1812, 1812);
int bonus = std::clamp(-14 * int((ss - 1)->staticEval + ss->staticEval), -1449, 1449);
// この右辺の↑係数、調整すべきだろうけども、4 Eloのところ調整しても…みたいな意味はある。

thisThread->mainHistory(~us, from_to((ss-1)->currentMove)) << bonus;
Expand Down Expand Up @@ -2097,7 +2097,7 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo
// ※ 統計値(mainHistoryとかstatScoreとか)のしきい値に関しては、やねうら王ではStockfishから調整しないことにしているので、
// 上のif式に出てくる定数については調整しないことにする。

return eval;
return (eval + beta) / 2;

// 次のようにするより、単にevalを返したほうが良いらしい。
// return eval - futility_margin(depth);
Expand Down Expand Up @@ -2866,7 +2866,7 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo
// alpha値を更新しそうなら(fail highが起きたら)、full depthで探索しなおす。

if ( depth >= 2
&& moveCount > 1 + (PvNode && ss->ply <= 1)
&& moveCount > 1 + rootNode
&& ( !ss->ttPv
|| !capture
|| (cutNode && (ss - 1)->moveCount > 1)))
Expand Down Expand Up @@ -2896,8 +2896,8 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo
// Adjust full-depth search based on LMR results - if the result
// was good enough search deeper, if it was bad enough search shallower

const bool doDeeperSearch = value > (bestValue + 51 + 10 * (newDepth - d)); // (~1 Elo)
const bool doShallowerSearch = value < bestValue + newDepth; // (~2 Elo)
const bool doDeeperSearch = value > (bestValue + 50 + 2 * newDepth); // (~1 Elo)
const bool doShallowerSearch = value < bestValue + newDepth; // (~2 Elo)

newDepth += doDeeperSearch - doShallowerSearch;

Expand Down Expand Up @@ -3994,7 +3994,7 @@ void update_all_stats(const Position& pos, Stack* ss, Move bestMove, Value bestV
PieceType captured;

int quietMoveBonus = stat_bonus(depth + 1);
int quietMoveMalus = stat_malus(depth + 1);
int quietMoveMalus = stat_malus(depth );

// Stockfish 14ではcapture_or_promotion()からcapture()に変更された。[2022/3/23]
// Stockfish 16では、capture()からcapture_stage()に変更された。[2023/10/15]
Expand Down

0 comments on commit 27abace

Please sign in to comment.