diff --git a/src/evaluate.c b/src/evaluate.c index af1d34f4..38816328 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -136,11 +136,48 @@ const int Mobility[4][28] = { S(122,221), S(135,193), S(146,166), S(125,162) } }; -// KingSafety [pt-2] -const int AttackPower[4] = { 35, 20, 40, 80 }; -const int CheckPower[4] = { 100, 35, 65, 65 }; -const int CountModifier[8] = { 0, 0, 64, 96, 113, 120, 124, 128 }; +extern int NPower; +extern int BPower; +extern int RPower; +extern int QPower; +extern int NCPower; +extern int BCPower; +extern int RCPower; +extern int QCPower; +extern int Modifier1; +extern int Modifier2; +extern int Modifier3; +extern int Modifier4; +extern int Modifier5; +extern int Modifier6; +extern int Modifier7; +extern int Modifier8; +// KingSafety [pt-2] +int AttackPower[4] = { 0 }; +int CheckPower[4] = { 0 }; +int CountModifier[8] = { 0 }; + +void InitSafety() { + AttackPower[KNIGHT-2] = NPower; + AttackPower[BISHOP-2] = BPower; + AttackPower[ROOK -2] = RPower; + AttackPower[QUEEN -2] = QPower; + + CheckPower[KNIGHT-2] = NCPower; + CheckPower[BISHOP-2] = BCPower; + CheckPower[ROOK -2] = RCPower; + CheckPower[QUEEN -2] = QCPower; + + CountModifier[0] = Modifier1; + CountModifier[1] = Modifier2; + CountModifier[2] = Modifier3; + CountModifier[3] = Modifier4; + CountModifier[4] = Modifier5; + CountModifier[5] = Modifier6; + CountModifier[6] = Modifier7; + CountModifier[7] = Modifier8; +} // Evaluates pawns INLINE int EvalPawns(const Position *pos, EvalInfo *ei, const Color color) { diff --git a/src/evaluate.h b/src/evaluate.h index eb652771..ded2735d 100644 --- a/src/evaluate.h +++ b/src/evaluate.h @@ -54,3 +54,4 @@ static inline int UpdatePhase(int value) { // Returns a static evaluation of the position int EvalPosition(const Position *pos, PawnCache pc); +void InitSafety(); diff --git a/src/history.h b/src/history.h index a16338b3..7d3cf494 100644 --- a/src/history.h +++ b/src/history.h @@ -30,9 +30,17 @@ #define NoisyEntry(move) (&thread->captureHistory[piece(move)][toSq(move)][PieceTypeOf(capturing(move))]) #define ContEntry(offset, move) (&(*(ss-offset)->continuation)[piece(move)][toSq(move)]) -#define QuietHistoryUpdate(move, bonus) (HistoryBonus(QuietEntry(move), bonus, 8192)) -#define NoisyHistoryUpdate(move, bonus) (HistoryBonus(NoisyEntry(move), bonus, 16384)) -#define ContHistoryUpdate(offset, move, bonus) (HistoryBonus(ContEntry(offset, move), bonus, 16384)) +#define QuietHistoryUpdate(move, bonus) (HistoryBonus(QuietEntry(move), bonus, HistQDiv)) +#define NoisyHistoryUpdate(move, bonus) (HistoryBonus(NoisyEntry(move), bonus, HistNDiv)) +#define ContHistoryUpdate(offset, move, bonus) (HistoryBonus(ContEntry(offset, move), bonus, HistCDiv)) + + +extern int HistQDiv; +extern int HistCDiv; +extern int HistNDiv; +extern int HistBonusMax; +extern int HistBonusBase; +extern int HistBonusDepth; INLINE void HistoryBonus(int16_t *cur, int bonus, int div) { @@ -40,7 +48,7 @@ INLINE void HistoryBonus(int16_t *cur, int bonus, int div) { } INLINE int Bonus(Depth depth) { - return MIN(2100, 350 * depth - 350); + return MIN(HistBonusMax, HistBonusDepth * depth - HistBonusBase); } INLINE void UpdateContHistories(Stack *ss, Move move, int bonus) { diff --git a/src/search.c b/src/search.c index 5a794e8e..87fad0b7 100644 --- a/src/search.c +++ b/src/search.c @@ -43,12 +43,77 @@ volatile bool SEARCH_STOPPED = true; static int Reductions[2][32][32]; +float LMRNoisyBase = 0.0; +float LMRNoisyDiv = 3.25; +float LMRQuietBase = 1.50; +float LMRQuietDiv = 1.75; + +int IIRDepth = 4; +int IIRCutDepth = 7; +int RFPDepth = 7; +int RFPBase = 100; +int RFPHistScore = 400; +int RFPHistory = 10000; +int NMPFlat = 120; +int NMPDepth = 15; +int NMPHist = 35000; +int NMPRBase = 3; +int NMPRDepth = 5; +int NMPREvalDiv = 256; +int NMPREvalMin = 3; +int ProbCut = 200; +int ProbCutDepth = 5; +int ProbCutReturn = 100; +int HistPruneDepth = 3; +int HistPrune = 1024; +int SEEPruneDepth = 7; +int SEEPruneQ = 50; +int SEEPruneN = 90; +int LMRHist = 8192; +int DeeperBase = 70; +int DeeperDepth = 12; + +int QSFutility = 60; + +int Aspi = 12; +int Trend = 35; + +int HistQDiv = 8192; +int HistCDiv = 16384; +int HistNDiv = 16384; +int HistBonusMax = 2100; +int HistBonusBase = 350; +int HistBonusDepth = 350; + +int NPower = 35; +int BPower = 20; +int RPower = 40; +int QPower = 80; +int NCPower = 100; +int BCPower = 35; +int RCPower = 65; +int QCPower = 65; +int Modifier1 = 0; +int Modifier2 = 0; +int Modifier3 = 64; +int Modifier4 = 96; +int Modifier5 = 113; +int Modifier6 = 120; +int Modifier7 = 124; +int Modifier8 = 128; + + // Initializes the late move reduction array CONSTR(1) InitReductions() { for (int depth = 1; depth < 32; ++depth) for (int moves = 1; moves < 32; ++moves) - Reductions[0][depth][moves] = 0.00 + log(depth) * log(moves) / 3.25, // capture - Reductions[1][depth][moves] = 1.50 + log(depth) * log(moves) / 1.75; // quiet + Reductions[0][depth][moves] = LMRNoisyBase + log(depth) * log(moves) / LMRNoisyDiv, // capture + Reductions[1][depth][moves] = LMRQuietBase + log(depth) * log(moves) / LMRQuietDiv; // quiet +} + +void Reinit() { + InitReductions(); + InitSafety(); } // Checks if the move is in the list of searchmoves if any were given @@ -125,7 +190,7 @@ static int Quiescence(Thread *thread, Stack *ss, int alpha, const int beta) { if (eval > alpha) alpha = eval; - futility = eval + 60; + futility = eval + QSFutility; bestScore = eval; moveloop: @@ -304,10 +369,10 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth bool improving = !inCheck && eval > (ss-2)->eval; // Internal iterative reduction based on Rebel's idea - if (pvNode && depth >= 4 && !ttMove) + if (pvNode && depth >= IIRDepth && !ttMove) depth--; - if (cutnode && depth >= 7 && !ttMove) + if (cutnode && depth >= IIRCutDepth && !ttMove) depth--; // Skip pruning in check, pv nodes, early iterations, when proving singularity, looking for terminal scores, or after a null move @@ -315,20 +380,20 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth goto move_loop; // Reverse Futility Pruning - if ( depth < 7 + if ( depth < RFPDepth && eval >= beta - && eval - 100 * depth - (ss-1)->histScore / 400 >= beta - && (!ttMove || GetHistory(thread, ss, ttMove) > 10000)) + && eval - RFPBase * depth - (ss-1)->histScore / RFPHistScore >= beta + && (!ttMove || GetHistory(thread, ss, ttMove) > RFPHistory)) return eval; // Null Move Pruning if ( eval >= beta && eval >= ss->eval - && ss->eval >= beta + 120 - 15 * depth - && (ss-1)->histScore < 35000 + && ss->eval >= beta + NMPFlat - NMPDepth * depth + && (ss-1)->histScore < NMPHist && pos->nonPawnCount[sideToMove] > (depth > 8)) { - Depth reduction = 3 + depth / 5 + MIN(3, (eval - beta) / 256); + Depth reduction = NMPRBase + depth / NMPRDepth + MIN(NMPREvalMin, (eval - beta) / NMPREvalDiv); // Remember who last null-moved Color nullMoverTemp = thread->nullMover; @@ -348,10 +413,10 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth return score >= TBWIN_IN_MAX ? beta : score; } - int probCutBeta = beta + 200; + int probCutBeta = beta + ProbCut; // ProbCut - if ( depth >= 5 + if ( depth >= ProbCutDepth && (!ttHit || ttBound == BOUND_LOWER || ttScore >= probCutBeta)) { InitProbcutMP(&mp, thread, ss, probCutBeta - ss->eval); @@ -376,7 +441,7 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth // Cut if the reduced depth search beats the threshold if (score >= probCutBeta) - return score - 100; + return score - ProbCutReturn; } } @@ -409,7 +474,7 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth && thread->doPruning && bestScore > -TBWIN_IN_MAX) { - int R = Reductions[quiet][MIN(31, depth)][MIN(31, moveCount)] - ss->histScore / 8192; + int R = Reductions[quiet][MIN(31, depth)][MIN(31, moveCount)] - ss->histScore / LMRHist; Depth lmrDepth = depth - 1 - R; // Quiet late move pruning @@ -417,11 +482,11 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth mp.onlyNoisy = true; // History pruning - if (lmrDepth < 3 && ss->histScore < -1024 * depth) + if (lmrDepth < HistPruneDepth && ss->histScore < -HistPrune * depth) continue; // SEE pruning - if (lmrDepth < 7 && !SEE(pos, move, quiet ? -50 * depth : -90 * depth)) + if (lmrDepth < SEEPruneDepth && !SEE(pos, move, quiet ? -SEEPruneQ * depth : -SEEPruneN * depth)) continue; } @@ -489,7 +554,7 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth // Base reduction int r = Reductions[quiet][MIN(31, depth)][MIN(31, moveCount)]; // Adjust reduction by move history - r -= ss->histScore / 8192; + r -= ss->histScore / LMRHist; // Reduce less in pv nodes r -= pvNode; // Reduce less when improving @@ -510,7 +575,7 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth // Research with the same window at full depth if the reduced search failed high if (score > alpha && lmrDepth < newDepth) { - bool deeper = score > bestScore + 70 + 12 * (newDepth - lmrDepth); + bool deeper = score > bestScore + DeeperBase + DeeperDepth * (newDepth - lmrDepth); newDepth += deeper; @@ -597,12 +662,12 @@ static void AspirationWindow(Thread *thread, Stack *ss) { int prevScore = thread->rootMoves[multiPV].score; - int delta = 12 + prevScore * prevScore / 16384; + int delta = Aspi + prevScore * prevScore / 16384; int alpha = MAX(prevScore - delta, -INFINITE); int beta = MIN(prevScore + delta, INFINITE); - int x = CLAMP(prevScore / 2, -35, 35); + int x = CLAMP(prevScore / 2, -Trend, Trend); pos->trend = sideToMove == WHITE ? S(x, x/2) : -S(x, x/2); // Repeatedly search and adjust the window until the score is inside the window diff --git a/src/search.h b/src/search.h index 15cbb079..69d30ecf 100644 --- a/src/search.h +++ b/src/search.h @@ -39,3 +39,5 @@ extern volatile bool SEARCH_STOPPED; void *SearchPosition(void *pos); + +void Reinit(); diff --git a/src/tests.c b/src/tests.c index f05318bf..8209da15 100644 --- a/src/tests.c +++ b/src/tests.c @@ -94,7 +94,7 @@ typedef struct BenchResult { } BenchResult; void Benchmark(int argc, char **argv) { - + Reinit(); // Default depth 16, 1 thread, and 32MB hash Limits.depth = argc > 2 ? atoi(argv[2]) : 16; int threadCount = argc > 3 ? atoi(argv[3]) : 1; diff --git a/src/uci.c b/src/uci.c index 0774eaa1..90ee505b 100644 --- a/src/uci.c +++ b/src/uci.c @@ -34,6 +34,65 @@ #include "uci.h" +extern float LMRNoisyBase; +extern float LMRNoisyDiv; +extern float LMRQuietBase; +extern float LMRQuietDiv; + +extern int IIRDepth; +extern int IIRCutDepth; +extern int RFPDepth; +extern int RFPBase; +extern int RFPHistScore; +extern int RFPHistory; +extern int NMPFlat; +extern int NMPDepth; +extern int NMPHist; +extern int NMPRBase; +extern int NMPRDepth; +extern int NMPREvalDiv; +extern int NMPREvalMin; +extern int ProbCut; +extern int ProbCutDepth; +extern int ProbCutReturn; +extern int HistPruneDepth; +extern int HistPrune; +extern int SEEPruneDepth; +extern int SEEPruneQ; +extern int SEEPruneN; +extern int LMRHist; +extern int DeeperBase; +extern int DeeperDepth; + +extern int QSFutility; + +extern int Aspi; +extern int Trend; + +extern int HistQDiv; +extern int HistCDiv; +extern int HistNDiv; +extern int HistBonusMax; +extern int HistBonusBase; +extern int HistBonusDepth; + +extern int NPower; +extern int BPower; +extern int RPower; +extern int QPower; +extern int NCPower; +extern int BCPower; +extern int RCPower; +extern int QCPower; +extern int Modifier1; +extern int Modifier2; +extern int Modifier3; +extern int Modifier4; +extern int Modifier5; +extern int Modifier6; +extern int Modifier7; +extern int Modifier8; + // Parses the time controls static void ParseTimeControl(const char *str, const Position *pos) { @@ -118,6 +177,66 @@ static void SetOption(char *str) { else if (OptionNameIs("NoobBook" )) noobbook = BooleanValue; else if (OptionNameIs("UCI_Chess960" )) chess960 = BooleanValue; else if (OptionNameIs("OnlineSyzygy" )) onlineSyzygy = BooleanValue; + + else if (OptionNameIs("LMRNoisyBase" )) LMRNoisyBase = IntValue / 100.0; + else if (OptionNameIs("LMRNoisyDiv" )) LMRNoisyDiv = IntValue / 100.0; + else if (OptionNameIs("LMRQuietBase" )) LMRQuietBase = IntValue / 100.0; + else if (OptionNameIs("LMRQuietDiv" )) LMRQuietDiv = IntValue / 100.0; + + else if (OptionNameIs("IIRDepth" )) IIRDepth = IntValue; + else if (OptionNameIs("IIRCutDepth" )) IIRCutDepth= IntValue; + else if (OptionNameIs("RFPDepth" )) RFPDepth = IntValue; + else if (OptionNameIs("RFPBase" )) RFPBase = IntValue; + else if (OptionNameIs("RFPHistScore" )) RFPHistScore = IntValue; + else if (OptionNameIs("RFPHistory" )) RFPHistory = IntValue; + else if (OptionNameIs("NMPFlat" )) NMPFlat = IntValue; + else if (OptionNameIs("NMPDepth" )) NMPDepth = IntValue; + else if (OptionNameIs("NMPHist" )) NMPHist = IntValue; + else if (OptionNameIs("NMPRBase" )) NMPRBase = IntValue; + else if (OptionNameIs("NMPRDepth" )) NMPRDepth = IntValue; + else if (OptionNameIs("NMPREvalDiv" )) NMPREvalDiv= IntValue; + else if (OptionNameIs("NMPREvalMin" )) NMPREvalMin= IntValue; + else if (OptionNameIs("ProbCut" )) ProbCut = IntValue; + else if (OptionNameIs("ProbCutDepth" )) ProbCutDepth = IntValue; + else if (OptionNameIs("ProbCutReturn" )) ProbCutReturn = IntValue; + else if (OptionNameIs("HistPruneDepth")) HistPruneDepth = IntValue; + else if (OptionNameIs("HistPrune" )) HistPrune = IntValue; + else if (OptionNameIs("SEEPruneDepth")) SEEPruneDepth = IntValue; + else if (OptionNameIs("SEEPruneQ" )) SEEPruneQ = IntValue; + else if (OptionNameIs("SEEPruneN" )) SEEPruneN = IntValue; + else if (OptionNameIs("LMRHist" )) LMRHist = IntValue; + else if (OptionNameIs("DeeperBase" )) DeeperBase = IntValue; + else if (OptionNameIs("DeeperDepth" )) DeeperDepth= IntValue; + + else if (OptionNameIs("QSFutility" )) QSFutility = IntValue; + + else if (OptionNameIs("Aspi" )) Aspi = IntValue; + else if (OptionNameIs("Trend" )) Trend = IntValue; + + else if (OptionNameIs("HistQDiv" )) HistQDiv = IntValue; + else if (OptionNameIs("HistCDiv" )) HistCDiv = IntValue; + else if (OptionNameIs("HistNDiv" )) HistNDiv = IntValue; + else if (OptionNameIs("HistBonusMax" )) HistBonusMax = IntValue; + else if (OptionNameIs("HistBonusBase")) HistBonusBase = IntValue; + else if (OptionNameIs("HistBonusDepth")) HistBonusDepth = IntValue; + + else if (OptionNameIs("NPower" )) NPower = IntValue; + else if (OptionNameIs("BPower" )) BPower = IntValue; + else if (OptionNameIs("RPower" )) RPower = IntValue; + else if (OptionNameIs("QPower" )) QPower = IntValue; + else if (OptionNameIs("NCPower" )) NCPower = IntValue; + else if (OptionNameIs("BCPower" )) BCPower = IntValue; + else if (OptionNameIs("RCPower" )) RCPower = IntValue; + else if (OptionNameIs("QCPower" )) QCPower = IntValue; + else if (OptionNameIs("Modifier1" )) Modifier1 = IntValue; + else if (OptionNameIs("Modifier2" )) Modifier2 = IntValue; + else if (OptionNameIs("Modifier3" )) Modifier3 = IntValue; + else if (OptionNameIs("Modifier4" )) Modifier4 = IntValue; + else if (OptionNameIs("Modifier5" )) Modifier5 = IntValue; + else if (OptionNameIs("Modifier6" )) Modifier6 = IntValue; + else if (OptionNameIs("Modifier7" )) Modifier7 = IntValue; + else if (OptionNameIs("Modifier8" )) Modifier8 = IntValue; + else puts("info string No such option."); fflush(stdout); @@ -135,6 +254,66 @@ static void Info() { printf("option name NoobBook type check default false\n"); printf("option name NoobBookLimit type spin default 0 min 0 max 1000\n"); printf("option name OnlineSyzygy type check default false\n"); + + printf("option name LMRNoisyBase type spin default %d min %d max %d\n", LMRNoisyBase, -100000, 100000); + printf("option name LMRNoisyDiv type spin default %d min %d max %d\n", LMRNoisyDiv, -100000, 100000); + printf("option name LMRQuietBase type spin default %d min %d max %d\n", LMRQuietBase, -100000, 100000); + printf("option name LMRQuietDiv type spin default %d min %d max %d\n", LMRQuietDiv, -100000, 100000); + + printf("option name IIRDepth type spin default %d min %d max %d\n", IIRDepth, -100000, 100000); + printf("option name IIRCutDepth type spin default %d min %d max %d\n", IIRCutDepth, -100000, 100000); + printf("option name RFPDepth type spin default %d min %d max %d\n", RFPDepth, -100000, 100000); + printf("option name RFPBase type spin default %d min %d max %d\n", RFPBase, -100000, 100000); + printf("option name RFPHistScore type spin default %d min %d max %d\n", RFPHistScore, -100000, 100000); + printf("option name RFPHistory type spin default %d min %d max %d\n", RFPHistory, -100000, 100000); + printf("option name NMPFlat type spin default %d min %d max %d\n", NMPFlat, -100000, 100000); + printf("option name NMPDepth type spin default %d min %d max %d\n", NMPDepth, -100000, 100000); + printf("option name NMPHist type spin default %d min %d max %d\n", NMPHist, -100000, 100000); + printf("option name NMPRBase type spin default %d min %d max %d\n", NMPRBase, -100000, 100000); + printf("option name NMPRDepth type spin default %d min %d max %d\n", NMPRDepth, -100000, 100000); + printf("option name NMPREvalDiv type spin default %d min %d max %d\n", NMPREvalDiv, -100000, 100000); + printf("option name NMPREvalMin type spin default %d min %d max %d\n", NMPREvalMin, -100000, 100000); + printf("option name ProbCut type spin default %d min %d max %d\n", ProbCut, -100000, 100000); + printf("option name ProbCutDepth type spin default %d min %d max %d\n", ProbCutDepth, -100000, 100000); + printf("option name ProbCutReturn type spin default %d min %d max %d\n", ProbCutReturn, -100000, 100000); + printf("option name HistPruneDepth type spin default %d min %d max %d\n", HistPruneDepth, -100000, 100000); + printf("option name HistPrune type spin default %d min %d max %d\n", HistPrune, -100000, 100000); + printf("option name SEEPruneDepth type spin default %d min %d max %d\n", SEEPruneDepth, -100000, 100000); + printf("option name SEEPruneQ type spin default %d min %d max %d\n", SEEPruneQ, -100000, 100000); + printf("option name SEEPruneN type spin default %d min %d max %d\n", SEEPruneN, -100000, 100000); + printf("option name LMRHist type spin default %d min %d max %d\n", LMRHist, -100000, 100000); + printf("option name DeeperBase type spin default %d min %d max %d\n", DeeperBase, -100000, 100000); + printf("option name DeeperDepth type spin default %d min %d max %d\n", DeeperDepth, -100000, 100000); + + printf("option name QSFutility type spin default %d min %d max %d\n", QSFutility, -100000, 100000); + + printf("option name Aspi type spin default %d min %d max %d\n", Aspi, -100000, 100000); + printf("option name Trend type spin default %d min %d max %d\n", Trend, -100000, 100000); + + printf("option name HistQDiv type spin default %d min %d max %d\n", HistQDiv, -100000, 100000); + printf("option name HistCDiv type spin default %d min %d max %d\n", HistCDiv, -100000, 100000); + printf("option name HistNDiv type spin default %d min %d max %d\n", HistNDiv, -100000, 100000); + printf("option name HistBonusMax type spin default %d min %d max %d\n", HistBonusMax, -100000, 100000); + printf("option name HistBonusBase type spin default %d min %d max %d\n", HistBonusBase, -100000, 100000); + printf("option name HistBonusDepth type spin default %d min %d max %d\n", HistBonusDepth, -100000, 100000); + + printf("option name NPower type spin default %d min %d max %d\n", NPower, -100000, 100000); + printf("option name BPower type spin default %d min %d max %d\n", BPower, -100000, 100000); + printf("option name RPower type spin default %d min %d max %d\n", RPower, -100000, 100000); + printf("option name QPower type spin default %d min %d max %d\n", QPower, -100000, 100000); + printf("option name NCPower type spin default %d min %d max %d\n", NCPower, -100000, 100000); + printf("option name BCPower type spin default %d min %d max %d\n", BCPower, -100000, 100000); + printf("option name RCPower type spin default %d min %d max %d\n", RCPower, -100000, 100000); + printf("option name QCPower type spin default %d min %d max %d\n", QCPower, -100000, 100000); + printf("option name Modifier1 type spin default %d min %d max %d\n", Modifier1, -100000, 100000); + printf("option name Modifier2 type spin default %d min %d max %d\n", Modifier2, -100000, 100000); + printf("option name Modifier3 type spin default %d min %d max %d\n", Modifier3, -100000, 100000); + printf("option name Modifier4 type spin default %d min %d max %d\n", Modifier4, -100000, 100000); + printf("option name Modifier5 type spin default %d min %d max %d\n", Modifier5, -100000, 100000); + printf("option name Modifier6 type spin default %d min %d max %d\n", Modifier6, -100000, 100000); + printf("option name Modifier7 type spin default %d min %d max %d\n", Modifier7, -100000, 100000); + printf("option name Modifier8 type spin default %d min %d max %d\n", Modifier8, -100000, 100000); + printf("uciok\n"); fflush(stdout); } @@ -147,6 +326,7 @@ static void Stop() { // Signals the engine is ready static void IsReady() { + Reinit(); InitTT(); puts("readyok"); fflush(stdout);