Stockfish search question

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Jouni
Posts: 3324
Joined: Wed Mar 08, 2006 8:15 pm

Stockfish search question

Post by Jouni »

SF16.1. one thread in start position:
...
<< info depth 37 currmove g2g3 currmovenumber 14
<< info depth 37 currmove f2f3 currmovenumber 15
<< info depth 37 currmove g2g4 currmovenumber 16
<< info depth 37 currmove f2f4 currmovenumber 17
<< info depth 37 currmove b1a3 currmovenumber 18
<< info depth 37 currmove g1h3 currmovenumber 19
<< info depth 37 currmove a2a4 currmovenumber 20
<< info depth 37 seldepth 45 multipv 1 score cp 20 upperbound nodes 81710453 nps 685197 hashfull 264 tbhits 0 time 119251 pv d2d4 d7d5
<< info depth 37 currmove d2d4 currmovenumber 1
<< info depth 37 seldepth 50 multipv 1 score cp 22 lowerbound nodes 86923757 nps 686851 hashfull 285 tbhits 0 time 126554 pv d2d4
<< info depth 36 currmove d2d4 currmovenumber 1
<< info depth 37 seldepth 50 multipv 1 score cp 26 lowerbound nodes 90439447 nps 681779 hashfull 295 tbhits 0 time 132652 pv d2d4
<< info depth 35 currmove d2d4 currmovenumber 1
<< info depth 35 currmove e2e4 currmovenumber 2
<< info depth 35 currmove b1c3 currmovenumber 3
<< info depth 35 currmove e2e3 currmovenumber 4
<< info depth 35 currmove g1f3 currmovenumber 5
<< info depth 35 currmove c2c4 currmovenumber 6
...
Why depth goes down from 37 to 35?
Jouni
BeyondCritics
Posts: 406
Joined: Sat May 05, 2012 2:48 pm
Full name: Oliver Roese

Re: Stockfish search question

Post by BeyondCritics »

It can't. My only guess is, that this is a synchronisation failure. What interface are you using and how do you communicate with engine?
Uri Blass
Posts: 10420
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Stockfish search question

Post by Uri Blass »

BeyondCritics wrote: Tue May 07, 2024 11:23 pm It can't. My only guess is, that this is a synchronisation failure. What interface are you using and how do you communicate with engine?
facts are it can reduce the depth.

Here is analysis in console mode when I even did not change the default hash

info depth 34 currmove e2e4 currmovenumber 1
info depth 34 seldepth 43 multipv 1 score cp 28 lowerbound nodes 29359624 nps 735535 hashfull 1000 tbhits 0 time 39916 pv e2e4
info depth 33 currmove e2e4 currmovenumber 1
info depth 34 seldepth 43 multipv 1 score cp 31 lowerbound nodes 30232941 nps 735702 hashfull 1000 tbhits 0 time 41094 pv e2e4
info depth 32 currmove e2e4 currmovenumber 1

I know that there are chess engines that can decide to reduce depth when they fail high because solving the fail high without reduction will take too much time so nothing illogical with it.
BeyondCritics
Posts: 406
Joined: Sat May 05, 2012 2:48 pm
Full name: Oliver Roese

Re: Stockfish search question

Post by BeyondCritics »

Uri Blass wrote: Wed May 08, 2024 12:01 am
BeyondCritics wrote: Tue May 07, 2024 11:23 pm It can't. My only guess is, that this is a synchronisation failure. What interface are you using and how do you communicate with engine?
facts are it can reduce the depth.

Here is analysis in console mode when I even did not change the default hash

info depth 34 currmove e2e4 currmovenumber 1
info depth 34 seldepth 43 multipv 1 score cp 28 lowerbound nodes 29359624 nps 735535 hashfull 1000 tbhits 0 time 39916 pv e2e4
info depth 33 currmove e2e4 currmovenumber 1
info depth 34 seldepth 43 multipv 1 score cp 31 lowerbound nodes 30232941 nps 735702 hashfull 1000 tbhits 0 time 41094 pv e2e4
info depth 32 currmove e2e4 currmovenumber 1

I know that there are chess engines that can decide to reduce depth when they fail high because solving the fail high without reduction will take too much time so nothing illogical with it.
Interesting. So it plays a game and has found a problem in its pv that has to be fixed, but for some reason it decides that it does not have enough time to complete the current iteration with higher depth? In this case, this can not occur in "infinite" mode or am i mistaken? What search mode are we talking about?
Uri Blass
Posts: 10420
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Stockfish search question

Post by Uri Blass »

BeyondCritics wrote: Wed May 08, 2024 12:21 am
Uri Blass wrote: Wed May 08, 2024 12:01 am
BeyondCritics wrote: Tue May 07, 2024 11:23 pm It can't. My only guess is, that this is a synchronisation failure. What interface are you using and how do you communicate with engine?
facts are it can reduce the depth.

Here is analysis in console mode when I even did not change the default hash

info depth 34 currmove e2e4 currmovenumber 1
info depth 34 seldepth 43 multipv 1 score cp 28 lowerbound nodes 29359624 nps 735535 hashfull 1000 tbhits 0 time 39916 pv e2e4
info depth 33 currmove e2e4 currmovenumber 1
info depth 34 seldepth 43 multipv 1 score cp 31 lowerbound nodes 30232941 nps 735702 hashfull 1000 tbhits 0 time 41094 pv e2e4
info depth 32 currmove e2e4 currmovenumber 1

I know that there are chess engines that can decide to reduce depth when they fail high because solving the fail high without reduction will take too much time so nothing illogical with it.
Interesting. So it plays a game and has found a problem in its pv that has to be fixed, but for some reason it decides that it does not have enough time to complete the current iteration with higher depth? In this case, this can not occur in "infinite" mode or am i mistaken? What search mode are we talking about?
I used fixed depth.
Told stockfish16.1 go depth 37 in the opening position and it is part of the input it gives.
Joerg Oster
Posts: 941
Joined: Fri Mar 10, 2006 4:29 pm
Location: Germany
Full name: Jörg Oster

Re: Stockfish search question

Post by Joerg Oster »

BeyondCritics wrote: Wed May 08, 2024 12:21 am
Uri Blass wrote: Wed May 08, 2024 12:01 am
BeyondCritics wrote: Tue May 07, 2024 11:23 pm It can't. My only guess is, that this is a synchronisation failure. What interface are you using and how do you communicate with engine?
facts are it can reduce the depth.

Here is analysis in console mode when I even did not change the default hash

info depth 34 currmove e2e4 currmovenumber 1
info depth 34 seldepth 43 multipv 1 score cp 28 lowerbound nodes 29359624 nps 735535 hashfull 1000 tbhits 0 time 39916 pv e2e4
info depth 33 currmove e2e4 currmovenumber 1
info depth 34 seldepth 43 multipv 1 score cp 31 lowerbound nodes 30232941 nps 735702 hashfull 1000 tbhits 0 time 41094 pv e2e4
info depth 32 currmove e2e4 currmovenumber 1

I know that there are chess engines that can decide to reduce depth when they fail high because solving the fail high without reduction will take too much time so nothing illogical with it.
Interesting. So it plays a game and has found a problem in its pv that has to be fixed, but for some reason it decides that it does not have enough time to complete the current iteration with higher depth? In this case, this can not occur in "infinite" mode or am i mistaken? What search mode are we talking about?
This happens in all search modes.
Whenever there is a fail-high at the root, the nominal search depth gets reduced.
It's possible that you will see many consecutive decreases in a row.

Of course, one could argue to NOT output this reduced depth but still show the original search depth instead.
Jörg Oster
Viz
Posts: 95
Joined: Tue Apr 09, 2024 6:24 am
Full name: Michael Chaly

Re: Stockfish search question

Post by Viz »

Search depth reduces after a fail high, this is it. It gains some elo compared to not doing so.
Jouni
Posts: 3324
Joined: Wed Mar 08, 2006 8:15 pm

Re: Stockfish search question

Post by Jouni »

I noticed this in console mode. In Fritz GUI it's hidden:

Analysis by Stockfish 16.1

1.d4 d5 2.c4 dxc4
= (0.28) Depth: 7/8 00:00:00 2kN
1.d4 d5 2.c4 e6 3.cxd5 exd5
= (0.27) Depth: 8/8 00:00:00 3kN
1.d4 Nf6 2.c4 e6 3.e3
+/= (0.34) Depth: 9/13 00:00:00 6kN
1.d4 d5 2.e3 Nf6 3.c4 e6 4.Nf3 Be7 5.Nc3
+/= (0.31) Depth: 10/13 00:00:00 7kN
1.e4 c5 2.Nf3 e6 3.Nc3
+/= (0.41) Depth: 11/18 00:00:00 23kN
1.e4 c5 2.Nf3 Nc6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 d6 6.Be3 e5
+/= (0.42) Depth: 12/18 00:00:00 28kN
1.e4 c5 2.Nf3 Nc6 3.d4 cxd4 4.Nxd4 e6 5.Be3 Nf6
+/= (0.39) Depth: 13/18 00:00:00 32kN
1.e4 c5 2.Nf3 g6 3.Nc3 Nc6 4.d4 cxd4 5.Nxd4 Nf6 6.Be3 Bg7 7.Nxc6 bxc6 8.e5
+/= (0.39) Depth: 14/24 00:00:00 48kN
1.e4 c5 2.Nf3 Nc6 3.d4 cxd4 4.Nxd4 g6 5.Nc3 Bg7 6.Be3 Nf6 7.Nxc6 bxc6 8.e5 Ng8 9.f4 d5 10.Be2 Nh6 11.Qd2 f6 12.exf6 Bxf6
+/= (0.31) Depth: 15/25 00:00:00 90kN
1.e4 c5 2.Nf3 Nc6 3.Nc3 e6 4.d4 c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.Nf3 dxc4 5.a4 Bf5 6.e3 e6 7.Bxc4 Bb4 8.0-0 Nbd7 9.Qe2 0-0 10.e4 Bg6 11.e5 Nd5
= (0.30) Depth: 24/31 00:00:03 2339kN
1.d4
+/= (0.32 ++) Depth: 25/31 00:00:03 2507kN
1.d4 d5
= (0.27 --) Depth: 25/35 00:00:03 2804kN
1.d4
= (0.30 ++) Depth: 25/37 00:00:04 2908kN
1.d4 d5 2.c4 e6 3.Nf3 dxc4 4.Qa4+ Bd7 5.Qxc4 Bc6 6.Nc3 Nf6 7.Bg5 Be7 8.Ne5 0-0 9.e3 Bd5 10.Qa4 c6
+/= (0.33) Depth: 25/37 00:00:04 3372kN
1.d4 d5 2.c4 e6 3.Nf3 Nf6 4.g3 Be7 5.Bg2 0-0 6.0-0 dxc4 7.Ne5 Nc6 8.Bxc6 bxc6 9.Nxc6 Qe8 10.Nxe7+ Qxe7 11.Qa4 a5 12.Qc6
+/= (0.34) Depth: 26/34 00:00:05 3923kN
1.d4 d5
= (0.30 --) Depth: 27/33 00:00:05 4229kN
1.d4 d5
= (0.28 --) Depth: 27/33 00:00:06 4486kN
1.d4 d5
= (0.24 --) Depth: 27/34 00:00:09 6947kN
1.d4
= (0.27 ++) Depth: 27/39 00:00:10 7848kN
1.d4 d5 2.c4 e6 3.Nc3 Nf6 4.cxd5 Nxd5 5.Nf3 c5 6.e4 Nxc3 7.bxc3 cxd4 8.cxd4 Bb4+ 9.Bd2 Bxd2+ 10.Qxd2 0-0 11.Bc4 b6 12.0-0 Ba6 13.Rac1 Bxc4 14.Rxc4
+/= (0.32) Depth: 27/41 00:00:11 8539kN
1.d4 d5
= (0.28 --) Depth: 28/31 00:00:12 8786kN
1.d4 d5
= (0.25 --) Depth: 28/36 00:00:12 9084kN
1.d4 d5 2.c4 e6 3.Nf3 Nf6 4.g3 Be7 5.Bg2 0-0 6.0-0 dxc4 7.Ne5 Nc6 8.Bxc6 bxc6 9.Nxc6 Qe8 10.Nxe7+ Qxe7 11.Qa4 a5 12.Nc3 h6 13.f3 Nd5 14.Qxc4 Ba6
= (0.26) Depth: 28/38 00:00:13 9708kN
1.d4 d5 2.c4 e6 3.Nf3 Nf6 4.g3 Be7 5.Bg2 0-0 6.0-0 dxc4 7.Ne5 Nc6 8.Bxc6 bxc6 9.Nxc6 Qe8 10.Nxe7+ Qxe7 11.Qa4 a5 12.Nc3 h6 13.Re1 Qb4 14.a3 Qb6 15.Qxc4 Rd8
= (0.24) Depth: 29/40 00:00:14 10190kN
1.d4
= (0.27 ++) Depth: 30/42 00:00:15 11137kN
1.d4
= (0.30 ++) Depth: 30/42 00:00:15 11390kN
1.d4 d5 2.c4 c6 3.Nf3 Nf6 4.Nc3 dxc4 5.a4 Bf5 6.e3 e6 7.Bxc4 Bb4 8.0-0 Nbd7 9.Qe2 0-0 10.e4 Bg6 11.Bd3 Bh5 12.e5 Nd5 13.Nxd5 cxd5 14.h3 Rc8 15.Rd1
= (0.28) Depth: 30/42 00:00:16 11901kN
1.e4
= (0.30 ++) Depth: 31/37 00:00:19 14365kN
1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.0-0 Nxe4 6.d4 b5 7.Bb3 d5 8.dxe5 Be6 9.c3 Be7 10.Be3 0-0 11.Re1 Nc5 12.Bxc5 Bxc5 13.Nbd2 Bb6 14.Nf1
= (0.29) Depth: 31/39 00:00:22 16197kN
1.e4 e5
= (0.26 --) Depth: 32/31 00:00:24 17804kN
1.d4
= (0.29 ++) Depth: 32/39 00:00:27 19810kN
1.d4
+/= (0.32 ++) Depth: 32/39 00:00:31 22616kN
1.d4 d5 2.c4 c6 3.Nf3 Nf6 4.Nc3 dxc4 5.a4 Bf5 6.e3 e6 7.Bxc4 Bb4 8.0-0 0-0 9.Qe2 Nbd7 10.e4 Bg6 11.Bd3 Bh5 12.e5 Nd5 13.Bd2 Nc7 14.a5 c5 15.Ra4 Bxc3 16.bxc3 b5 17.axb6 Nxb6
+/= (0.32) Depth: 32/40 00:00:31 22752kN
1.d4 d5
= (0.29 --) Depth: 33/46 00:00:32 23752kN
1.d4 d5
= (0.26 --) Depth: 33/46 00:00:34 25048kN
1.d4
= (0.29 ++) Depth: 33/46 00:00:36 26249kN
1.d4 d5 2.c4 e6 3.Nf3 dxc4 4.Qa4+ Nd7 5.e4 c5 6.Bxc4 cxd4 7.Nxd4 Ngf6 8.Nc3 Bc5 9.Nb3 0-0 10.Be2 Bb6 11.Bf4 Qe7 12.Bg3
= (0.26) Depth: 33/46 00:00:43 30913kN
1.d4 d5
= (0.24 --) Depth: 34/40 00:00:48 34516kN
1.d4
= (0.26 ++) Depth: 34/41 00:00:51 37172kN
1.d4 d5 2.c4 e6 3.Nf3 dxc4 4.e4 b5 5.a4 c6 6.axb5 cxb5 7.b3 Nf6 8.bxc4 bxc4 9.Bxc4 Be7 10.Nc3 0-0 11.0-0 a5 12.d5 Bb4 13.Bb2 Ba6 14.Nb5 Bxb5 15.Bxb5 exd5 16.exd5 Qxd5
= (0.22) Depth: 34/46 00:00:55 39614kN
1.d4 d5
= (0.21 --) Depth: 35/45 00:01:06 47373kN
1.d4
= (0.23 ++) Depth: 35/45 00:01:09 49426kN
1.d4 d5
= (0.18 --) Depth: 35/47 00:01:14 53138kN
1.d4
= (0.22 ++) Depth: 35/47 00:01:23 60077kN
1.d4 d5 2.c4 e6 3.Nc3 Nf6 4.Nf3 Be7 5.Bf4 0-0 6.e3 b6 7.cxd5 Nxd5 8.Nxd5 Qxd5 9.a3 Ba6 10.Bxa6 Nxa6 11.b4 Nb8 12.Qd3 Qb7 13.0-0 Nd7 14.h4 Bd6 15.Bxd6 cxd6 16.Rfc1
= (0.25) Depth: 35/51 00:01:40 71666kN
1.d4 d5
= (0.21 --) Depth: 36/45 00:01:47 76447kN
1.d4 d5 2.c4 e6 3.Nc3 Nf6 4.Nf3 Be7 5.Bf4 0-0 6.e3 b6 7.Be2 dxc4 8.Bxc4 Bb7 9.0-0 a6 10.Qe2 b5 11.Bd3 Nbd7 12.Rfd1 Rc8 13.e4 c5 14.dxc5 Nxc5 15.Bxb5 Qa5 16.Bc4 Ncxe4 17.Nxe4 Nxe4 18.Bd3
= (0.23) Depth: 36/47 00:01:50 79011kN
1.d4 d5
= (0.20 --) Depth: 37/45 00:01:54 81710kN
1.d4
= (0.22 ++) Depth: 37/50 00:02:01 86924kN
1.d4
= (0.26 ++) Depth: 37/50 00:02:06 90439kN
1.d4 d5 2.c4 e6 3.Nc3 Nf6 4.Nf3 Bb4 5.Bg5 h6 6.Bxf6 Qxf6 7.Qa4+ Nc6 8.e3 0-0 9.Be2 dxc4 10.0-0 Bd7 11.Bxc4 Bd6 12.Qc2 e5 13.Nd5 Qd8 14.Nxe5 Nxe5 15.dxe5 Bxe5 16.Rad1 Bd6 17.Rd2 a5 18.Rfd1
= (0.27) Depth: 37/50 00:02:08 92516kN
1.d4 d5
= (0.23 --) Depth: 38/45 00:02:16 97799kN
1.d4 d5
= (0.21 --) Depth: 38/51 00:02:22 102mN

BTW in quick test Caissa has same feature, but Berserk not?
Jouni
petero2
Posts: 697
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: Stockfish search question

Post by petero2 »

Jouni wrote: Tue May 07, 2024 9:45 pm SF16.1. one thread in start position:
...
<< info depth 37 seldepth 50 multipv 1 score cp 26 lowerbound nodes 90439447 nps 681779 hashfull 295 tbhits 0 time 132652 pv d2d4
<< info depth 35 currmove d2d4 currmovenumber 1
...
Why depth goes down from 37 to 35?
I think it is an idea from Houdini 3, see this thead from 2012. It is possible that some engine did this even earlier though.