Skip to content

Commit

Permalink
Reduce depth after score improvement at PV nodes
Browse files Browse the repository at this point in the history
STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 73760 W: 19590 L: 19244 D: 34926
Ptnml(0-2): 285, 8352, 19292, 8634, 317
https://tests.stockfishchess.org/tests/view/626eb2dc9116b52aa83b73da

LTC:
LLR: 2.93 (-2.94,2.94) <0.50,3.00>
Total: 114400 W: 30561 L: 30111 D: 53728
Ptnml(0-2): 68, 11432, 33785, 11812, 103
https://tests.stockfishchess.org/tests/view/626f730859e9c431e0b10b21

closes #4008

bench: 6174823
  • Loading branch information
snicolet committed May 4, 2022
1 parent a32d208 commit 9eb7b60
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,18 @@ namespace {
update_pv(ss->pv, move, (ss+1)->pv);

if (PvNode && value < beta) // Update alpha! Always alpha < beta
{
alpha = value;

// Reduce other moves if we have found at least one score improvement
if ( depth > 2
&& depth < 7
&& beta < VALUE_KNOWN_WIN
&& alpha > -VALUE_KNOWN_WIN)
depth -= 1;

assert(depth > 0);
}
else
{
ss->cutoffCnt++;
Expand Down

4 comments on commit 9eb7b60

@crossbr
Copy link

@crossbr crossbr commented on 9eb7b60 May 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this patch improving offense more than hurting defense, or is it improving both offensive play and defensive play? In other words, is it helpful for both playing with an advantage and playing with a disadvantage, or only for playing with an advantage?

@vondele
Copy link
Member

@vondele vondele commented on 9eb7b60 May 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think either option can be expected a priori. Did you see anything particular?

@crossbr
Copy link

@crossbr crossbr commented on 9eb7b60 May 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was watching the Depth/SD of SFdev_22020504 as black in Game 6 of the 360'+60" TCEC VVLTC Bonus match, and noticed that searches seem to show less depth in certain parts of the game. See attached screenshot (black line is SF). Might have nothing to do with the patch, but I've never seen SF with this ratio of nodes to depth
DepthChart
.

@snicolet
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Bryan, nice to hear from you :-)
I have tried restricting the idea to only attack or only defense with following two tests. Both tests failed:

https://tests.stockfishchess.org/tests/view/627905ad84890d1785a5993e
https://tests.stockfishchess.org/tests/view/627905a484890d1785a5993b

Please sign in to comment.