1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 01:03:09 +00:00

Remove ss->ttHit condition where ttValue != VALUE_NONE

Simplification is done at 3 separate places in the code.
Thanks to peregrineshahin for helping me find 2 of such places.
(See original PR #4584)

Passed non-regression test
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 120256 W: 32204 L: 32085 D: 55967
Ptnml(0-2): 292, 12473, 34483, 12584, 296
https://tests.stockfishchess.org/tests/view/646f045968661bfd984325e3

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

No functional change
This commit is contained in:
cj5716 2023-05-25 14:34:52 +08:00 committed by Joost VandeVondele
parent cedd73f4aa
commit c701745cf2
2 changed files with 4 additions and 6 deletions

View file

@ -76,6 +76,7 @@ George Sobala (gsobala)
gguliash gguliash
Giacomo Lorenzetti (G-Lorenz) Giacomo Lorenzetti (G-Lorenz)
Gian-Carlo Pascutto (gcp) Gian-Carlo Pascutto (gcp)
Goh CJ (cj5716)
Gontran Lemaire (gonlem) Gontran Lemaire (gonlem)
Goodkov Vasiliy Aleksandrovich (goodkov) Goodkov Vasiliy Aleksandrovich (goodkov)
Gregor Cramer Gregor Cramer

View file

@ -615,10 +615,9 @@ namespace {
// At non-PV nodes we check for an early TT cutoff // At non-PV nodes we check for an early TT cutoff
if ( !PvNode if ( !PvNode
&& ss->ttHit
&& !excludedMove && !excludedMove
&& tte->depth() > depth - (tte->bound() == BOUND_EXACT) && tte->depth() > depth - (tte->bound() == BOUND_EXACT)
&& ttValue != VALUE_NONE // Possible in case of TT access race && ttValue != VALUE_NONE // Possible in case of TT access race or if !ttHit
&& (tte->bound() & (ttValue >= beta ? BOUND_LOWER : BOUND_UPPER))) && (tte->bound() & (ttValue >= beta ? BOUND_LOWER : BOUND_UPPER)))
{ {
// If ttMove is quiet, update move sorting heuristics on TT hit (~2 Elo) // If ttMove is quiet, update move sorting heuristics on TT hit (~2 Elo)
@ -835,8 +834,7 @@ namespace {
// there and in further interactions with transposition table cutoff depth is set to depth - 3 // there and in further interactions with transposition table cutoff depth is set to depth - 3
// because probCut search has depth set to depth - 4 but we also do a move before it // because probCut search has depth set to depth - 4 but we also do a move before it
// so effective depth is equal to depth - 3 // so effective depth is equal to depth - 3
&& !( ss->ttHit && !( tte->depth() >= depth - 3
&& tte->depth() >= depth - 3
&& ttValue != VALUE_NONE && ttValue != VALUE_NONE
&& ttValue < probCutBeta)) && ttValue < probCutBeta))
{ {
@ -1453,9 +1451,8 @@ moves_loop: // When in check, search starts here
// At non-PV nodes we check for an early TT cutoff // At non-PV nodes we check for an early TT cutoff
if ( !PvNode if ( !PvNode
&& ss->ttHit
&& tte->depth() >= ttDepth && tte->depth() >= ttDepth
&& ttValue != VALUE_NONE // Only in case of TT access race && ttValue != VALUE_NONE // Only in case of TT access race or if !ttHit
&& (tte->bound() & (ttValue >= beta ? BOUND_LOWER : BOUND_UPPER))) && (tte->bound() & (ttValue >= beta ? BOUND_LOWER : BOUND_UPPER)))
return ttValue; return ttValue;