Stockfish already is doing it exactly the way Marco Belli described.Ovyron wrote:It's because MultiPV is meant to be used for analysis.syzygy wrote:I'm not entirely sure why you are referring to MultiPV here. In MultiPV you do end up with final scores of the best N moves. (I may not have read what you wrote carefully enough though.)

In analysis, the user would have some tree stored somewhere with backsolved scores of positions.

The old behavior allowed the user to insert into their tree the scores of the most interesting moves, even if they exceeded the MultiPV limit. They were given to the user "for free." Now if the user wants to know actual scores of those moves he'd need to make them on the board or rely on go searchmoves to exclude the moves already analyzed from the search.

Here's an example of the old behavior. Let's say that the user analyzes with MultiPV=4 and to depth 28.

At depth 27 (I'm using letters for the moves):

A. 0.29

B. 0.25

C. 0.19

D. 0.10

Now, it starts depth 28.

A has a score of 0.28.

B falls down to a score of 0.07

C falls down to a score of 0.06

D falls down to a score of 0.00

Now, and only now, the engine examines other moves.

E has a score of 0.11

F has a score of 0.09

G has a score of 0.08

The Shredder Classic GUI (up to version 3) has a feature "Continuous Display", that allows the user to see what happened in all the iterations of MultiPV.

The user can add this to the tree:

A. 0.28

E. 0.11

F. 0.09

G. 0.08

B. 0.07

C. 0.06

D. 0.00

That's 7 moves for the price of 4.

With the current behavior:

At depth 27:

A. 0.29

B. 0.25

C. 0.19

D. 0.10

Now, it starts depth 28.

A has a score of 0.28.

B fails low, Stockfish returns E with a score of 0.11

C fails low, Stockfish returns F with a score of 0.09

D fails low, Stockfish returns G with a score of 0.08

The user is left scratching his head, not knowing what happened to B, C, or D (making Stockfish show fail lows doesn't help because those scores aren't safe to add to the tree.) To get those scores, the user would need MultiPV=7, but switching to it now is more costly than old behavior, and the user doesn't know when this is going to happen, so it can't use 7 from the start.

The user can only add this to the tree:

A. 0.28

E. 0.11

F. 0.09

G. 0.08

Now, suppose the user interacts with the positions until A, E, F and G are refuted to a score of <0.08.

In the old bevahior, the user can jump already to B, which is now the best move. With the current behavior, the user has to take means to get a 5th alternative.

What code would need to be changed so that the engine behaves like in Marco Belli's post in Fail Lows?

elcabesa wrote:Stocksfish search the first best result and you'll see the counter going from 1 to 30,

then it search the second best move and you'll see the counter going from 2 to 30,

then it search the third best move and you'll see the counter going from 3 to 30,

and so on ....

See MultiPV=5 output of iteration 20 for the start position.

- info depth 19 seldepth 28 multipv 1 score cp 53 nodes 7852604 nps 1328922 hashfull 101 tbhits 0 time 5909 pv e2e4 e7e6 d2d4 d7d5 e4d5 e6d5 g1f3 g8f6 f1d3 b8c6 e1g1 f8e7 b1c3 e8g8 c1f4 c6b4 a2a3 b4d3 d1d3 e7d6 f4d6

info depth 19 seldepth 24 multipv 2 score cp 39 nodes 7852604 nps 1328922 hashfull 101 tbhits 0 time 5909 pv e2e3 e7e6 d2d4 f8e7 c2c4 g8f6 g1f3 e8g8 f1d3 d7d5 e1g1 c7c5 d4c5 e7c5 a2a3 d5c4 d3c4 b8c6 c4d3 e6e5 b1c3

info depth 19 seldepth 30 multipv 3 score cp 37 nodes 7852604 nps 1328922 hashfull 101 tbhits 0 time 5909 pv d2d4 g8f6 c1f4 e7e6 g1f3 d7d5 e2e3 c7c5 f1e2 c5d4 e3d4 f8d6 f4d6 d8d6 e1g1 e8g8 c2c3 c8d7 b1d2 b8c6 f1e1

info depth 19 seldepth 25 multipv 4 score cp 37 nodes 7852604 nps 1328922 hashfull 101 tbhits 0 time 5909 pv g1f3 d7d5 d2d4 e7e6 e2e3 g8f6 c2c4 f8e7 b1c3 e8g8 f1e2 c7c5 d4c5 b8c6 c4d5 f6d5 c1d2 d5c3 d2c3

info depth 19 seldepth 26 multipv 5 score cp 15 nodes 7852604 nps 1328922 hashfull 101 tbhits 0 time 5909 pv b1c3 d7d5 d2d4 g8f6 c1f4 e7e6 e2e3 f8b4 g1e2 e8g8 a2a3 b4d6 f4d6 d8d6 e2f4 c8d7 f1e2 d6b6 a1b1 c7c5

info depth 20 currmove e2e4 currmovenumber 1

info depth 20 currmove b1c3 currmovenumber 2

info depth 20 currmove e2e3 currmovenumber 3

info depth 20 currmove c2c3 currmovenumber 4

info depth 20 currmove d2d4 currmovenumber 5

info depth 20 currmove c2c4 currmovenumber 6

info depth 20 currmove a2a3 currmovenumber 7

info depth 20 currmove b2b4 currmovenumber 8

info depth 20 currmove d2d3 currmovenumber 9

info depth 20 currmove h2h3 currmovenumber 10

info depth 20 currmove g1f3 currmovenumber 11

info depth 20 currmove f2f3 currmovenumber 12

info depth 20 currmove h2h4 currmovenumber 13

info depth 20 currmove g2g4 currmovenumber 14

info depth 20 currmove f2f4 currmovenumber 15

info depth 20 currmove b2b3 currmovenumber 16

info depth 20 currmove b1a3 currmovenumber 17

info depth 20 currmove g2g3 currmovenumber 18

info depth 20 currmove a2a4 currmovenumber 19

info depth 20 currmove g1h3 currmovenumber 20

info depth 20 currmove e2e4 currmovenumber 1

info depth 20 currmove b1c3 currmovenumber 2

info depth 20 currmove e2e3 currmovenumber 3

info depth 20 currmove c2c3 currmovenumber 4

info depth 20 currmove d2d3 currmovenumber 5

info depth 20 currmove g1f3 currmovenumber 6

info depth 20 currmove d2d4 currmovenumber 7

info depth 20 currmove a2a3 currmovenumber 8

info depth 20 currmove f2f3 currmovenumber 9

info depth 20 currmove f2f4 currmovenumber 10

info depth 20 currmove h2h3 currmovenumber 11

info depth 20 currmove g2g3 currmovenumber 12

info depth 20 currmove h2h4 currmovenumber 13

info depth 20 currmove b2b4 currmovenumber 14

info depth 20 currmove b2b3 currmovenumber 15

info depth 20 currmove g1h3 currmovenumber 16

info depth 20 currmove a2a4 currmovenumber 17

info depth 20 currmove c2c4 currmovenumber 18

info depth 20 currmove g2g4 currmovenumber 19

info depth 20 currmove b1a3 currmovenumber 20

info depth 20 seldepth 29 multipv 1 score cp 45 nodes 8867315 nps 1323677 hashfull 120 tbhits 0 time 6699 pv e2e4 e7e6 d2d4 d7d5 e4d5 e6d5 g1f3 g8f6 f1d3 f8d6 e1g1 e8g8 b1c3 b8c6 c1g5 c6b4 c3b5 h7h6 g5f6 d8f6 b5d6 f6d6 f3e5 d6b6

info depth 19 seldepth 24 multipv 2 score cp 39 nodes 8867315 nps 1323677 hashfull 120 tbhits 0 time 6699 pv e2e3 e7e6 d2d4 f8e7 c2c4 g8f6 g1f3 e8g8 f1d3 d7d5 e1g1 c7c5 d4c5 e7c5 a2a3 d5c4 d3c4 b8c6 c4d3 e6e5 b1c3

info depth 19 seldepth 30 multipv 3 score cp 37 nodes 8867315 nps 1323677 hashfull 120 tbhits 0 time 6699 pv d2d4 g8f6 c1f4 e7e6 g1f3 d7d5 e2e3 c7c5 f1e2 c5d4 e3d4 f8d6 f4d6 d8d6 e1g1 e8g8 c2c3 c8d7 b1d2 b8c6 f1e1

info depth 19 seldepth 25 multipv 4 score cp 37 nodes 8867315 nps 1323677 hashfull 120 tbhits 0 time 6699 pv g1f3 d7d5 d2d4 e7e6 e2e3 g8f6 c2c4 f8e7 b1c3 e8g8 f1e2 c7c5 d4c5 b8c6 c4d5 f6d5 c1d2 d5c3 d2c3

info depth 19 seldepth 26 multipv 5 score cp 15 nodes 8867315 nps 1323677 hashfull 120 tbhits 0 time 6699 pv b1c3 d7d5 d2d4 g8f6 c1f4 e7e6 e2e3 f8b4 g1e2 e8g8 a2a3 b4d6 f4d6 d8d6 e2f4 c8d7 f1e2 d6b6 a1b1 c7c5

info depth 20 currmove e2e3 currmovenumber 2

info depth 20 currmove b1c3 currmovenumber 3

info depth 20 currmove d2d4 currmovenumber 4

info depth 20 currmove g1f3 currmovenumber 5

info depth 20 currmove c2c4 currmovenumber 6

info depth 20 currmove c2c3 currmovenumber 7

info depth 20 currmove b2b4 currmovenumber 8

info depth 20 currmove a2a3 currmovenumber 9

info depth 20 currmove h2h3 currmovenumber 10

info depth 20 currmove b2b3 currmovenumber 11

info depth 20 currmove f2f3 currmovenumber 12

info depth 20 currmove d2d3 currmovenumber 13

info depth 20 currmove g2g3 currmovenumber 14

info depth 20 currmove f2f4 currmovenumber 15

info depth 20 currmove g1h3 currmovenumber 16

info depth 20 currmove b1a3 currmovenumber 17

info depth 20 currmove h2h4 currmovenumber 18

info depth 20 currmove a2a4 currmovenumber 19

info depth 20 currmove g2g4 currmovenumber 20

info depth 20 seldepth 29 multipv 1 score cp 45 nodes 10227970 nps 1318377 hashfull 142 tbhits 0 time 7758 pv e2e4 e7e6 d2d4 d7d5 e4d5 e6d5 g1f3 g8f6 f1d3 f8d6 e1g1 e8g8 b1c3 b8c6 c1g5 c6b4 c3b5 h7h6 g5f6 d8f6 b5d6 f6d6 f3e5 d6b6

info depth 20 seldepth 25 multipv 2 score cp 34 nodes 10227970 nps 1318377 hashfull 142 tbhits 0 time 7758 pv e2e3 e7e6 d2d4 f8e7 c2c4 g8f6 g1f3 d7d5 b1c3 e8g8 f1e2 c7c5 c4d5 c5d4 e3d4 f6d5 e1g1 b8c6 e2d3 d5b4 d3b1

info depth 19 seldepth 30 multipv 3 score cp 37 nodes 10227970 nps 1318377 hashfull 142 tbhits 0 time 7758 pv d2d4 g8f6 c1f4 e7e6 g1f3 d7d5 e2e3 c7c5 f1e2 c5d4 e3d4 f8d6 f4d6 d8d6 e1g1 e8g8 c2c3 c8d7 b1d2 b8c6 f1e1

info depth 19 seldepth 25 multipv 4 score cp 37 nodes 10227970 nps 1318377 hashfull 142 tbhits 0 time 7758 pv g1f3 d7d5 d2d4 e7e6 e2e3 g8f6 c2c4 f8e7 b1c3 e8g8 f1e2 c7c5 d4c5 b8c6 c4d5 f6d5 c1d2 d5c3 d2c3

info depth 19 seldepth 26 multipv 5 score cp 15 nodes 10227970 nps 1318377 hashfull 142 tbhits 0 time 7758 pv b1c3 d7d5 d2d4 g8f6 c1f4 e7e6 e2e3 f8b4 g1e2 e8g8 a2a3 b4d6 f4d6 d8d6 e2f4 c8d7 f1e2 d6b6 a1b1 c7c5

info depth 20 currmove d2d4 currmovenumber 3

info depth 20 currmove d2d4 currmovenumber 3

info depth 20 currmove g1f3 currmovenumber 4

info depth 20 currmove c2c4 currmovenumber 5

info depth 20 currmove b1c3 currmovenumber 6

info depth 20 currmove h2h3 currmovenumber 7

info depth 20 currmove a2a3 currmovenumber 8

info depth 20 currmove c2c3 currmovenumber 9

info depth 20 currmove b2b3 currmovenumber 10

info depth 20 currmove d2d3 currmovenumber 11

info depth 20 currmove b1a3 currmovenumber 12

info depth 20 currmove b2b4 currmovenumber 13

info depth 20 currmove f2f3 currmovenumber 14

info depth 20 currmove g2g3 currmovenumber 15

info depth 20 currmove a2a4 currmovenumber 16

info depth 20 currmove f2f4 currmovenumber 17

info depth 20 currmove g2g4 currmovenumber 18

info depth 20 currmove h2h4 currmovenumber 19

info depth 20 currmove g1h3 currmovenumber 20

info depth 20 seldepth 29 multipv 1 score cp 45 nodes 11349334 nps 1317239 hashfull 155 tbhits 0 time 8616 pv e2e4 e7e6 d2d4 d7d5 e4d5 e6d5 g1f3 g8f6 f1d3 f8d6 e1g1 e8g8 b1c3 b8c6 c1g5 c6b4 c3b5 h7h6 g5f6 d8f6 b5d6 f6d6 f3e5 d6b6

info depth 20 seldepth 25 multipv 2 score cp 34 nodes 11349334 nps 1317239 hashfull 155 tbhits 0 time 8616 pv e2e3 e7e6 d2d4 f8e7 c2c4 g8f6 g1f3 d7d5 b1c3 e8g8 f1e2 c7c5 c4d5 c5d4 e3d4 f6d5 e1g1 b8c6 e2d3 d5b4 d3b1

info depth 20 seldepth 28 multipv 3 score cp 32 nodes 11349334 nps 1317239 hashfull 155 tbhits 0 time 8616 pv d2d4 d7d5 e2e3 g8f6 g1f3 e7e6 f1e2 c7c5 e1g1 b8c6 c2c4 f8e7 d4c5 e8g8 b1c3 e7c5 c4d5 e6d5 a2a3 c5b6 c3a4 b6a5

info depth 19 seldepth 25 multipv 4 score cp 37 nodes 11349334 nps 1317239 hashfull 155 tbhits 0 time 8616 pv g1f3 d7d5 d2d4 e7e6 e2e3 g8f6 c2c4 f8e7 b1c3 e8g8 f1e2 c7c5 d4c5 b8c6 c4d5 f6d5 c1d2 d5c3 d2c3

info depth 19 seldepth 26 multipv 5 score cp 15 nodes 11349334 nps 1317239 hashfull 155 tbhits 0 time 8616 pv b1c3 d7d5 d2d4 g8f6 c1f4 e7e6 e2e3 f8b4 g1e2 e8g8 a2a3 b4d6 f4d6 d8d6 e2f4 c8d7 f1e2 d6b6 a1b1 c7c5

info depth 20 currmove g1f3 currmovenumber 4

info depth 20 currmove b1c3 currmovenumber 5

info depth 20 currmove c2c3 currmovenumber 6

info depth 20 currmove d2d3 currmovenumber 7

info depth 20 currmove c2c4 currmovenumber 8

info depth 20 currmove a2a3 currmovenumber 9

info depth 20 currmove b2b3 currmovenumber 10

info depth 20 currmove h2h3 currmovenumber 11

info depth 20 currmove b2b4 currmovenumber 12

info depth 20 currmove b1a3 currmovenumber 13

info depth 20 currmove f2f4 currmovenumber 14

info depth 20 currmove f2f3 currmovenumber 15

info depth 20 currmove g2g3 currmovenumber 16

info depth 20 currmove a2a4 currmovenumber 17

info depth 20 currmove g2g4 currmovenumber 18

info depth 20 currmove h2h4 currmovenumber 19

info depth 20 currmove g1h3 currmovenumber 20

info depth 20 currmove g1f3 currmovenumber 4

info depth 20 currmove b1c3 currmovenumber 5

info depth 20 currmove c2c4 currmovenumber 6

info depth 20 currmove c2c3 currmovenumber 7

info depth 20 currmove f2f3 currmovenumber 8

info depth 20 currmove f2f4 currmovenumber 9

info depth 20 currmove d2d3 currmovenumber 10

info depth 20 currmove a2a3 currmovenumber 11

info depth 20 currmove h2h3 currmovenumber 12

info depth 20 currmove b2b3 currmovenumber 13

info depth 20 currmove g2g4 currmovenumber 14

info depth 20 currmove b2b4 currmovenumber 15

info depth 20 currmove a2a4 currmovenumber 16

info depth 20 currmove h2h4 currmovenumber 17

info depth 20 currmove g2g3 currmovenumber 18

info depth 20 currmove b1a3 currmovenumber 19

info depth 20 currmove g1h3 currmovenumber 20

info depth 20 seldepth 29 multipv 1 score cp 45 nodes 12212620 nps 1316015 hashfull 167 tbhits 0 time 9280 pv e2e4 e7e6 d2d4 d7d5 e4d5 e6d5 g1f3 g8f6 f1d3 f8d6 e1g1 e8g8 b1c3 b8c6 c1g5 c6b4 c3b5 h7h6 g5f6 d8f6 b5d6 f6d6 f3e5 d6b6

info depth 20 seldepth 28 multipv 2 score cp 35 nodes 12212620 nps 1316015 hashfull 167 tbhits 0 time 9280 pv g1f3 d7d5 e2e3 c7c5 d2d4 g8f6 c2c4 c5d4 c4d5 d4e3 c1e3 f6d5 b1c3 d5e3 d1d8 e8d8 f2e3 b8c6 a1d1 d8c7 f1c4 e7e6 e1g1 f8b4 c3b5 c7b6

info depth 20 seldepth 25 multipv 3 score cp 34 nodes 12212620 nps 1316015 hashfull 167 tbhits 0 time 9280 pv e2e3 e7e6 d2d4 f8e7 c2c4 g8f6 g1f3 d7d5 b1c3 e8g8 f1e2 c7c5 c4d5 c5d4 e3d4 f6d5 e1g1 b8c6 e2d3 d5b4 d3b1

info depth 20 seldepth 28 multipv 4 score cp 32 nodes 12212620 nps 1316015 hashfull 167 tbhits 0 time 9280 pv d2d4 d7d5 e2e3 g8f6 g1f3 e7e6 f1e2 c7c5 e1g1 b8c6 c2c4 f8e7 d4c5 e8g8 b1c3 e7c5 c4d5 e6d5 a2a3 c5b6 c3a4 b6a5

info depth 19 seldepth 26 multipv 5 score cp 15 nodes 12212620 nps 1316015 hashfull 167 tbhits 0 time 9280 pv b1c3 d7d5 d2d4 g8f6 c1f4 e7e6 e2e3 f8b4 g1e2 e8g8 a2a3 b4d6 f4d6 d8d6 e2f4 c8d7 f1e2 d6b6 a1b1 c7c5

info depth 20 currmove b1c3 currmovenumber 5

info depth 20 currmove a2a3 currmovenumber 6

info depth 20 currmove c2c3 currmovenumber 7

info depth 20 currmove d2d3 currmovenumber 8

info depth 20 currmove c2c4 currmovenumber 9

info depth 20 currmove f2f3 currmovenumber 10

info depth 20 currmove b2b4 currmovenumber 11

info depth 20 currmove g2g3 currmovenumber 12

info depth 20 currmove h2h3 currmovenumber 13

info depth 20 currmove b2b3 currmovenumber 14

info depth 20 currmove f2f4 currmovenumber 15

info depth 20 currmove b1a3 currmovenumber 16

info depth 20 currmove g2g4 currmovenumber 17

info depth 20 currmove h2h4 currmovenumber 18

info depth 20 currmove a2a4 currmovenumber 19

info depth 20 currmove g1h3 currmovenumber 20

info depth 20 seldepth 29 multipv 1 score cp 45 nodes 12488997 nps 1316016 hashfull 172 tbhits 0 time 9490 pv e2e4 e7e6 d2d4 d7d5 e4d5 e6d5 g1f3 g8f6 f1d3 f8d6 e1g1 e8g8 b1c3 b8c6 c1g5 c6b4 c3b5 h7h6 g5f6 d8f6 b5d6 f6d6 f3e5 d6b6

info depth 20 seldepth 28 multipv 2 score cp 35 nodes 12488997 nps 1316016 hashfull 172 tbhits 0 time 9490 pv g1f3 d7d5 e2e3 c7c5 d2d4 g8f6 c2c4 c5d4 c4d5 d4e3 c1e3 f6d5 b1c3 d5e3 d1d8 e8d8 f2e3 b8c6 a1d1 d8c7 f1c4 e7e6 e1g1 f8b4 c3b5 c7b6

info depth 20 seldepth 25 multipv 3 score cp 34 nodes 12488997 nps 1316016 hashfull 172 tbhits 0 time 9490 pv e2e3 e7e6 d2d4 f8e7 c2c4 g8f6 g1f3 d7d5 b1c3 e8g8 f1e2 c7c5 c4d5 c5d4 e3d4 f6d5 e1g1 b8c6 e2d3 d5b4 d3b1

info depth 20 seldepth 28 multipv 4 score cp 32 nodes 12488997 nps 1316016 hashfull 172 tbhits 0 time 9490 pv d2d4 d7d5 e2e3 g8f6 g1f3 e7e6 f1e2 c7c5 e1g1 b8c6 c2c4 f8e7 d4c5 e8g8 b1c3 e7c5 c4d5 e6d5 a2a3 c5b6 c3a4 b6a5

info depth 20 seldepth 22 multipv 5 score cp 16 nodes 12488997 nps 1316016 hashfull 172 tbhits 0 time 9490 pv b1c3 d7d5 d2d4 g8f6 c1f4 e7e6 e2e3 f8b4 g1e2 e8g8 a2a3 b4d6 f4d6 d8d6 e2f4 c7c5 d4c5 d6c5 f4d3 c5e7