From ec9f51fc41a52ff358149f8efdbc451960e5132f Mon Sep 17 00:00:00 2001 From: yaneurao Date: Wed, 27 Nov 2024 21:26:35 +0900 Subject: [PATCH] =?UTF-8?q?-=20improving=20=E3=81=AE=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=80=81=E8=BF=BD=E5=8A=A0=E3=80=82=20-=20singular=E3=81=AE?= =?UTF-8?q?=E4=BF=82=E6=95=B0=E8=AA=BF=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/engine/yaneuraou-engine/yaneuraou-param.h | 8 ++++---- source/engine/yaneuraou-engine/yaneuraou-search.cpp | 13 ++++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/source/engine/yaneuraou-engine/yaneuraou-param.h b/source/engine/yaneuraou-engine/yaneuraou-param.h index 46d56550c..0638fe6ca 100644 --- a/source/engine/yaneuraou-engine/yaneuraou-param.h +++ b/source/engine/yaneuraou-engine/yaneuraou-param.h @@ -195,16 +195,16 @@ PARAM_DEFINE PARAM_SINGULAR_EXTENSION_DEPTH = 4; // singular extensionのsingular betaを計算するときのマージン // 重要度 ★★★★☆ -// 元の値 = Stockfish 16 : 64 , Stockfish 17 : 54 , step = 8 +// 元の値 = Stockfish 16 : 64 , Stockfish 17 : 54,56 , step = 8 // [PARAM] min:16,max:1024,step:4,interval:1,time_rate:1,fixed -PARAM_DEFINE PARAM_SINGULAR_MARGIN1 = 54; +PARAM_DEFINE PARAM_SINGULAR_MARGIN1 = 56; // singular extensionのsingular betaを計算するときの係数 // 重要度 ★★★★☆ // 自己対局だとすごく強くなって見えるかもしれないが、まやかしである。 -// 元の値 = Stockfish 16 : 57 , Stockfish 17 : 77 , step = 8 +// 元の値 = Stockfish 16 : 57 , Stockfish 17 : 77,79 , step = 8 // [PARAM] min:0,max:1024,step:8,interval:2,time_rate:1,fixed -PARAM_DEFINE PARAM_SINGULAR_MARGIN2 = 77; +PARAM_DEFINE PARAM_SINGULAR_MARGIN2 = 79; // // LMR diff --git a/source/engine/yaneuraou-engine/yaneuraou-search.cpp b/source/engine/yaneuraou-engine/yaneuraou-search.cpp index 45514bb0f..87d03b9e0 100644 --- a/source/engine/yaneuraou-engine/yaneuraou-search.cpp +++ b/source/engine/yaneuraou-engine/yaneuraou-search.cpp @@ -2237,6 +2237,9 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo return beta + (eval - beta) / 3; + // ここでimproving計算しなおす。 + improving |= ss->staticEval >= beta + 100; + // ----------------------- // Step 9. Null move search with verification search (~35 Elo) // Step 9. 検証探索を伴うnull move探索(約35 Elo) @@ -2751,7 +2754,7 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo if (!rootNode && move == ttData.move && !excludedMove // 再帰的なsingular延長を除外する。 - && depth >= PARAM_SINGULAR_EXTENSION_DEPTH/*4*/ - (thisThread->completedDepth > 36) + ss->ttPv + && depth >= PARAM_SINGULAR_EXTENSION_DEPTH/*4*/ - (thisThread->completedDepth > 33) + ss->ttPv /* && ttValue != VALUE_NONE Already implicit in the next condition */ && std::abs(ttData.value) < VALUE_TB_WIN_IN_MAX_PLY // 詰み絡みのスコアはsingular extensionはしない。(Stockfish 10~) && (ttData.bound & BOUND_LOWER) @@ -2762,8 +2765,8 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo { // このmargin値は評価関数の性質に合わせて調整されるべき。 Value singularBeta = ttData.value - - (PARAM_SINGULAR_MARGIN1/*54*/ - + PARAM_SINGULAR_MARGIN2/*77*/ * (ss->ttPv && !PvNode)) * depth / 64; + - (PARAM_SINGULAR_MARGIN1 + + PARAM_SINGULAR_MARGIN2 * (ss->ttPv && !PvNode)) * depth / 64; Depth singularDepth = newDepth / 2; // move(ttMove)の指し手を以下のsearch()での探索から除外 @@ -2778,8 +2781,8 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo // (延長され続けるとまずいので何らかの考慮は必要) if (value < singularBeta) { - int doubleMargin = 262 * PvNode - 204 * !ttCapture; - int tripleMargin = 97 + 266 * PvNode - 255 * !ttCapture + 94 * ss->ttPv; + int doubleMargin = 249 * PvNode - 194 * !ttCapture; + int tripleMargin = 94 + 287 * PvNode - 249 * !ttCapture + 99 * ss->ttPv; // We make sure to limit the extensions in some way to avoid a search explosion // 2重延長を制限することで探索の組合せ爆発を回避する。