Joerg Oster wrote:After some first tests, it seems to save time.
Thank you! This is what I suspected!
The reason it saves time is because the new behavior will waste time looking at the other moves whenever they don't beat alpha, plus, Stockfish will have to look at them anyway in the next PV line.
So, I think the fastest approach would be to apply your patch in the all the MultiPV lines, except the last one (in MultiPV=2, only the first one, in MultiPV=3, only the first 2, in MultiPV=4, only the first 3, and so on - this would be consitent with not using the patch in SinglePV, since the only one is the last one), since for the last one Stockfish will not get a chance to look at alternative moves again in a new PV, the last one behaves like in SinglePV.
As far as I am aware, Stockfish has never exhibited the "old behaviour". (If it did in the past, it must have been before 2013.)
Probably.
This is Glaurung 2.1's behavor, and Stockfish comes from its codebase:
[d]rnbqkbnr/ppp1pppp/3p4/8/3PP3/8/PPP2PPP/RNBQKBNR b KQkq -
9 0:05 +0.13 2...f5 3.Nc3 Nf6 4.Bd3 Nc6 5.Nf3 fxe4 6.Nxe4 Be6 (223.961) 42
9 0:05 +0.39 2...Nc6 3.Nc3 Nf6 4.Nf3 d5 5.exd5 Nxd5 6.Bb5 Bf5 7.Bxc6+ bxc6 (223.961) 42
9 0:05 +0.39 2...Nf6 3.Nc3 Nc6 4.Nf3 d5 5.exd5 Nxd5 6.Bb5 Bf5 7.Bxc6+ bxc6 (223.961) 42
9 0:05 +0.84 2...Bd7 3.Nf3 Nc6 4.Bc4 Nf6 5.Ng5 d5 6.exd5 Nb4 (223.961) 42
-----
10 0:06 +0.90 2...f5 3.exf5 Bxf5 4.Bd3 Bxd3 5.Qxd3 c5 6.dxc5 Qa5+ 7.Nc3 Qxc5 8.Nf3 (436.774) 64
9 0:06 +0.39 2...Nc6 3.Nc3 Nf6 4.Nf3 d5 5.exd5 Nxd5 6.Bb5 Bf5 7.Bxc6+ bxc6 (436.774) 64
9 0:06 +0.39 2...Nf6 3.Nc3 Nc6 4.Nf3 d5 5.exd5 Nxd5 6.Bb5 Bf5 7.Bxc6+ bxc6 (436.774) 64
9 0:06 +0.84 2...Bd7 3.Nf3 Nc6 4.Bc4 Nf6 5.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.21 2...Bd7 3.Nf3 Nf6 4.Bd3 Nc6 5.O-O Bg4 6.Be3 e5 7.dxe5 dxe5 (560.748) 80
-----
10 0:07 +0.39 2...Nc6 3.Nc3 Nf6 4.Nf3 d5 5.exd5 Nxd5 6.Bb5 Nxc3 7.Bxc6+ bxc6 8.bxc3 (659.887) 92
10 0:07 +0.39 2...Nf6 3.Nc3 Nc6 4.Nf3 d5 5.exd5 Nxd5 6.Bb5 Nxc3 7.Bxc6+ bxc6 8.bxc3 (659.887) 92
10 0:07 +0.90 2...f5 3.exf5 Bxf5 4.Bd3 Bxd3 5.Qxd3 c5 6.dxc5 Qa5+ 7.Nc3 Qxc5 8.Nf3 (659.887) 92
10 0:07 +1.11 2...g6 3.Nf3 Nf6 4.Bd3 Nc6 5.O-O Bg7 6.Nc3 O-O 7.Bf4 (659.887) 92
-----
10 0:07 +0.39 2...Nc6 3.Nc3 Nf6 4.Nf3 d5 5.exd5 Nxd5 6.Bb5 Nxc3 7.Bxc6+ bxc6 8.bxc3 (766.116) 105
10 0:07 +0.39 2...Nf6 3.Nc3 Nc6 4.Nf3 d5 5.exd5 Nxd5 6.Bb5 Nxc3 7.Bxc6+ bxc6 8.bxc3 (766.116) 105
10 0:07 +0.90 2...f5 3.exf5 Bxf5 4.Bd3 Bxd3 5.Qxd3 c5 6.dxc5 Qa5+ 7.Nc3 Qxc5 8.Nf3 (766.116) 105
10 0:07 +0.92 2...h6 3.Nf3 g5 4.Bb5+ c6 5.Be2 Nf6 6.Nc3 g4 7.Nh4 Be6 (766.116) 105
Please note f5 fails-low, but Glaurung resolves it before checking second best.
It does the same for 2...Bd7 and 2...g6 (in bold), so the user knows the actual score, and can add these moves to their tree:
0.39 2...Nc6
0.39 2...Nf6
0.90 2...f5
0.92 2...h6
1.11 2...Bd7
1.21 2...g6
The new behavior wouldn't have resolved Bd7 or g6 at all, and wouldn't have resolved 2...f5 until Nf6 was resolved, ommiting Bd7 and g6 completely so the user wouldn't have known those moves were interesting (and given "for free").
So, Stockfish changed its behavior at some point between Glaurung and the current version.