Skip to content

Commit

Permalink
🧹 Remove UseOnlineTablebaseInSearch from UCI (#441)
Browse files Browse the repository at this point in the history
Since it just doesn't work due to API rate limiting, we're not showing it as on option via UCI any more.
Configuration field remains and it's actually still settable via UCI, but it just won't have any effects

Co-authored-by: Eduardo Caceres <edcaceres@microsoft.com>
  • Loading branch information
eduherminio and Eduardo Caceres committed Oct 15, 2023
1 parent fe2bd32 commit b226313
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/Lynx/Model/Position.cs
Original file line number Diff line number Diff line change
Expand Up @@ -588,16 +588,16 @@ public string FEN(int halfMovesWithoutCaptureOrPawnMove = 0, int fullMoveClock =
/// </summary>
/// <returns></returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int StaticEvaluation(int movesWithoutCaptureOrPawnMove, CancellationToken cancellationToken = default)
public int StaticEvaluation(int movesWithoutCaptureOrPawnMove)
{
var result = OnlineTablebaseProber.EvaluationSearch(this, movesWithoutCaptureOrPawnMove, cancellationToken);
Debug.Assert(result < EvaluationConstants.CheckMateBaseEvaluation, $"position {FEN()} returned tb eval out of bounds: {result}");
Debug.Assert(result > -EvaluationConstants.CheckMateBaseEvaluation, $"position {FEN()} returned tb eval out of bounds: {result}");
//var result = OnlineTablebaseProber.EvaluationSearch(this, movesWithoutCaptureOrPawnMove, cancellationToken);
//Debug.Assert(result < EvaluationConstants.CheckMateBaseEvaluation, $"position {FEN()} returned tb eval out of bounds: {result}");
//Debug.Assert(result > -EvaluationConstants.CheckMateBaseEvaluation, $"position {FEN()} returned tb eval out of bounds: {result}");

if (result != OnlineTablebaseProber.NoResult)
{
return result;
}
//if (result != OnlineTablebaseProber.NoResult)
//{
// return result;
//}

var pieceCount = new int[PieceBitBoards.Length];

Expand Down
6 changes: 3 additions & 3 deletions src/Lynx/Search/NegaMax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private int NegaMax(int depth, int ply, int alpha, int beta, bool isVerifyingNul
if (ply >= Configuration.EngineSettings.MaxDepth)
{
_logger.Info("Max depth {0} reached", Configuration.EngineSettings.MaxDepth);
return position.StaticEvaluation(Game.HalfMovesWithoutCaptureOrPawnMove, _searchCancellationTokenSource.Token);
return position.StaticEvaluation(Game.HalfMovesWithoutCaptureOrPawnMove);
}

_maxDepthReached[ply] = ply;
Expand Down Expand Up @@ -299,7 +299,7 @@ public int QuiescenceSearch(int ply, int alpha, int beta)
if (ply >= Configuration.EngineSettings.MaxDepth)
{
_logger.Info("Max depth {0} reached", Configuration.EngineSettings.MaxDepth);
return position.StaticEvaluation(Game.HalfMovesWithoutCaptureOrPawnMove, _searchCancellationTokenSource.Token);
return position.StaticEvaluation(Game.HalfMovesWithoutCaptureOrPawnMove);
}

var pvIndex = PVTable.Indexes[ply];
Expand All @@ -308,7 +308,7 @@ public int QuiescenceSearch(int ply, int alpha, int beta)

_maxDepthReached[ply] = ply;

var staticEvaluation = position.StaticEvaluation(Game.HalfMovesWithoutCaptureOrPawnMove, _searchCancellationTokenSource.Token);
var staticEvaluation = position.StaticEvaluation(Game.HalfMovesWithoutCaptureOrPawnMove);

// Fail-hard beta-cutoff (updating alpha after this check)
if (staticEvaluation >= beta)
Expand Down
2 changes: 1 addition & 1 deletion src/Lynx/UCI/Commands/Engine/OptionCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public sealed class OptionCommand : EngineBaseCommand
$"option name UCI_ShowWDL type check default {Configuration.EngineSettings.ShowWDL}",
$"option name Hash type spin default {Configuration.EngineSettings.TranspositionTableSize} min 0 max 1024",
$"option name OnlineTablebaseInRootPositions type check default {Configuration.EngineSettings.UseOnlineTablebaseInRootPositions}",
$"option name OnlineTablebaseInSearch type check default {Configuration.EngineSettings.UseOnlineTablebaseInSearch}",
//$"option name OnlineTablebaseInSearch type check default {Configuration.EngineSettings.UseOnlineTablebaseInSearch}",
"option name Threads type spin default 1 min 1 max 1"
);

Expand Down

0 comments on commit b226313

Please sign in to comment.