Skip to content

Commit

Permalink
- Thread::nmpColor削除。
Browse files Browse the repository at this point in the history
 - これでnull moveの挙動がちょっと変わる。
  • Loading branch information
yaneurao committed Oct 14, 2023
1 parent eca0558 commit a0085fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions source/engine/yaneuraou-engine/yaneuraou-search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1914,8 +1914,8 @@ namespace {
/* + complexity / 28 */
&& !excludedMove
// && pos.non_pawn_material(us) // これ終盤かどうかを意味する。将棋でもこれに相当する条件が必要かも。
&& (ss->ply >= thisThread->nmpMinPly || us != thisThread->nmpColor)
// 同じ手番側に連続してnull moveを適用しない
&& ss->ply >= thisThread->nmpMinPly
// && beta > VALUE_TB_LOSS_IN_MAX_PLY
)
{
ASSERT_LV3(eval - beta >= 0);
Expand Down Expand Up @@ -1955,11 +1955,11 @@ namespace {
ASSERT_LV3(!thisThread->nmpMinPly); // 再帰的な検証は認めていない。

// Do verification search at high depths, with null move pruning disabled
// for us, until ply exceeds nmpMinPly.
// null move枝刈りを無効化してus側の手番で、plyがnmpMinPlyを超えるまで
// until ply exceeds nmpMinPly.

// null move枝刈りを無効化して、plyがnmpMinPlyを超えるまで
// 高いdepthで検証のための探索を行う。
thisThread->nmpMinPly = ss->ply + 3 * (depth - R) / 4 ;
thisThread->nmpColor = us;

// nullMoveせずに(現在のnodeと同じ手番で)同じ深さで探索しなおして本当にbetaを超えるか検証する。cutNodeにしない。
Value v = search<NonPV>(pos, ss, beta - 1, beta, depth - R, false);
Expand Down
1 change: 0 additions & 1 deletion source/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class Thread
// nmpColor : null moveの前回の適用Color
// state : 探索で組合せ爆発が起きているか等を示す状態
int selDepth, nmpMinPly;
Color nmpColor;

// bestValue :
// search()で、そのnodeでbestMoveを指したときの(探索の)評価値
Expand Down

0 comments on commit a0085fc

Please sign in to comment.