From 612334747632a3ff404cb66e8a7bb7d6159577cf Mon Sep 17 00:00:00 2001 From: ianfab Date: Sat, 28 Jul 2018 17:22:39 +0200 Subject: [PATCH] Tweak SEE for nCheck and extinction variants 3check STC LLR: 2.96 (-2.94,2.94) [0.00,10.00] Total: 131 W: 115 L: 14 D: 2 extinction STC LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 92 W: 90 L: 1 D: 1 --- src/position.cpp | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 098a681..e4044d6 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1306,6 +1306,20 @@ bool Position::see_ge(Move m, Value threshold) const { Color stm = ~us; // First consider opponent's move Value balance; // Values of the pieces taken by us minus opponent's ones + + // nCheck + if (max_check_count() && color_of(moved_piece(m)) == sideToMove && gives_check(m)) + return true; + + // Extinction + if ( extinction_value() != VALUE_NONE + && piece_on(to) + && ( ( extinction_piece_types().find(type_of(piece_on(to))) != extinction_piece_types().end() + && pieceCount[piece_on(to)] == 1) + || ( extinction_piece_types().find(ALL_PIECES) != extinction_piece_types().end() + && count(~sideToMove) == 1))) + return extinction_value() < VALUE_ZERO; + // The opponent may be able to recapture so this is the best result // we can hope for. balance = PieceValue[MG][piece_on(to)] - threshold; -- 1.7.0.4