diff --git a/src/evaluate.c b/src/evaluate.c index b4fbfbb9..95606089 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -51,7 +51,7 @@ const int PieceValue[2][PIECE_NB] = { }; // Bonus for being the side to move -const int Tempo = 19; +extern int Tempo; // Misc bonuses and maluses const int PawnDoubled = S(-11,-48); @@ -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] = { 36, 19, 22, 72 }; -const int CheckPower[4] = { 71, 39, 80, 74 }; -const int CountModifier[8] = { 0, 0, 63, 126, 96, 124, 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..522bbc9d 100644 --- a/src/evaluate.h +++ b/src/evaluate.h @@ -33,7 +33,7 @@ typedef struct PawnEntry { typedef PawnEntry PawnCache[PAWN_CACHE_SIZE]; -extern const int Tempo; +extern int Tempo; extern const int PieceValue[COLOR_NB][PIECE_NB]; @@ -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 284acabf..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, 5885)) -#define NoisyHistoryUpdate(move, bonus) (HistoryBonus(NoisyEntry(move), bonus, 14500)) -#define ContHistoryUpdate(offset, move, bonus) (HistoryBonus(ContEntry(offset, move), bonus, 23930)) +#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(2300, 315 * depth - 255); + return MIN(HistBonusMax, HistBonusDepth * depth - HistBonusBase); } INLINE void UpdateContHistories(Stack *ss, Move move, int bonus) { diff --git a/src/movepicker.c b/src/movepicker.c index 641894e6..2928fab4 100644 --- a/src/movepicker.c +++ b/src/movepicker.c @@ -22,6 +22,11 @@ #include "movepicker.h" +extern int ScoreMovesLimit; +extern int MPGood; +extern int MPBad; + + // Return the next best move static Move PickNextMove(MovePicker *mp) { @@ -69,7 +74,7 @@ static void ScoreMoves(MovePicker *mp, const int stage) { : GetCaptureHistory(thread, move) + PieceValue[MG][capturing(move)]; } - SortMoves(list, -1280 * mp->depth); + SortMoves(list, -ScoreMovesLimit * mp->depth); } // Returns the next move to try in a position @@ -96,8 +101,8 @@ Move NextMove(MovePicker *mp) { case NOISY_GOOD: // Save seemingly bad noisy moves for later while ((move = PickNextMove(mp))) - if ( mp->list.moves[mp->list.next-1].score > 13470 - || (mp->list.moves[mp->list.next-1].score > -8830 && SEE(pos, move, mp->threshold))) + if ( mp->list.moves[mp->list.next-1].score > MPGood + || (mp->list.moves[mp->list.next-1].score > -MPBad && SEE(pos, move, mp->threshold))) return move; else mp->list.moves[mp->bads++].move = move; diff --git a/src/search.c b/src/search.c index 065b5786..80f39f0d 100644 --- a/src/search.c +++ b/src/search.c @@ -43,12 +43,90 @@ volatile bool SEARCH_STOPPED = true; static int Reductions[2][32][32]; +float LMRNoisyBase = 0.20; +float LMRNoisyDiv = 3.35; +float LMRQuietBase = 1.35; +float LMRQuietDiv = 2.75; + +int IIRDepth = 3; +int IIRCutDepth = 8; +int RFPDepth = 7; +int RFPBase = 80; +int RFPHistScore = 230; +int RFPHistory = 7300; +int NMPFlat = 135; +int NMPDepth = 19; +int NMPHist = 25500; +int NMPRBase = 3; +int NMPRDepth = 4; +int NMPREvalDiv = 256; +int NMPREvalMin = 3; +int ProbCut = 180; +int ProbCutDepth = 5; +int ProbCutReturn = 138; +int LMPImp = 1; +int LMPNonImp = -2; +int HistPruneDepth = 3; +int HistPrune = 1024; +int SEEPruneDepth = 7; +int SEEPruneQ = 50; +int SEEPruneN = 85; +int SingExtDepth = 4; +int SingExtTTDepth = 3; +int SingExtDouble = 19; +int LMRHist = 8550; +int DeeperBase = 55; +int DeeperDepth = 16; + +int QSFutility = 68; + +int Aspi = 9; +int AspiScoreDiv = 15500; +int Trend = 34; +float TrendDiv = 0.50; +int PruneDiv = 58; +int PruneDepthDiv = 281; + +int HistQDiv = 5885; +int HistCDiv = 23930; +int HistNDiv = 14500; +int HistBonusMax = 2300; +int HistBonusBase = 255; +int HistBonusDepth = 315; + +int Tempo = 19; +int NPower = 36; +int BPower = 19; +int RPower = 22; +int QPower = 72; +int NCPower = 71; +int BCPower = 39; +int RCPower = 80; +int QCPower = 74; +int Modifier1 = 0; +int Modifier2 = 0; +int Modifier3 = 63; +int Modifier4 = 126; +int Modifier5 = 96; +int Modifier6 = 124; +int Modifier7 = 124; +int Modifier8 = 128; + +int ScoreMovesLimit = 1280; +int MPGood = 13470; +int MPBad = 8830; + // 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.20 + log(depth) * log(moves) / 3.35, // capture - Reductions[1][depth][moves] = 1.35 + log(depth) * log(moves) / 2.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 @@ -122,7 +200,7 @@ static int Quiescence(Thread *thread, Stack *ss, int alpha, const int beta) { if (eval > alpha) alpha = eval; - futility = eval + 68; + futility = eval + QSFutility; bestScore = eval; moveloop: @@ -298,10 +376,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 >= 3 && !ttMove) + if (pvNode && depth >= IIRDepth && !ttMove) depth--; - if (cutnode && depth >= 8 && !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 @@ -309,20 +387,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 - 80 * (depth - improving) - (ss-1)->histScore / 230 >= beta - && (!ttMove || GetHistory(thread, ss, ttMove) > 7300)) + && eval - RFPBase * (depth - improving) - (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 + 135 - 19 * depth - && (ss-1)->histScore < 25500 + && ss->eval >= beta + NMPFlat - NMPDepth * depth + && (ss-1)->histScore < NMPHist && pos->nonPawnCount[sideToMove] > (depth > 8)) { - Depth reduction = 3 + depth / 4 + MIN(3, (eval - beta) / 256); + Depth reduction = NMPRBase + depth / NMPRDepth + MIN(NMPREvalMin, (eval - beta) / NMPREvalDiv); ss->continuation = &thread->continuation[0][0][EMPTY][0]; @@ -336,10 +414,10 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth return score >= TBWIN_IN_MAX ? beta : score; } - int probCutBeta = beta + 180; + int probCutBeta = beta + ProbCut; // ProbCut - if ( depth >= 5 + if ( depth >= ProbCutDepth && (!ttHit || ttBound == BOUND_LOWER || ttScore >= probCutBeta)) { InitProbcutMP(&mp, thread, ss, probCutBeta - ss->eval); @@ -364,7 +442,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 - 138; + return score - ProbCutReturn; } } @@ -397,19 +475,19 @@ 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 / 8550; + int R = Reductions[quiet][MIN(31, depth)][MIN(31, moveCount)] - ss->histScore / LMRHist; Depth lmrDepth = depth - 1 - R; // Quiet late move pruning - if (moveCount > (improving ? 1 + depth * depth : -2 + depth * depth / 2)) + if (moveCount > (improving ? LMPImp + depth * depth : LMPNonImp + depth * depth / 2)) 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 : -85 * depth)) + if (lmrDepth < SEEPruneDepth && !SEE(pos, move, quiet ? -SEEPruneQ * depth : -SEEPruneN * depth)) continue; } @@ -426,10 +504,10 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth goto skip_extensions; // Singular extension - if ( depth > 4 + if ( depth > SingExtDepth && move == ttMove && !ss->excluded - && ttDepth > depth - 3 + && ttDepth > depth - SingExtTTDepth && ttBound != BOUND_UPPER && abs(ttScore) < TBWIN_IN_MAX / 4) { @@ -445,7 +523,7 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth // Singular - extend by 1 or 2 ply if (score < singularBeta) { extension = 1; - if (!pvNode && score < singularBeta - 19 && ss->doubleExtensions <= 5) + if (!pvNode && score < singularBeta - SingExtDouble && ss->doubleExtensions <= 5) extension = 2; // MultiCut - ttMove as well as at least one other move seem good enough to beat beta } else if (singularBeta >= beta) @@ -477,7 +555,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 / 8550; + r -= ss->histScore / LMRHist; // Reduce less in pv nodes r -= pvNode; // Reduce less when improving @@ -496,7 +574,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 + 55 + 16 * (newDepth - lmrDepth); + bool deeper = score > bestScore + DeeperBase + DeeperDepth * (newDepth - lmrDepth); newDepth += deeper; @@ -583,12 +661,12 @@ static void AspirationWindow(Thread *thread, Stack *ss) { int prevScore = thread->rootMoves[multiPV].score; - int delta = 9 + prevScore * prevScore / 15500; + int delta = Aspi + prevScore * prevScore / AspiScoreDiv; int alpha = MAX(prevScore - delta, -INFINITE); int beta = MIN(prevScore + delta, INFINITE); - int x = CLAMP(prevScore / 2, -34, 34); + int x = CLAMP(prevScore * TrendDiv, -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 @@ -596,8 +674,8 @@ static void AspirationWindow(Thread *thread, Stack *ss) { thread->doPruning = Limits.infinite ? TimeSince(Limits.start) > 1000 - : TimeSince(Limits.start) >= Limits.optimalUsage / 58 - || depth > 2 + Limits.optimalUsage / 281; + : TimeSince(Limits.start) >= Limits.optimalUsage / PruneDiv + || depth > 2 + Limits.optimalUsage / PruneDepthDiv; int score = AlphaBeta(thread, ss, alpha, beta, depth, false); 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..778d5a6a 100644 --- a/src/uci.c +++ b/src/uci.c @@ -34,6 +34,79 @@ #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 LMPImp; +extern int LMPNonImp; +extern int HistPruneDepth; +extern int HistPrune; +extern int SEEPruneDepth; +extern int SEEPruneQ; +extern int SEEPruneN; +extern int SingExtDepth; +extern int SingExtTTDepth; +extern int SingExtDouble; +extern int LMRHist; +extern int DeeperBase; +extern int DeeperDepth; + +extern int QSFutility; + +extern int Aspi; +extern int AspiScoreDiv; +extern int Trend; +extern float TrendDiv; +extern int PruneDiv; +extern int PruneDepthDiv; + +extern int HistQDiv; +extern int HistCDiv; +extern int HistNDiv; +extern int HistBonusMax; +extern int HistBonusBase; +extern int HistBonusDepth; + +extern int Tempo; +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; + +extern int ScoreMovesLimit; +extern int MPGood; +extern int MPBad; + // Parses the time controls static void ParseTimeControl(const char *str, const Position *pos) { @@ -118,6 +191,80 @@ 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("LMPImp" )) LMPImp = IntValue; + else if (OptionNameIs("LMPNonImp" )) LMPNonImp = 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("SingExtDepth" )) SingExtDepth = IntValue; + else if (OptionNameIs("SingExtTTDepth")) SingExtTTDepth = IntValue; + else if (OptionNameIs("SingExtDouble")) SingExtDouble = 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("AspiScoreDiv" )) AspiScoreDiv = IntValue; + else if (OptionNameIs("Trend" )) Trend = IntValue; + else if (OptionNameIs("TrendDiv" )) TrendDiv = IntValue / 100.0; + else if (OptionNameIs("PruneDiv" )) PruneDiv = IntValue; + else if (OptionNameIs("PruneDepthDiv")) PruneDepthDiv = 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("Tempo" )) Tempo = 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 if (OptionNameIs("ScoreMovesLimit")) ScoreMovesLimit = IntValue; + else if (OptionNameIs("MPGood" )) MPGood = IntValue; + else if (OptionNameIs("MPBad" )) MPBad = IntValue; + else puts("info string No such option."); fflush(stdout); @@ -135,6 +282,80 @@ 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", (int)(LMRNoisyBase * 100), -100000, 100000); + printf("option name LMRNoisyDiv type spin default %d min %d max %d\n", (int)(LMRNoisyDiv * 100), -100000, 100000); + printf("option name LMRQuietBase type spin default %d min %d max %d\n", (int)(LMRQuietBase * 100), -100000, 100000); + printf("option name LMRQuietDiv type spin default %d min %d max %d\n", (int)(LMRQuietDiv * 100), -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 LMPImp type spin default %d min %d max %d\n", LMPImp, -100000, 100000); + printf("option name LMPNonImp type spin default %d min %d max %d\n", LMPNonImp, -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 SingExtDepth type spin default %d min %d max %d\n", SingExtDepth, -100000, 100000); + printf("option name SingExtTTDepth type spin default %d min %d max %d\n", SingExtTTDepth, -100000, 100000); + printf("option name SingExtDouble type spin default %d min %d max %d\n", SingExtDouble, -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 AspiScoreDiv type spin default %d min %d max %d\n", AspiScoreDiv, -100000, 100000); + printf("option name Trend type spin default %d min %d max %d\n", Trend, -100000, 100000); + printf("option name TrendDiv type spin default %d min %d max %d\n", (int)(TrendDiv * 100), -100000, 100000); + printf("option name PruneDiv type spin default %d min %d max %d\n", PruneDiv, -100000, 100000); + printf("option name PruneDepthDiv type spin default %d min %d max %d\n", PruneDepthDiv, -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 Tempo type spin default %d min %d max %d\n", Tempo, -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("option name ScoreMovesLimit type spin default %d min %d max %d\n", ScoreMovesLimit, -100000, 100000); + printf("option name MPGood type spin default %d min %d max %d\n", MPGood, -100000, 100000); + printf("option name MPBad type spin default %d min %d max %d\n", MPBad, -100000, 100000); + printf("uciok\n"); fflush(stdout); } @@ -147,6 +368,7 @@ static void Stop() { // Signals the engine is ready static void IsReady() { + Reinit(); InitTT(); puts("readyok"); fflush(stdout);