mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
Unify do_move & do_null_move workload
While being there also remove and unused assignment. Tested for non-regression at STC: https://tests.stockfishchess.org/tests/view/69060d81ea4b268f1fac1f36 LLR: 2.93 (-2.94,2.94) <-1.75,0.25> Total: 94496 W: 24570 L: 24421 D: 45505 Ptnml(0-2): 264, 10145, 26275, 10306, 258 closes https://github.com/official-stockfish/Stockfish/pull/6383 no functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
84148586e5
commit
4784ff2b3b
+8
-9
@@ -544,7 +544,12 @@ void Search::Worker::do_move(
|
||||
}
|
||||
}
|
||||
|
||||
void Search::Worker::do_null_move(Position& pos, StateInfo& st) { pos.do_null_move(st, tt); }
|
||||
void Search::Worker::do_null_move(Position& pos, StateInfo& st, Stack* const ss) {
|
||||
pos.do_null_move(st, tt);
|
||||
ss->currentMove = Move::null();
|
||||
ss->continuationHistory = &continuationHistory[0][0][NO_PIECE][0];
|
||||
ss->continuationCorrectionHistory = &continuationCorrectionHistory[NO_PIECE][0];
|
||||
}
|
||||
|
||||
void Search::Worker::undo_move(Position& pos, const Move move) {
|
||||
pos.undo_move(move);
|
||||
@@ -868,12 +873,7 @@ Value Search::Worker::search(
|
||||
|
||||
// Null move dynamic reduction based on depth
|
||||
Depth R = 6 + depth / 3 + improving;
|
||||
|
||||
ss->currentMove = Move::null();
|
||||
ss->continuationHistory = &continuationHistory[0][0][NO_PIECE][0];
|
||||
ss->continuationCorrectionHistory = &continuationCorrectionHistory[NO_PIECE][0];
|
||||
|
||||
do_null_move(pos, st);
|
||||
do_null_move(pos, st, ss);
|
||||
|
||||
Value nullValue = -search<NonPV>(pos, ss + 1, -beta, -beta + 1, depth - R, false);
|
||||
|
||||
@@ -1580,8 +1580,7 @@ Value Search::Worker::qsearch(Position& pos, Stack* ss, Value alpha, Value beta)
|
||||
futilityBase = ss->staticEval + 352;
|
||||
}
|
||||
|
||||
const PieceToHistory* contHist[] = {(ss - 1)->continuationHistory,
|
||||
(ss - 2)->continuationHistory};
|
||||
const PieceToHistory* contHist[] = {(ss - 1)->continuationHistory};
|
||||
|
||||
Square prevSq = ((ss - 1)->currentMove).is_ok() ? ((ss - 1)->currentMove).to_sq() : SQ_NONE;
|
||||
|
||||
|
||||
+1
-1
@@ -299,7 +299,7 @@ class Worker {
|
||||
void do_move(Position& pos, const Move move, StateInfo& st, Stack* const ss);
|
||||
void
|
||||
do_move(Position& pos, const Move move, StateInfo& st, const bool givesCheck, Stack* const ss);
|
||||
void do_null_move(Position& pos, StateInfo& st);
|
||||
void do_null_move(Position& pos, StateInfo& st, Stack* const ss);
|
||||
void undo_move(Position& pos, const Move move);
|
||||
void undo_null_move(Position& pos);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user