Skip to content

Commit 60db05e

Browse files
authored
3.5.3: remove instant tbmoves at root (#281)
http://chess.grantnet.us/test/32640/ ELO | -1.20 +- 1.31 (95%) SPRT | 10.0+0.10s Threads=1 Hash=8MB LLR | -2.97 (-2.94, 2.94) [-3.00, 1.00] GAMES | N: 138784 W: 35302 L: 35780 D: 67702
1 parent 5319d3c commit 60db05e

File tree

3 files changed

+2
-124
lines changed

3 files changed

+2
-124
lines changed

src/search.cpp

Lines changed: 0 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -798,92 +798,6 @@ bool Search::ProbeHash(TEntry & hentry)
798798
return TTable::instance().retrieve(hash, hentry);
799799
}
800800

801-
#if defined (SYZYGY_SUPPORT)
802-
Move Search::tableBaseRootSearch()
803-
{
804-
if (!TB_LARGEST || countBits(m_position.BitsAll()) > TB_LARGEST)
805-
return 0;
806-
807-
auto result =
808-
tb_probe_root(m_position.BitsAll(WHITE), m_position.BitsAll(BLACK),
809-
m_position.Bits(KW) | m_position.Bits(KB),
810-
m_position.Bits(QW) | m_position.Bits(QB),
811-
m_position.Bits(RW) | m_position.Bits(RB),
812-
m_position.Bits(BW) | m_position.Bits(BB),
813-
m_position.Bits(NW) | m_position.Bits(NB),
814-
m_position.Bits(PW) | m_position.Bits(PB),
815-
m_position.Fifty(),
816-
m_position.CanCastle(m_position.Side(), KINGSIDE) || m_position.CanCastle(m_position.Side(), QUEENSIDE),
817-
0,
818-
m_position.Side() == WHITE, nullptr);
819-
820-
//
821-
// Validate result of a probe, if uncertain, return 0 and fallback to igel's main search at root
822-
//
823-
824-
if (result == TB_RESULT_FAILED || result == TB_RESULT_CHECKMATE || result == TB_RESULT_STALEMATE)
825-
return 0;
826-
827-
//
828-
// Different board representation
829-
//
830-
831-
auto to = abs(int(TB_GET_TO(result)) - 63);
832-
auto from = abs(int(TB_GET_FROM(result)) - 63);
833-
auto promoted = TB_GET_PROMOTES(result);
834-
auto ep = TB_GET_EP(result);
835-
836-
Move tableBaseMove;
837-
838-
assert(!ep);
839-
840-
PIECE piece = m_position[from];
841-
PIECE capture = m_position[to];
842-
843-
if (!promoted && !ep)
844-
tableBaseMove = Move(from, to, piece, capture);
845-
else {
846-
switch (promoted)
847-
{
848-
case TB_PROMOTES_QUEEN:
849-
tableBaseMove = Move(from, to, m_position[from], capture, QW | m_position.Side());
850-
break;
851-
case TB_PROMOTES_ROOK:
852-
tableBaseMove = Move(from, to, m_position[from], capture, RW | m_position.Side());
853-
break;
854-
case TB_PROMOTES_BISHOP:
855-
tableBaseMove = Move(from, to, m_position[from], capture, BW | m_position.Side());
856-
break;
857-
case TB_PROMOTES_KNIGHT:
858-
tableBaseMove = Move(from, to, m_position[from], capture, NW | m_position.Side());
859-
break;
860-
default:
861-
assert(false);
862-
break;
863-
}
864-
}
865-
866-
//
867-
// Sanity check, make sure move generated by tablebase probe is a valid one
868-
//
869-
870-
MoveList moves;
871-
if (m_position.InCheck())
872-
GenMovesInCheck(m_position, moves);
873-
else
874-
GenAllMoves(m_position, moves);
875-
876-
auto mvSize = moves.Size();
877-
for (size_t i = 0; i < mvSize; ++i) {
878-
if (moves[i].m_mv == tableBaseMove)
879-
return tableBaseMove;
880-
}
881-
882-
assert(false);
883-
return 0;
884-
}
885-
#endif
886-
887801
void Search::startWorkerThreads(Time time)
888802
{
889803
for (unsigned int i = 0; i < m_thc; ++i) {
@@ -1006,39 +920,6 @@ uint64_t Search::startSearch(Time time, int depth, bool ponderSearch, bool bench
1006920
std::cout << std::endl;
1007921
};
1008922

1009-
if (m_principalSearcher) {
1010-
1011-
//
1012-
// Check if game is over
1013-
//
1014-
1015-
std::string result, comment;
1016-
int legalMoves = 0;
1017-
Move onlyMove {};
1018-
if (isGameOver(m_position, result, comment, onlyMove, legalMoves)) {
1019-
waitUntilCompletion();
1020-
std::cout << result << " " << comment << std::endl << std::endl;
1021-
printBestMove(this, m_position, onlyMove, m_ponder);
1022-
return 0;
1023-
}
1024-
1025-
#if defined (SYZYGY_SUPPORT)
1026-
//
1027-
// Probe tablebases/tt at root
1028-
//
1029-
1030-
auto bestTb = tableBaseRootSearch();
1031-
1032-
if (bestTb) {
1033-
waitUntilCompletion();
1034-
printBestMove(this, m_position, bestTb, m_ponder);
1035-
return 1;
1036-
}
1037-
#endif
1038-
1039-
m_best = onlyMove; // set best move to first legal move in case we are low on time
1040-
}
1041-
1042923
//
1043924
// Perform search for a best move
1044925
//

src/search.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ class Search
8888
void stopWorkerThreads();
8989
void lazySmpSearcher();
9090
void indicateWorkersStop();
91-
#if defined (SYZYGY_SUPPORT)
92-
Move tableBaseRootSearch();
93-
#endif
9491
EVAL abSearch(EVAL alpha, EVAL beta, int depth, int ply, bool isNull, bool rootNode, bool cutNode, Move skipMove = 0);
9592
EVAL qSearch(EVAL alpha, EVAL beta, int ply, int depth, bool isNull = false);
9693
inline int extensionRequired(bool inCheck, bool onPV, int cmhistory, int fmhistory);

src/uci.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <iostream>
3232
#include <sstream>
3333

34-
const std::string VERSION = "3.5.2";
34+
const std::string VERSION = "3.5.3";
3535
const std::string ARCHITECTURE = " 64 "
3636

3737
#if _BTYPE==0
@@ -129,7 +129,7 @@ int Uci::handleCommands()
129129
void Uci::onUci()
130130
{
131131
std::cout << "id name Igel " << VERSION << ARCHITECTURE << std::endl;
132-
std::cout << "id author V. Medvedev, V. Shcherbyna" << std::endl;
132+
std::cout << "id author V. Shcherbyna (Igel author 2018-2023), V. Medvedev (GreKo author 2002-2018)" << std::endl;
133133

134134
std::cout << "option name Hash type spin" <<
135135
" default " << DEFAULT_HASH_SIZE <<

0 commit comments

Comments
 (0)