mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 12:07:43 +00:00
Do move legality check before pruning.
This alllows to simplify the code because the move counter haven't to be
decremented later if a move isn't legal. As a side effect now illegal
pruned moves doesn't included anymore in move counter. So slightly less
pruning and reductions are done.
STC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 111016 W: 21106 L: 21077 D: 68833
Ptnml(0-2): 1830, 13083, 25736, 12946, 1913
https://tests.stockfishchess.org/tests/view/5f28816fa5abc164f05e4c26
LTC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 39264 W: 4909 L: 4843 D: 29512
Ptnml(0-2): 263, 3601, 11854, 3635, 279
https://tests.stockfishchess.org/tests/view/5f297902a5abc164f05e4c8e
closes https://github.com/official-stockfish/Stockfish/pull/2906
Bench: 4390086
This commit is contained in:
committed by
Joost VandeVondele
parent
7f336dd59b
commit
615d98da24
+4
-7
@@ -986,6 +986,10 @@ moves_loop: // When in check, search starts from here
|
|||||||
thisThread->rootMoves.begin() + thisThread->pvLast, move))
|
thisThread->rootMoves.begin() + thisThread->pvLast, move))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Check for legality
|
||||||
|
if (!rootNode && !pos.legal(move))
|
||||||
|
continue;
|
||||||
|
|
||||||
ss->moveCount = ++moveCount;
|
ss->moveCount = ++moveCount;
|
||||||
|
|
||||||
if (rootNode && thisThread == Threads.main() && Time.elapsed() > 3000)
|
if (rootNode && thisThread == Threads.main() && Time.elapsed() > 3000)
|
||||||
@@ -1137,13 +1141,6 @@ moves_loop: // When in check, search starts from here
|
|||||||
// Speculative prefetch as early as possible
|
// Speculative prefetch as early as possible
|
||||||
prefetch(TT.first_entry(pos.key_after(move)));
|
prefetch(TT.first_entry(pos.key_after(move)));
|
||||||
|
|
||||||
// Check for legality just before making the move
|
|
||||||
if (!rootNode && !pos.legal(move))
|
|
||||||
{
|
|
||||||
ss->moveCount = --moveCount;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the current move (this must be done after singular extension search)
|
// Update the current move (this must be done after singular extension search)
|
||||||
ss->currentMove = move;
|
ss->currentMove = move;
|
||||||
ss->continuationHistory = &thisThread->continuationHistory[ss->inCheck]
|
ss->continuationHistory = &thisThread->continuationHistory[ss->inCheck]
|
||||||
|
|||||||
Reference in New Issue
Block a user