1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 01:03:09 +00:00
FauziAkram 2023-03-21 23:58:25 +03:00 committed by Joost VandeVondele
parent 24b37e4586
commit b973e40e45

View file

@ -732,7 +732,7 @@ namespace {
} }
else if (excludedMove) else if (excludedMove)
{ {
// Providing the hint that this node's accumulator will be used often brings significant Elo gain (13 elo) // Providing the hint that this node's accumulator will be used often brings significant Elo gain (13 Elo)
Eval::NNUE::hint_common_parent_position(pos); Eval::NNUE::hint_common_parent_position(pos);
eval = ss->staticEval; eval = ss->staticEval;
complexity = abs(ss->staticEval - pos.psq_eg_stm()); complexity = abs(ss->staticEval - pos.psq_eg_stm());
@ -1120,15 +1120,15 @@ moves_loop: // When in check, search starts here
else if (singularBeta >= beta) else if (singularBeta >= beta)
return singularBeta; return singularBeta;
// If the eval of ttMove is greater than beta, we reduce it (negative extension) // If the eval of ttMove is greater than beta, we reduce it (negative extension) (~7 Elo)
else if (ttValue >= beta) else if (ttValue >= beta)
extension = -2 - !PvNode; extension = -2 - !PvNode;
// If the eval of ttMove is less than value, we reduce it (negative extension) // If the eval of ttMove is less than value, we reduce it (negative extension) (~1 Elo)
else if (ttValue <= value) else if (ttValue <= value)
extension = -1; extension = -1;
// If the eval of ttMove is less than alpha, we reduce it (negative extension) // If the eval of ttMove is less than alpha, we reduce it (negative extension) (~1 Elo)
else if (ttValue <= alpha) else if (ttValue <= alpha)
extension = -1; extension = -1;
} }
@ -1182,7 +1182,7 @@ moves_loop: // When in check, search starts here
if (ttCapture) if (ttCapture)
r++; r++;
// Decrease reduction for PvNodes based on depth // Decrease reduction for PvNodes based on depth (~2 Elo)
if (PvNode) if (PvNode)
r -= 1 + 12 / (3 + depth); r -= 1 + 12 / (3 + depth);
@ -1195,11 +1195,11 @@ moves_loop: // When in check, search starts here
&& (mp.threatenedPieces & from_sq(move))) && (mp.threatenedPieces & from_sq(move)))
r--; r--;
// Increase reduction if next ply has a lot of fail high // Increase reduction if next ply has a lot of fail high (~5 Elo)
if ((ss+1)->cutoffCnt > 3) if ((ss+1)->cutoffCnt > 3)
r++; r++;
// Decrease reduction if move is a killer and we have a good history // Decrease reduction if move is a killer and we have a good history (~1 Elo)
if (move == ss->killers[0] if (move == ss->killers[0]
&& (*contHist[0])[movedPiece][to_sq(move)] >= 3722) && (*contHist[0])[movedPiece][to_sq(move)] >= 3722)
r--; r--;
@ -1210,7 +1210,7 @@ moves_loop: // When in check, search starts here
+ (*contHist[3])[movedPiece][to_sq(move)] + (*contHist[3])[movedPiece][to_sq(move)]
- 4182; - 4182;
// Decrease/increase reduction for moves with a good/bad history (~30 Elo) // Decrease/increase reduction for moves with a good/bad history (~25 Elo)
r -= ss->statScore / (11791 + 3992 * (depth > 6 && depth < 19)); r -= ss->statScore / (11791 + 3992 * (depth > 6 && depth < 19));
// Step 17. Late moves reduction / extension (LMR, ~117 Elo) // Step 17. Late moves reduction / extension (LMR, ~117 Elo)
@ -1347,7 +1347,7 @@ moves_loop: // When in check, search starts here
{ {
alpha = value; alpha = value;
// Reduce other moves if we have found at least one score improvement // Reduce other moves if we have found at least one score improvement (~1 Elo)
if ( depth > 1 if ( depth > 1
&& depth < 6 && depth < 6
&& beta < 10534 && beta < 10534
@ -1413,7 +1413,7 @@ moves_loop: // When in check, search starts here
bestValue = std::min(bestValue, maxValue); bestValue = std::min(bestValue, maxValue);
// If no good move is found and the previous position was ttPv, then the previous // If no good move is found and the previous position was ttPv, then the previous
// opponent move is probably good and the new position is added to the search tree. // opponent move is probably good and the new position is added to the search tree. (~7 Elo)
if (bestValue <= alpha) if (bestValue <= alpha)
ss->ttPv = ss->ttPv || ((ss-1)->ttPv && depth > 3); ss->ttPv = ss->ttPv || ((ss-1)->ttPv && depth > 3);
@ -1432,7 +1432,7 @@ moves_loop: // When in check, search starts here
// qsearch() is the quiescence search function, which is called by the main search // qsearch() is the quiescence search function, which is called by the main search
// function with zero depth, or recursively with further decreasing depth per call. // function with zero depth, or recursively with further decreasing depth per call.
// (~155 elo) // (~155 Elo)
template <NodeType nodeType> template <NodeType nodeType>
Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth) { Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth) {