1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Rewrite of 'Adjust correction history' condition

Current condition is convoluted and hard to understand because of
several negations. Also added 2 comments to make the concept behind the
condition better understandable.

closes https://github.com/official-stockfish/Stockfish/pull/5685

No functional change
This commit is contained in:
Guenther Demetz 2024-11-20 14:48:23 +01:00 committed by Disservin
parent 0282edc0b0
commit d29c8bd5d4

View file

@ -1425,9 +1425,9 @@ moves_loop: // When in check, search starts here
depth, bestMove, unadjustedStaticEval, tt.generation());
// Adjust correction history
if (!ss->inCheck && (!bestMove || !pos.capture(bestMove))
&& !(bestValue >= beta && bestValue <= ss->staticEval)
&& !(!bestMove && bestValue >= ss->staticEval))
if (!ss->inCheck && !(bestMove && pos.capture(bestMove))
&& ((bestValue < ss->staticEval && bestValue < beta) // negative correction & no fail high
|| (bestValue > ss->staticEval && bestMove))) // positive correction & no fail low
{
const auto m = (ss - 1)->currentMove;