Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃Ч Remove UseOnlineTablebaseInSearch from UCI #441

Merged
merged 1 commit into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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