Disable IIR and quiet shallow pruning in PV lines

Disable IIR and quiet shallow pruning in nodes that are part of the PV
line from the previous search iteration. This is done by storing the PV
in Worker and adding a followPV flag to Stack. The new flag may also be
used in other pruning techniques, allowing further improvement.

Passed STC:
```
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 63776 W: 16679 L: 16323 D: 30774
Ptnml(0-2): 169, 7441, 16377, 7667, 234
```
https://tests.stockfishchess.org/tests/view/69aad1a7d0f65de95886e289

Passed LTC:
```
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 87342 W: 22421 L: 22000 D: 42921
Ptnml(0-2): 40, 9443, 24299, 9834, 55
```
https://tests.stockfishchess.org/tests/view/69ab5993cb31ee884aed629d

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

Bench: 2434614
This commit is contained in:
ZlomenyMesic
2026-03-18 20:49:06 +01:00
committed by Disservin
parent b3a810a1c4
commit e20ef7ed12
3 changed files with 15 additions and 3 deletions
+1
View File
@@ -270,6 +270,7 @@ windfishballad
xefoci7612 xefoci7612
Xiang Wang (KatyushaScarlet) Xiang Wang (KatyushaScarlet)
Yen-Chao Shen (lemteay) Yen-Chao Shen (lemteay)
ZlomenyMesic
zz4032 zz4032
# Additionally, we acknowledge the authors and maintainers of fishtest, # Additionally, we acknowledge the authors and maintainers of fishtest,
+11 -3
View File
@@ -182,6 +182,7 @@ void Search::Worker::ensure_network_replicated() {
void Search::Worker::start_searching() { void Search::Worker::start_searching() {
accumulatorStack.reset(); accumulatorStack.reset();
lastIterationPV.clear();
// Non-main threads go directly to iterative_deepening() // Non-main threads go directly to iterative_deepening()
if (!is_mainthread()) if (!is_mainthread())
@@ -438,7 +439,10 @@ void Search::Worker::iterative_deepening() {
} }
if (!threads.stop) if (!threads.stop)
completedDepth = rootDepth; {
completedDepth = rootDepth;
lastIterationPV = rootMoves[0].pv;
}
// We make sure not to pick an unproven mated-in score, // We make sure not to pick an unproven mated-in score,
// in case this thread prematurely stopped search (aborted-search). // in case this thread prematurely stopped search (aborted-search).
@@ -662,6 +666,10 @@ Value Search::Worker::search(
bestValue = -VALUE_INFINITE; bestValue = -VALUE_INFINITE;
maxValue = VALUE_INFINITE; maxValue = VALUE_INFINITE;
ss->followPV = rootNode
|| ((ss - 1)->followPV && static_cast<size_t>(ss->ply - 1) < lastIterationPV.size()
&& (ss - 1)->currentMove == lastIterationPV[ss->ply - 1]);
// Check for the available remaining time // Check for the available remaining time
if (is_mainthread()) if (is_mainthread())
main_manager()->check_time(*this); main_manager()->check_time(*this);
@@ -929,7 +937,7 @@ Value Search::Worker::search(
// Step 10. Internal iterative reductions // Step 10. Internal iterative reductions
// At sufficient depth, reduce depth for PV/Cut nodes without a TTMove. // At sufficient depth, reduce depth for PV/Cut nodes without a TTMove.
// (*Scaler) Making IIR more aggressive scales poorly. // (*Scaler) Making IIR more aggressive scales poorly.
if (!allNode && depth >= 6 && !ttData.move && priorReduction <= 3) if (!ss->followPV && !allNode && depth >= 6 && !ttData.move && priorReduction <= 3)
depth--; depth--;
// Step 11. ProbCut // Step 11. ProbCut
@@ -1079,7 +1087,7 @@ moves_loop: // When in check, search starts here
&& !pos.see_ge(move, -margin)) && !pos.see_ge(move, -margin))
continue; continue;
} }
else else if (!ss->followPV || !PvNode)
{ {
int history = (*contHist[0])[movedPiece][move.to_sq()] int history = (*contHist[0])[movedPiece][move.to_sq()]
+ (*contHist[1])[movedPiece][move.to_sq()] + (*contHist[1])[movedPiece][move.to_sq()]
+3
View File
@@ -74,6 +74,7 @@ struct Stack {
bool inCheck; bool inCheck;
bool ttPv; bool ttPv;
bool ttHit; bool ttHit;
bool followPV;
int cutoffCnt; int cutoffCnt;
int reduction; int reduction;
}; };
@@ -342,6 +343,8 @@ class Worker {
Depth rootDepth, completedDepth; Depth rootDepth, completedDepth;
Value rootDelta; Value rootDelta;
std::vector<Move> lastIterationPV;
size_t threadIdx, numaThreadIdx, numaTotal; size_t threadIdx, numaThreadIdx, numaTotal;
NumaReplicatedAccessToken numaAccessToken; NumaReplicatedAccessToken numaAccessToken;