mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Move Loop Consistency in Probcut
In probcut move loop, everything is enclosed within a large if statement. I've changed it to guard clauses to stay consistent with other move loops. closes https://github.com/official-stockfish/Stockfish/pull/5463 No functional change
This commit is contained in:
parent
b209f14b1e
commit
362a77a345
2 changed files with 46 additions and 38 deletions
1
AUTHORS
1
AUTHORS
|
@ -129,6 +129,7 @@ Kojirion
|
||||||
Krystian Kuzniarek (kuzkry)
|
Krystian Kuzniarek (kuzkry)
|
||||||
Leonardo Ljubičić (ICCF World Champion)
|
Leonardo Ljubičić (ICCF World Champion)
|
||||||
Leonid Pechenik (lp--)
|
Leonid Pechenik (lp--)
|
||||||
|
Li Ying (yl25946)
|
||||||
Liam Keegan (lkeegan)
|
Liam Keegan (lkeegan)
|
||||||
Linmiao Xu (linrock)
|
Linmiao Xu (linrock)
|
||||||
Linus Arver (listx)
|
Linus Arver (listx)
|
||||||
|
|
|
@ -864,8 +864,16 @@ Value Search::Worker::search(
|
||||||
Piece captured;
|
Piece captured;
|
||||||
|
|
||||||
while ((move = mp.next_move()) != Move::none())
|
while ((move = mp.next_move()) != Move::none())
|
||||||
if (move != excludedMove && pos.legal(move))
|
|
||||||
{
|
{
|
||||||
|
assert(move.is_ok());
|
||||||
|
|
||||||
|
if (move == excludedMove)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Check for legality
|
||||||
|
if (!pos.legal(move))
|
||||||
|
continue;
|
||||||
|
|
||||||
assert(pos.capture_stage(move));
|
assert(pos.capture_stage(move));
|
||||||
|
|
||||||
movedPiece = pos.moved_piece(move);
|
movedPiece = pos.moved_piece(move);
|
||||||
|
@ -877,8 +885,7 @@ Value Search::Worker::search(
|
||||||
|
|
||||||
ss->currentMove = move;
|
ss->currentMove = move;
|
||||||
ss->continuationHistory =
|
ss->continuationHistory =
|
||||||
&this
|
&this->continuationHistory[ss->inCheck][true][pos.moved_piece(move)][move.to_sq()];
|
||||||
->continuationHistory[ss->inCheck][true][pos.moved_piece(move)][move.to_sq()];
|
|
||||||
|
|
||||||
thisThread->nodes.fetch_add(1, std::memory_order_relaxed);
|
thisThread->nodes.fetch_add(1, std::memory_order_relaxed);
|
||||||
pos.do_move(move, st);
|
pos.do_move(move, st);
|
||||||
|
@ -888,8 +895,8 @@ Value Search::Worker::search(
|
||||||
|
|
||||||
// If the qsearch held, perform the regular search
|
// If the qsearch held, perform the regular search
|
||||||
if (value >= probCutBeta)
|
if (value >= probCutBeta)
|
||||||
value = -search<NonPV>(pos, ss + 1, -probCutBeta, -probCutBeta + 1, depth - 4,
|
value =
|
||||||
!cutNode);
|
-search<NonPV>(pos, ss + 1, -probCutBeta, -probCutBeta + 1, depth - 4, !cutNode);
|
||||||
|
|
||||||
pos.undo_move(move);
|
pos.undo_move(move);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue