Skip to content

Commit

Permalink
Cleanup after fake ponder hit removal
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio committed Feb 8, 2024
1 parent c8a7f41 commit c2712b1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
11 changes: 1 addition & 10 deletions src/Lynx/Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using Lynx.UCI.Commands.Engine;
using Lynx.UCI.Commands.GUI;
using NLog;
using System.Diagnostics;
using System.Security.Cryptography;
using System.Threading.Channels;

namespace Lynx;
Expand Down Expand Up @@ -87,14 +85,7 @@ public void NewGame()
}
}

// Clear killer moves
Debug.Assert(_killerMoves.Length == 3);
Array.Clear(_killerMoves[0]);
Array.Clear(_killerMoves[1]);
Array.Clear(_killerMoves[2]);
// No need to clear _previousKillerMoves

// _pVTable will be cleared on IDDFS, since it needs to be cleaned for every search as well, no matter what
// No need to clear killer move or pv table because they're cleared on every search (IDDFS)
}

public void AdjustPosition(ReadOnlySpan<char> rawPositionCommand)
Expand Down
8 changes: 0 additions & 8 deletions src/Lynx/Search/IDDFS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ public sealed partial class Engine
private bool _isScoringPV;

private SearchResult? _previousSearchResult;
private readonly int[][] _previousKillerMoves =
[
new int[Configuration.EngineSettings.MaxDepth],
new int[Configuration.EngineSettings.MaxDepth],
new int[Configuration.EngineSettings.MaxDepth]
];

private readonly Move _defaultMove = default;

Expand Down Expand Up @@ -151,8 +145,6 @@ public sealed partial class Engine
lastSearchResult = UpdateLastSearchResult(lastSearchResult, bestEvaluation, alpha, beta, depth, isMateDetected, bestEvaluationAbs);

await _engineWriter.WriteAsync(InfoCommand.SearchResultInfo(lastSearchResult));

Array.Copy(_killerMoves, _previousKillerMoves, _killerMoves.Length);
} while (StopSearchCondition(++depth, maxDepth, isMateDetected, decisionTime));
}
catch (OperationCanceledException)
Expand Down

0 comments on commit c2712b1

Please sign in to comment.