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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔍 RFP: add history factor - simple impl with quiet history #1329

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Lynx/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ public int Threads
[SPSA<int>(1, 300, 15)]
public int RFP_DepthScalingFactor { get; set; } = 52;

[SPSA<int>(200, 600, 20)]
public int RFP_HistoryDivisor { get; set; } = 400;

[SPSA<int>(1, 10, 0.5)]
public int Razoring_MaxDepth { get; set; } = 2;

Expand Down
4 changes: 3 additions & 1 deletion src/Lynx/Search/NegaMax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ private int NegaMax(int depth, int ply, int alpha, int beta, bool cutnode, Cance
var improvingFactor = improvingRate * (0.75 * depth);

var rfpThreshold = rfpMargin + improvingFactor;
var previousMove = Game.ReadMoveFromStack(ply - 1);
var previousMoveHistory = _quietHistory[previousMove.Piece()][previousMove.TargetSquare()];

if (staticEval - rfpThreshold >= beta)
if (staticEval - rfpThreshold >= beta + previousMoveHistory / Configuration.EngineSettings.RFP_HistoryDivisor)
{
#pragma warning disable S3949 // Calculations should not overflow - value is being set at the beginning of the else if (!pvNode)
return (staticEval + beta) / 2;
Expand Down
Loading