diff --git a/src/Lynx/EvaluationConstants.cs b/src/Lynx/EvaluationConstants.cs index a1a934acc..583139a91 100644 --- a/src/Lynx/EvaluationConstants.cs +++ b/src/Lynx/EvaluationConstants.cs @@ -89,17 +89,17 @@ static EvaluationConstants() /// /// Base absolute checkmate evaluation value. Actual absolute evaluations are lower than this one by a number of /// - public const int CheckMateBaseEvaluation = 30_000; + public const int CheckMateBaseEvaluation = 29_000; /// /// Max eval, including checkmate values /// - public const int MaxEval = CheckMateBaseEvaluation + 1; + public const int MaxEval = 32_000; // CheckMateBaseEvaluation + (Constants.AbsoluteMaxDepth + 45) * DepthCheckmateFactor; /// /// Min eval, including checkmate values /// - public const int MinEval = -CheckMateBaseEvaluation - 1; + public const int MinEval = -32_000; // -CheckMateBaseEvaluation - (Constants.AbsoluteMaxDepth + 45) * DepthCheckmateFactor; /// /// This value combined with and should allows mates up to in moves. @@ -109,12 +109,12 @@ static EvaluationConstants() /// /// Minimum evaluation for a position to be White checkmate /// - public const int PositiveCheckmateDetectionLimit = 27_000; // CheckMateBaseEvaluation - (Constants.AbsoluteMaxDepth + 45) * DepthCheckmateFactor; + public const int PositiveCheckmateDetectionLimit = 26_000; // CheckMateBaseEvaluation - (Constants.AbsoluteMaxDepth + 45) * DepthCheckmateFactor; /// /// Minimum evaluation for a position to be Black checkmate /// - public const int NegativeCheckmateDetectionLimit = -27_000; // -CheckMateBaseEvaluation + (Constants.AbsoluteMaxDepth + 45) * DepthCheckmateFactor; + public const int NegativeCheckmateDetectionLimit = -26_000; // -CheckMateBaseEvaluation + (Constants.AbsoluteMaxDepth + 45) * DepthCheckmateFactor; /// /// Max static eval. It doesn't include checkmate values and it's below @@ -126,6 +126,16 @@ static EvaluationConstants() /// public const int MinStaticEval = NegativeCheckmateDetectionLimit + 1; + /// + /// Outside of the evaluation ranges (higher than any sensible evaluation, lower than ) + /// + public const int NoHashEntry = 25_000; + + /// + /// Evaluation to be returned when there's one single legal move + /// + public const int SingleMoveScore = 200; + #region Move ordering public const int TTMoveScoreValue = 2_097_152; @@ -156,16 +166,6 @@ static EvaluationConstants() #endregion - /// - /// Outside of the evaluation ranges (higher than any sensible evaluation, lower than ) - /// - public const int NoHashEntry = 25_000; - - /// - /// Evaluation to be returned when there's one single legal move - /// - public const int SingleMoveScore = 200; - public const int ContinuationHistoryPlyCount = 1; } diff --git a/tests/Lynx.Test/EvaluationConstantsTest.cs b/tests/Lynx.Test/EvaluationConstantsTest.cs index 77f9eedd7..b6f2f299f 100644 --- a/tests/Lynx.Test/EvaluationConstantsTest.cs +++ b/tests/Lynx.Test/EvaluationConstantsTest.cs @@ -47,12 +47,14 @@ public void NegativeCheckmateDetectionLimitTest() public void MaxEvalTest() { Assert.Greater(MaxEval, PositiveCheckmateDetectionLimit + ((Constants.AbsoluteMaxDepth + 10) * CheckmateDepthFactor)); + Assert.Less(MaxEval, short.MaxValue); } [Test] public void MinEvalTest() { Assert.Less(MinEval, NegativeCheckmateDetectionLimit - ((Constants.AbsoluteMaxDepth + 10) * CheckmateDepthFactor)); + Assert.Greater(MinEval, short.MinValue); } [Test]