multi-pv analysis

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

Re: multi-pv analysis

Post by Greg Strong »

Another multi-pv question ...

I think my implementation is pretty standard, basically the way Stockfish does it.

What sometimes happens is this. I find the 'best' move and get an evaluation. Then, to find the second PV, I perform a search with the first move excluded from consideration giving me another move with its associated evaluation. But, sometimes, this second evaluation will be slightly better than the first! That seems wrong since this is supposed to be the second best move. Does this mean something is fundamentally broken? Or can this happen just due to normal search instability caused by TT, etc?

In case it matters, I have my multi-pv loop inside the iterative deepening loop:

Code: Select all

for( int iDepth = 1; !timeExpired; iDepth++ )
    for&#40; int pvNumber = 1; pvNumber < multiPV; pvNumber++ )
        search&#40;);
User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: multi-pv analysis

Post by Ovyron »

Greg Strong wrote: Then, to find the second PV, I perform a search with the first move excluded from consideration giving me another move with its associated evaluation. But, sometimes, this second evaluation will be slightly better than the first! That seems wrong since this is supposed to be the second best move.
This is normal and happens to all the engines with MultiPV, and also happens with the Exclude Moves feature, where the originally top move in SinglePV may even end up as 4th best after the engine is forced to exclude it.

What happens is the engine misses the best move in SinglePV because it was reducing it.

For instance, suppose this is a main PV:

1.a b 2.c d 3.e f...

And this is the main PV of the second best move:

1.g h 2.i j

2...j makes i to fail low, the engine cuts the variation.

Once 1.a is excluded the engine is forced to extend the second variation...

1.g h 2.i j 3.k (fail low)

1.g h 2.i j 3.l (fail high)

1.g h 2.i m 3.n o

The engine originally was missing 3.l which refutes j, now m is better, and g has a better eval than 1.a, so you get a second best move better than what the engine found originally.
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: multi-pv analysis

Post by Ras »

Greg Strong wrote:Or can this happen just due to normal search instability caused by TT, etc?
The TT had previously been filled with alpha/beta values from the original search. Now if the best move is excluded, it may well be that some TT data are bogus because they relied on cutting off nodes in the search that maybe would not have been cut off if the best move hadn't been there in the first place.

You can easily verify this by clearing the hash tables between the multi-PV calculations. In that case, the second best move should have an equal or worse score than the best one.

If it doesn't, then it might be that some pruning cut off a move in the original search that turned out to be important and is now evaluated.
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: multi-pv analysis

Post by syzygy »

Greg Strong wrote:Does this mean something is fundamentally broken? Or can this happen just due to normal search instability caused by TT, etc?
As others have said, this is normal.

To cope with this, Stockfish sorts the PVs by score after each new PV line it has found.
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: multi-pv analysis

Post by Ras »

syzygy wrote:Stockfish sorts the PVs by score after each new PV line it has found.
Which has the strange side-effect that the best move in multi-PV isn't necessarily the one Stockfish would have played, right?
User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: multi-pv analysis

Post by Ovyron »

Ras wrote: Which has the strange side-effect that the best move in multi-PV isn't necessarily the one Stockfish would have played, right?
That's not strange, it's commonly known that at the same depth, MultiPV plays stronger moves than SinglePV, and the more lines you add, the stronger the play.

You get the strongest play if the engine analyzes every single line and gives it a score.

But the more lines, the slower the engine, and the engine has limited time to decide on a move, that's why it'd rather play the weaker SinglePV move that is faster to find.
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: multi-pv analysis

Post by syzygy »

Ras wrote:
syzygy wrote:Stockfish sorts the PVs by score after each new PV line it has found.
Which has the strange side-effect that the best move in multi-PV isn't necessarily the one Stockfish would have played, right?
Right.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: multi-pv analysis

Post by Ferdy »

Greg Strong wrote:Another multi-pv question ...

I think my implementation is pretty standard, basically the way Stockfish does it.

What sometimes happens is this. I find the 'best' move and get an evaluation. Then, to find the second PV, I perform a search with the first move excluded from consideration giving me another move with its associated evaluation. But, sometimes, this second evaluation will be slightly better than the first! That seems wrong since this is supposed to be the second best move. Does this mean something is fundamentally broken? Or can this happen just due to normal search instability caused by TT, etc?

In case it matters, I have my multi-pv loop inside the iterative deepening loop:

Code: Select all

for&#40; int iDepth = 1; !timeExpired; iDepth++ )
    for&#40; int pvNumber = 1; pvNumber < multiPV; pvNumber++ )
        search&#40;);
Looks normal, at same iteration depth the second and later searches has the advantage because of tt info from a previous search. At next iteration depth, the first search will regain the advantage of finding the best move/pv line and so on.

I believe multipv searches is effective at finding the best move when there are moves with scores that are close. One variant that I remember is makruk or Thai chess.

Looking at Stockfish's multipv 3 output (I remove lines without pv when it sends info ...), this is run with 1 thread, it seems like it is not based on iteration depth, have a look starting at depth 17. It sends depth 17 with pv, sends depth 18 with pv too and then back it sends again depth 17 with pv. This happens at higher iterations too. Have a look on the time info value, it sends 3 pv's (with varying depths) info but at same time value.
2018-01-14 10:55:02.052<--1:Stockfish 130118 64 POPCNT by T. Romstad, M. Costalba, J. Kiiski, G. Linscott
2018-01-14 10:55:02.052-->1:uci
2018-01-14 10:55:02.130<--1:id name Stockfish 130118 64 POPCNT
2018-01-14 10:55:02.130<--1:id author T. Romstad, M. Costalba, J. Kiiski, G. Linscott
2018-01-14 10:55:02.130<--1:uciok
2018-01-14 10:55:02.130-->1:setoption name Hash value 128
2018-01-14 10:55:02.130-->1:setoption name MultiPV value 3
[...]
2018-01-14 10:55:02.130-->1:isready
2018-01-14 10:55:02.177<--1:readyok
2018-01-14 10:55:27.901-->1:ucinewgame
2018-01-14 10:55:27.901-->1:isready
2018-01-14 10:55:27.916<--1:readyok
2018-01-14 10:55:27.931-->1:position startpos
2018-01-14 10:55:27.931-->1:go infinite
2018-01-14 10:55:27.931<--1:info depth 1 seldepth 1 multipv 1 score cp 92 nodes 57 nps 28500 tbhits 0 time 2 pv e2e4
2018-01-14 10:55:27.931<--1:info depth 1 seldepth 1 multipv 2 score cp 92 nodes 57 nps 28500 tbhits 0 time 2 pv d2d4
2018-01-14 10:55:27.931<--1:info depth 1 seldepth 1 multipv 3 score cp 80 nodes 57 nps 28500 tbhits 0 time 2 pv e2e3
2018-01-14 10:55:27.931<--1:info depth 2 seldepth 2 multipv 1 score cp 87 nodes 130 nps 65000 tbhits 0 time 2 pv e2e4 b7b6
2018-01-14 10:55:27.931<--1:info depth 2 seldepth 2 multipv 2 score cp 77 nodes 130 nps 65000 tbhits 0 time 2 pv d2d4 b7b6
2018-01-14 10:55:27.931<--1:info depth 2 seldepth 2 multipv 3 score cp 74 nodes 130 nps 65000 tbhits 0 time 2 pv e2e3 c7c6
2018-01-14 10:55:27.931<--1:info depth 3 seldepth 3 multipv 1 score cp 124 nodes 301 nps 150500 tbhits 0 time 2 pv e2e4 d7d6 d2d4
2018-01-14 10:55:27.931<--1:info depth 3 seldepth 3 multipv 2 score cp 116 nodes 301 nps 150500 tbhits 0 time 2 pv d2d4 e7e6 e2e4
2018-01-14 10:55:27.931<--1:info depth 3 seldepth 3 multipv 3 score cp 68 nodes 301 nps 150500 tbhits 0 time 2 pv e2e3 e7e6 d2d4
2018-01-14 10:55:27.936<--1:info depth 4 seldepth 4 multipv 1 score cp 117 nodes 971 nps 323666 tbhits 0 time 3 pv e2e4 e7e6 d2d4 d7d6
2018-01-14 10:55:27.936<--1:info depth 4 seldepth 4 multipv 2 score cp 39 nodes 971 nps 323666 tbhits 0 time 3 pv d2d4 d7d5 c1g5 a7a5
2018-01-14 10:55:27.936<--1:info depth 4 seldepth 4 multipv 3 score cp 8 nodes 971 nps 323666 tbhits 0 time 3 pv e2e3 e7e6 d2d4 d7d5
2018-01-14 10:55:27.936<--1:info depth 5 seldepth 5 multipv 1 score cp 55 nodes 1831 nps 457750 tbhits 0 time 4 pv e2e4 d7d5 d1f3 e7e6 d2d4 d5e4 f3e4
2018-01-14 10:55:27.936<--1:info depth 5 seldepth 5 multipv 2 score cp 18 nodes 1831 nps 457750 tbhits 0 time 4 pv d2d4 d7d5 e2e3 e7e6 c1d2
2018-01-14 10:55:27.936<--1:info depth 5 seldepth 5 multipv 3 score cp 18 nodes 1831 nps 457750 tbhits 0 time 4 pv e2e3 e7e6 d2d4 d7d5 c1d2
2018-01-14 10:55:27.936<--1:info depth 6 seldepth 6 multipv 1 score cp 55 nodes 4473 nps 559125 tbhits 0 time 8 pv e2e4 d7d5 d1f3 e7e6 d2d4 d5e4
2018-01-14 10:55:27.936<--1:info depth 6 seldepth 6 multipv 2 score cp 11 nodes 4473 nps 559125 tbhits 0 time 8 pv b1c3 g8f6 d2d4 d7d5 e2e3 e7e6
2018-01-14 10:55:27.936<--1:info depth 6 seldepth 6 multipv 3 score cp 5 nodes 4473 nps 559125 tbhits 0 time 8 pv g1f3 d7d5 e2e3 e7e6 d2d4 b8c6
2018-01-14 10:55:27.941<--1:info depth 7 seldepth 7 multipv 1 score cp 55 nodes 9138 nps 652714 tbhits 0 time 14 pv e2e4 d7d5 d1f3 e7e6 d2d4 d5e4 f3e4
2018-01-14 10:55:27.941<--1:info depth 7 seldepth 7 multipv 2 score cp 37 nodes 9138 nps 652714 tbhits 0 time 14 pv b1c3 d7d5 e2e3 g8f6 g1f3 c8g4 d2d4
2018-01-14 10:55:27.946<--1:info depth 7 seldepth 7 multipv 3 score cp 26 nodes 9138 nps 652714 tbhits 0 time 14 pv c2c3 d7d5 g1f3 b8c6 d2d4 g8f6 c1g5
2018-01-14 10:55:27.946<--1:info depth 8 seldepth 10 multipv 1 score cp 17 nodes 13415 nps 745277 tbhits 0 time 18 pv e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 d1e2 b8c6 g1f3
2018-01-14 10:55:27.946<--1:info depth 8 seldepth 8 multipv 2 score cp 8 nodes 13415 nps 745277 tbhits 0 time 18 pv b1c3 d7d5 e2e3 e7e6 g1f3 b8c6 d2d4 g8f6
2018-01-14 10:55:27.951<--1:info depth 8 seldepth 8 multipv 3 score cp 8 nodes 13415 nps 745277 tbhits 0 time 18 pv d2d4 g8f6 b1c3 d7d5 e2e3 e7e6 g1f3 b8c6
2018-01-14 10:55:27.966<--1:info depth 9 seldepth 9 multipv 1 score cp 51 nodes 28329 nps 765648 tbhits 0 time 37 pv g1f3 d7d5 d2d4 e7e6 e2e3 b8d7 f1e2 g8f6 e1g1
2018-01-14 10:55:27.966<--1:info depth 9 seldepth 11 multipv 2 score cp 47 nodes 28329 nps 765648 tbhits 0 time 37 pv d2d4 g8f6 g1f3 d7d6 e2e3 c8g4 f1e2 b8c6 e1g1
2018-01-14 10:55:27.966<--1:info depth 9 seldepth 14 multipv 3 score cp 33 nodes 28329 nps 765648 tbhits 0 time 37 pv e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 d1e2 b8c6 g1f3 g8f6 e2e6
2018-01-14 10:55:27.991<--1:info depth 10 seldepth 13 multipv 1 score cp 48 nodes 47303 nps 775459 tbhits 0 time 61 pv e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 d1e2 b8c6 g1f3 e6e2 f1e2 e7e5 c3d5
2018-01-14 10:55:27.991<--1:info depth 10 seldepth 13 multipv 2 score cp 36 nodes 47303 nps 775459 tbhits 0 time 61 pv g1f3 d7d5 d2d4 e7e6 e2e3 g8f6 f1e2 c7c6 b1c3 b8d7 e1g1 d8b6
2018-01-14 10:55:27.991<--1:info depth 10 seldepth 10 multipv 3 score cp 36 nodes 47303 nps 775459 tbhits 0 time 61 pv d2d4 g8f6 e2e3 d7d5 f1e2 e7e6 g1f3 c7c6 b1c3 b8d7
2018-01-14 10:55:28.076<--1:info depth 11 seldepth 19 multipv 1 score cp 54 nodes 113228 nps 765054 tbhits 0 time 148 pv e2e4 e7e5 b1c3 g8f6 g1f3 d7d6 d2d4 b8c6 f1b5 e5d4 b5c6 b7c6
2018-01-14 10:55:28.076<--1:info depth 11 seldepth 11 multipv 2 score cp 37 nodes 113228 nps 765054 tbhits 0 time 148 pv d2d4 g8f6 b1c3 d7d5 e2e3 e7e6 g1f3 f8b4 a2a3 b4c3 b2c3
2018-01-14 10:55:28.076<--1:info depth 11 seldepth 14 multipv 3 score cp 8 nodes 113228 nps 765054 tbhits 0 time 148 pv g1f3 d7d5 e2e3 e7e6 f1e2 b8c6 e1g1 g8f6 b1c3 f8e7 d2d4 e8g8
2018-01-14 10:55:28.196<--1:info depth 12 seldepth 17 multipv 1 score cp 50 nodes 206722 nps 768483 tbhits 0 time 269 pv e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 d1e2 b8c6 c3b5 e8d8 c2c3 a7a5 g1f3
2018-01-14 10:55:28.196<--1:info depth 12 seldepth 17 multipv 2 score cp 4 nodes 206722 nps 768483 tbhits 0 time 269 pv d2d4 g8f6 b1c3 d7d5 e2e3 b8c6 g1f3 e7e6 c1d2 f8b4 f1d3 c8d7 e1g1 e8g8
2018-01-14 10:55:28.201<--1:info depth 12 seldepth 15 multipv 3 score cp 3 nodes 206722 nps 768483 tbhits 0 time 269 pv e2e3 d7d5 d2d4 e7e6 b1c3 g8f6 g1f3 f8b4 f1d3 e8g8 e1g1 c7c6
2018-01-14 10:55:28.491<--1:info depth 13 seldepth 22 multipv 1 score cp 42 nodes 414764 nps 758252 tbhits 0 time 547 pv e2e4 e7e5 d2d4 e5d4 d1d4 b8c6 d4e3 d7d6 g1f3 g8f6 b1c3 c8d7 f1b5 c6b4 e3e2 c7c6 b5c4
2018-01-14 10:55:28.491<--1:info depth 13 seldepth 19 multipv 2 score cp 32 nodes 414764 nps 758252 tbhits 0 time 547 pv d2d4 g8f6 g1f3 d7d5 e2e3 e7e6 c2c4 c7c5 f1e2 d5c4 b1c3 c8d7 e1g1 d7c6 d4c5 f8c5 d1d8 e8d8 e2c4
2018-01-14 10:55:28.491<--1:info depth 13 seldepth 16 multipv 3 score cp 14 nodes 414764 nps 758252 tbhits 0 time 547 pv g1f3 d7d5 d2d4 e7e6 b1c3 f8b4 e2e3 g8f6 c1d2 e8g8 f1d3 b8c6 a2a3 b4c3 d2c3
2018-01-14 10:55:28.791<--1:info depth 14 seldepth 23 multipv 1 score cp 23 nodes 647241 nps 752605 tbhits 0 time 860 pv e2e4 e7e5 g1f3 b8c6 b1c3 g8f6 d2d4 e5d4 f3d4 f8b4 d4c6 b7c6 e4e5 f6d5 c1d2 b4c3 b2c3
2018-01-14 10:55:28.791<--1:info depth 14 seldepth 17 multipv 2 score cp 16 nodes 647241 nps 752605 tbhits 0 time 860 pv d2d4 d7d5 g1f3 e7e6 e2e3 g8f6 c2c4 c7c5 b1c3 c5d4 e3d4 f8b4 a2a3 b4c3 b2c3 e8g8
2018-01-14 10:55:28.791<--1:info depth 14 seldepth 21 multipv 3 score cp 15 nodes 647241 nps 752605 tbhits 0 time 860 pv g1f3 d7d5 d2d4 e7e6 e2e3 g8f6 c2c4 f8e7 f1d3 c7c5 e1g1 e8g8 b1c3 b8c6 c4d5 e6d5 d4c5
2018-01-14 10:55:29.581<--1:info depth 15 seldepth 22 multipv 1 score cp 32 nodes 1217183 nps 736793 hashfull 63 tbhits 0 time 1652 pv d2d4 d7d5 c1f4 g8f6 e2e3 e7e6 g1f3 f8d6 c2c3 e8g8 f4d6 c7d6 f1d3 e6e5 d4e5 d6e5 f3e5 b8c6 e5f3
2018-01-14 10:55:29.581<--1:info depth 15 seldepth 23 multipv 2 score cp 19 nodes 1217183 nps 736793 hashfull 63 tbhits 0 time 1652 pv e2e4 e7e5 g1f3 b8c6 d2d4 e5d4 f3d4 d7d5 d4c6 b7c6 d1e2 d5e4 e2e4 d8e7 b1c3 g8f6 e4e7 f8e7 c1f4 a8b8
2018-01-14 10:55:29.581<--1:info depth 15 seldepth 21 multipv 3 score cp 3 upperbound nodes 1217183 nps 736793 hashfull 63 tbhits 0 time 1652 pv b1c3 g8f6 e2e4 e7e5 g1f3 f8b4 a2a3 b4c3 d2c3 e8g8 f1d3 d7d6 e1g1 b8c6 c1g5 h7h6
2018-01-14 10:55:30.066<--1:info depth 16 seldepth 23 multipv 1 score cp 29 nodes 1575787 nps 737382 hashfull 88 tbhits 0 time 2137 pv e2e4 e7e5 g1f3 b8c6 d2d4 e5d4 f3d4 g8f6 d4c6 d7c6 d1d8 e8d8 b1c3 f8d6 c1e3 c8e6 f1d3 a7a5
2018-01-14 10:55:30.066<--1:info depth 16 seldepth 22 multipv 2 score cp 22 nodes 1575787 nps 737382 hashfull 88 tbhits 0 time 2137 pv d2d4 d7d5 c1f4 g8f6 e2e3 e7e6 g1f3 f8d6 f1d3 c7c5 d3b5 b8c6 b1c3 e8g8 f4d6 d8d6 e1g1 c5d4 e3d4 f8e8
2018-01-14 10:55:30.066<--1:info depth 16 seldepth 21 multipv 3 score cp 22 nodes 1575787 nps 737382 hashfull 88 tbhits 0 time 2137 pv g1f3 d7d5 d2d4 g8f6 c1f4 e7e6 e2e3 f8d6 f1d3 c7c5 d3b5 b8c6 b1c3 e8g8 f4d6 d8d6 e1g1 c5d4 e3d4

2018-01-14 10:55:30.776<--1:info depth 17 seldepth 26 multipv 1 score cp 32 nodes 2092610 nps 735281 hashfull 114 tbhits 0 time 2846 pv e2e4 e7e5 g1f3 b8c6 d2d4 e5d4 f3d4 g8f6 d4c6 d7c6 d1d8 e8d8 b1c3 f8d6 c1e3 h8e8 f2f3 b7b5 c3e2 c8d7 a1d1 d8e7 e3d4
2018-01-14 10:55:30.776<--1:info depth 17 seldepth 22 multipv 2 score cp 25 nodes 2092610 nps 735281 hashfull 114 tbhits 0 time 2846 pv g1f3 d7d5 d2d4 g8f6 c1f4 e7e6 e2e3 f8d6 f1e2 d6f4 e3f4 e8g8 e1g1 d8d6 f3e5 d6b6 b2b3 c7c5 d4c5 b6c5 c2c3
2018-01-14 10:55:30.776<--1:info depth 17 seldepth 24 multipv 3 score cp 22 nodes 2092610 nps 735281 hashfull 114 tbhits 0 time 2846 pv d2d4 d7d5 c1f4 g8f6 e2e3 e7e6 g1f3 f8d6 c2c3 b8d7 f1e2 d6f4 e3f4 e8g8 e1g1 c7c5 b1d2 c5c4
2018-01-14 10:55:32.032<--1:info depth 18 seldepth 30 multipv 1 score cp 41 nodes 2993348 nps 729195 hashfull 169 tbhits 0 time 4105 pv e2e4 e7e5 g1f3 b8c6 f1b5 a7a6 b5c6 d7c6 e1g1 d8d6 b1c3 c8e6 d2d4 e5d4 e4e5 d6b4 a2a3 b4c4 d1d4 c4d4 f3d4 g8e7 d4e6
2018-01-14 10:55:32.037<--1:info depth 17 seldepth 22 multipv 2 score cp 25 nodes 2993348 nps 729195 hashfull 169 tbhits 0 time 4105 pv g1f3 d7d5 d2d4 g8f6 c1f4 e7e6 e2e3 f8d6 f1e2 d6f4 e3f4 e8g8 e1g1 d8d6 f3e5 d6b6 b2b3 c7c5 d4c5 b6c5 c2c3
2018-01-14 10:55:32.037<--1:info depth 17 seldepth 24 multipv 3 score cp 22 nodes 2993348 nps 729195 hashfull 169 tbhits 0 time 4105 pv d2d4 d7d5 c1f4 g8f6 e2e3 e7e6 g1f3 f8d6 c2c3 b8d7 f1e2 d6f4 e3f4 e8g8 e1g1 c7c5 b1d2 c5c4
2018-01-14 10:55:32.172<--1:info depth 18 seldepth 30 multipv 1 score cp 41 nodes 3098699 nps 729964 hashfull 176 tbhits 0 time 4245 pv e2e4 e7e5 g1f3 b8c6 f1b5 a7a6 b5c6 d7c6 e1g1 d8d6 b1c3 c8e6 d2d4 e5d4 e4e5 d6b4 a2a3 b4c4 d1d4 c4d4 f3d4 g8e7 d4e6
2018-01-14 10:55:32.172<--1:info depth 18 seldepth 18 multipv 2 score cp 22 nodes 3098699 nps 729964 hashfull 176 tbhits 0 time 4245 pv g1f3 d7d5 d2d4 e7e6 c1f4 g8f6 e2e3 f8d6 f1e2 d6f4 e3f4 e8g8 e1g1 d8d6 g2g3 d6b6 b2b3 b8c6
2018-01-14 10:55:32.177<--1:info depth 17 seldepth 24 multipv 3 score cp 22 nodes 3098699 nps 729964 hashfull 176 tbhits 0 time 4245 pv d2d4 d7d5 c1f4 g8f6 e2e3 e7e6 g1f3 f8d6 c2c3 b8d7 f1e2 d6f4 e3f4 e8g8 e1g1 c7c5 b1d2 c5c4

2018-01-14 10:55:32.237<--1:info depth 18 seldepth 30 multipv 1 score cp 41 nodes 3143744 nps 729915 hashfull 179 tbhits 0 time 4307 pv e2e4 e7e5 g1f3 b8c6 f1b5 a7a6 b5c6 d7c6 e1g1 d8d6 b1c3 c8e6 d2d4 e5d4 e4e5 d6b4 a2a3 b4c4 d1d4 c4d4 f3d4 g8e7 d4e6
2018-01-14 10:55:32.237<--1:info depth 18 seldepth 18 multipv 2 score cp 22 nodes 3143744 nps 729915 hashfull 179 tbhits 0 time 4307 pv g1f3 d7d5 d2d4 e7e6 c1f4 g8f6 e2e3 f8d6 f1e2 d6f4 e3f4 e8g8 e1g1 d8d6 g2g3 d6b6 b2b3 b8c6
2018-01-14 10:55:32.237<--1:info depth 18 seldepth 18 multipv 3 score cp 22 nodes 3143744 nps 729915 hashfull 179 tbhits 0 time 4307 pv d2d4 d7d5 c1f4 e7e6 e2e3 g8f6 g1f3 f8d6 f1e2 d6f4 e3f4 e8g8 e1g1 d8d6 g2g3 d6b6 b2b3 b8c6
2018-01-14 10:55:33.457<--1:info depth 19 seldepth 27 multipv 1 score cp 35 nodes 4004593 nps 724813 hashfull 231 tbhits 0 time 5525 pv e2e4 e7e6 g1f3 d7d5 e4d5 e6d5 d2d4 g8f6 f1d3 f8e7 e1g1 e8g8 b1c3 c7c5 d4c5 b8c6 c1f4 e7c5 c3b5
2018-01-14 10:55:33.457<--1:info depth 18 seldepth 18 multipv 2 score cp 22 nodes 4004593 nps 724813 hashfull 231 tbhits 0 time 5525 pv g1f3 d7d5 d2d4 e7e6 c1f4 g8f6 e2e3 f8d6 f1e2 d6f4 e3f4 e8g8 e1g1 d8d6 g2g3 d6b6 b2b3 b8c6
2018-01-14 10:55:33.457<--1:info depth 18 seldepth 18 multipv 3 score cp 22 nodes 4004593 nps 724813 hashfull 231 tbhits 0 time 5525 pv d2d4 d7d5 c1f4 e7e6 e2e3 g8f6 g1f3 f8d6 f1e2 d6f4 e3f4 e8g8 e1g1 d8d6 g2g3 d6b6 b2b3 b8c6
2018-01-14 10:55:34.393<--1:info depth 19 seldepth 27 multipv 1 score cp 35 nodes 4694676 nps 726730 hashfull 275 tbhits 0 time 6460 pv e2e4 e7e6 g1f3 d7d5 e4d5 e6d5 d2d4 g8f6 f1d3 f8e7 e1g1 e8g8 b1c3 c7c5 d4c5 b8c6 c1f4 e7c5 c3b5
2018-01-14 10:55:34.393<--1:info depth 19 seldepth 27 multipv 2 score cp 30 nodes 4694676 nps 726730 hashfull 275 tbhits 0 time 6460 pv g1f3 d7d5 e2e3 g8f6 c2c4 e7e6 d2d4 f8e7 b1c3 e8g8 c4d5 e6d5 f1d3 b8c6 e1g1 e7d6 c3b5 f6e4 c1d2 e4d2 d1d2
2018-01-14 10:55:34.393<--1:info depth 18 seldepth 18 multipv 3 score cp 22 nodes 4694676 nps 726730 hashfull 275 tbhits 0 time 6460 pv d2d4 d7d5 c1f4 e7e6 e2e3 g8f6 g1f3 f8d6 f1e2 d6f4 e3f4 e8g8 e1g1 d8d6 g2g3 d6b6 b2b3 b8c6
2018-01-14 10:55:37.330<--1:info depth 19 seldepth 29 multipv 1 score cp 40 nodes 6789750 nps 722467 hashfull 402 tbhits 0 time 9398 pv d2d4 d7d5 c2c4 e7e6 b1c3 f8e7 g1f3 g8f6 c1g5 b8d7 c4d5 e6d5 e2e3 e8g8 f1e2 h7h6 g5h4 f8e8 h2h3 d7b6 e1g1 c7c6 h4g3 e7d6
2018-01-14 10:55:37.330<--1:info depth 19 seldepth 27 multipv 2 score cp 35 nodes 6789750 nps 722467 hashfull 402 tbhits 0 time 9398 pv e2e4 e7e6 g1f3 d7d5 e4d5 e6d5 d2d4 g8f6 f1d3 f8e7 e1g1 e8g8 b1c3 c7c5 d4c5 b8c6 c1f4 e7c5 c3b5
2018-01-14 10:55:37.335<--1:info depth 19 seldepth 27 multipv 3 score cp 30 nodes 6789750 nps 722467 hashfull 402 tbhits 0 time 9398 pv g1f3 d7d5 e2e3 g8f6 c2c4 e7e6 d2d4 f8e7 b1c3 e8g8 c4d5 e6d5 f1d3 b8c6 e1g1 e7d6 c3b5 f6e4 c1d2 e4d2 d1d2
2018-01-14 10:55:38.784<--1:info depth 20 seldepth 30 multipv 1 score cp 43 nodes 7828324 nps 721371 hashfull 445 tbhits 0 time 10852 pv e2e4 e7e6 g1f3 d7d5 e4d5 e6d5 d2d4 g8f6 f1d3 f8e7 e1g1 b8c6 h2h3 e8g8 b1c3 c6b4 f1e1 b4d3 d1d3 e7d6
2018-01-14 10:55:38.784<--1:info depth 19 seldepth 30 multipv 2 score cp 40 nodes 7828324 nps 721371 hashfull 445 tbhits 0 time 10852 pv d2d4 d7d5
2018-01-14 10:55:38.785<--1:info depth 19 seldepth 27 multipv 3 score cp 30 nodes 7828324 nps 721371 hashfull 445 tbhits 0 time 10852 pv g1f3 d7d5 e2e3 g8f6 c2c4 e7e6 d2d4 f8e7 b1c3 e8g8 c4d5 e6d5 f1d3 b8c6 e1g1 e7d6 c3b5 f6e4 c1d2 e4d2 d1d2
2018-01-14 10:55:42.318<--1:info depth 20 seldepth 31 multipv 1 score cp 46 nodes 10370543 nps 720827 hashfull 559 tbhits 0 time 14387 pv d2d4 d7d5 c2c4 e7e6 g1f3 g8f6 b1c3 f8e7 c1f4 e8g8 e2e3 b8c6 f1e2 d5c4 e2c4 b7b6 e1g1 f6d5 c3d5 e6d5 c4d3 c6b4 d3b1
2018-01-14 10:55:42.319<--1:info depth 20 seldepth 30 multipv 2 score cp 43 nodes 10370543 nps 720827 hashfull 559 tbhits 0 time 14387 pv e2e4 e7e6 g1f3 d7d5 e4d5 e6d5 d2d4 g8f6 f1d3 f8e7 e1g1 b8c6 h2h3 e8g8 b1c3 c6b4 f1e1 b4d3 d1d3 e7d6
2018-01-14 10:55:42.319<--1:info depth 19 seldepth 27 multipv 3 score cp 30 nodes 10370543 nps 720827 hashfull 559 tbhits 0 time 14387 pv g1f3 d7d5 e2e3 g8f6 c2c4 e7e6 d2d4 f8e7 b1c3 e8g8 c4d5 e6d5 f1d3 b8c6 e1g1 e7d6 c3b5 f6e4 c1d2 e4d2 d1d2
2018-01-14 10:55:44.221<--1:info depth 20 seldepth 31 multipv 1 score cp 46 nodes 11730856 nps 720082 hashfull 609 tbhits 0 time 16291 pv d2d4 d7d5 c2c4 e7e6 g1f3 g8f6 b1c3 f8e7 c1f4 e8g8 e2e3 b8c6 f1e2 d5c4 e2c4 b7b6 e1g1 f6d5 c3d5 e6d5 c4d3 c6b4 d3b1
2018-01-14 10:55:44.221<--1:info depth 20 seldepth 30 multipv 2 score cp 43 nodes 11730856 nps 720082 hashfull 609 tbhits 0 time 16291 pv e2e4 e7e6 g1f3 d7d5 e4d5 e6d5 d2d4 g8f6 f1d3 f8e7 e1g1 b8c6 h2h3 e8g8 b1c3 c6b4 f1e1 b4d3 d1d3 e7d6
2018-01-14 10:55:44.221<--1:info depth 20 seldepth 29 multipv 3 score cp 8 nodes 11730856 nps 720082 hashfull 609 tbhits 0 time 16291 pv g1f3 d7d5 e2e3 g8f6 c2c4 e7e6 b1c3 f8e7 d2d4 e8g8 f1e2 b7b6 c4d5 f6d5 c1d2 d5c3 d2c3 b8d7 e2d3 c8b7 e1g1 c7c5
2018-01-14 10:55:45.261<--1:info depth 21 seldepth 27 multipv 1 score cp 31 nodes 12518375 nps 722352 hashfull 641 tbhits 0 time 17330 pv d2d4 d7d5 c2c4 e7e6 g1f3 g8f6 b1c3 f8e7 c1f4 e8g8 e2e3 b8c6 f1e2 d5c4 e2c4 b7b6 e1g1 c8b7 a1c1 c6a5 c4b5 c7c5 d4c5 e7c5
2018-01-14 10:55:45.261<--1:info depth 20 seldepth 30 multipv 2 score cp 43 nodes 12518375 nps 722352 hashfull 641 tbhits 0 time 17330 pv e2e4 e7e6 g1f3 d7d5 e4d5 e6d5 d2d4 g8f6 f1d3 f8e7 e1g1 b8c6 h2h3 e8g8 b1c3 c6b4 f1e1 b4d3 d1d3 e7d6
2018-01-14 10:55:45.266<--1:info depth 20 seldepth 29 multipv 3 score cp 8 nodes 12518375 nps 722352 hashfull 641 tbhits 0 time 17330 pv g1f3 d7d5 e2e3 g8f6 c2c4 e7e6 b1c3 f8e7 d2d4 e8g8 f1e2 b7b6 c4d5 f6d5 c1d2 d5c3 d2c3 b8d7 e2d3 c8b7 e1g1 c7c5
2018-01-14 10:55:47.053<--1:info depth 21 seldepth 30 multipv 1 score cp 32 nodes 13833769 nps 723447 hashfull 692 tbhits 0 time 19122 pv e2e4 e7e6 d2d4 d7d5 b1c3 f8b4 e4d5 e6d5 f1d3 g8e7 g1f3 e8g8 a2a3 b4c3 b2c3 c8f5 a1b1 f5d3 c2d3 b7b6 e1g1 b8c6 f1e1
2018-01-14 10:55:47.058<--1:info depth 21 seldepth 27 multipv 2 score cp 31 nodes 13833769 nps 723447 hashfull 692 tbhits 0 time 19122 pv d2d4 d7d5 c2c4 e7e6 g1f3 g8f6 b1c3 f8e7 c1f4 e8g8 e2e3 b8c6 f1e2 d5c4 e2c4 b7b6 e1g1 c8b7 a1c1 c6a5 c4b5 c7c5 d4c5 e7c5
2018-01-14 10:55:47.058<--1:info depth 20 seldepth 29 multipv 3 score cp 8 nodes 13833769 nps 723447 hashfull 692 tbhits 0 time 19122 pv g1f3 d7d5 e2e3 g8f6 c2c4 e7e6 b1c3 f8e7 d2d4 e8g8 f1e2 b7b6 c4d5 f6d5 c1d2 d5c3 d2c3 b8d7 e2d3 c8b7 e1g1 c7c5
2018-01-14 10:55:48.133<--1:info depth 21 seldepth 30 multipv 1 score cp 32 nodes 14612410 nps 723315 hashfull 714 tbhits 0 time 20202 pv e2e4 e7e6 d2d4 d7d5 b1c3 f8b4 e4d5 e6d5 f1d3 g8e7 g1f3 e8g8 a2a3 b4c3 b2c3 c8f5 a1b1 f5d3 c2d3 b7b6 e1g1 b8c6 f1e1
2018-01-14 10:55:48.133<--1:info depth 21 seldepth 27 multipv 2 score cp 31 nodes 14612410 nps 723315 hashfull 714 tbhits 0 time 20202 pv d2d4 d7d5 c2c4 e7e6 g1f3 g8f6 b1c3 f8e7 c1f4 e8g8 e2e3 b8c6 f1e2 d5c4 e2c4 b7b6 e1g1 c8b7 a1c1 c6a5 c4b5 c7c5 d4c5 e7c5
2018-01-14 10:55:48.133<--1:info depth 21 seldepth 26 multipv 3 score cp 10 nodes 14612410 nps 723315 hashfull 714 tbhits 0 time 20202 pv g1f3 d7d5 d2d4 c8f5 c1f4 e7e6 e2e3 g8f6 b1c3 f8d6 f4d6 c7d6 f1d3 f5d3 c2d3 b8c6 e1g1 e8g8 a1c1 a8c8 d1b3 b7b6
2018-01-14 10:55:51.269<--1:info depth 22 seldepth 34 multipv 1 score cp 32 nodes 16843845 nps 721672 hashfull 777 tbhits 0 time 23340 pv e2e4 e7e6 d2d4 d7d5 b1c3 f8b4 e4d5 e6d5 f1d3 b8c6 g1f3 g8f6 e1g1 e8g8 a2a3 b4c3 b2c3 f8e8 h2h3 f6e4 c3c4 e4c3 d1d2 c3e4
2018-01-14 10:55:51.269<--1:info depth 21 seldepth 27 multipv 2 score cp 31 nodes 16843845 nps 721672 hashfull 777 tbhits 0 time 23340 pv d2d4 d7d5 c2c4 e7e6 g1f3 g8f6 b1c3 f8e7 c1f4 e8g8 e2e3 b8c6 f1e2 d5c4 e2c4 b7b6 e1g1 c8b7 a1c1 c6a5 c4b5 c7c5 d4c5 e7c5
2018-01-14 10:55:51.269<--1:info depth 21 seldepth 26 multipv 3 score cp 10 nodes 16843845 nps 721672 hashfull 777 tbhits 0 time 23340 pv g1f3 d7d5 d2d4 c8f5 c1f4 e7e6 e2e3 g8f6 b1c3 f8d6 f4d6 c7d6 f1d3 f5d3 c2d3 b8c6 e1g1 e8g8 a1c1 a8c8 d1b3 b7b6
2018-01-14 10:55:54.589<--1:info depth 22 seldepth 34 multipv 1 score cp 32 nodes 19243960 nps 722018 hashfull 833 tbhits 0 time 26653 pv e2e4 e7e6 d2d4 d7d5 b1c3 f8b4 e4d5 e6d5 f1d3 b8c6 g1f3 g8f6 e1g1 e8g8 a2a3 b4c3 b2c3 f8e8 h2h3 f6e4 c3c4 e4c3 d1d2 c3e4
2018-01-14 10:55:54.589<--1:info depth 22 seldepth 30 multipv 2 score cp 32 nodes 19243960 nps 722018 hashfull 833 tbhits 0 time 26653 pv d2d4 d7d5 c2c4 e7e6 g1f3 g8f6 b1c3 f8b4 e2e3 e8g8 c1d2 c7c5 a2a3 b4c3 d2c3 c5d4 c3d4 f8e8 c4d5 f6d5 f1e2 b8c6 e1g1 e6e5 d4c5 c8e6
2018-01-14 10:55:54.589<--1:info depth 21 seldepth 26 multipv 3 score cp 10 nodes 19243960 nps 722018 hashfull 833 tbhits 0 time 26653 pv g1f3 d7d5 d2d4 c8f5 c1f4 e7e6 e2e3 g8f6 b1c3 f8d6 f4d6 c7d6 f1d3 f5d3 c2d3 b8c6 e1g1 e8g8 a1c1 a8c8 d1b3 b7b6
2018-01-14 10:55:54.589<--1:info depth 22 currmove g1f3 currmovenumber 3
User avatar
hgm
Posts: 27789
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: multi-pv analysis

Post by hgm »

Greg Strong wrote:I find the 'best' move and get an evaluation. Then, to find the second PV, I perform a search with the first move excluded from consideration giving me another move with its associated evaluation.
That is a pretty inefficient way of doing it. In Fairy-Max I just increase alpha in the root score not to bestScore but to bestScore - margin. Then you get everything in a single search. That automatically excludes inconsistencies between different searches.

If you want to get a fixed number of PVs, rather than every PV in a score window, you can set alpha to the Nth score so far.
petero2
Posts: 685
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: multi-pv analysis

Post by petero2 »

hgm wrote:
Greg Strong wrote:I find the 'best' move and get an evaluation. Then, to find the second PV, I perform a search with the first move excluded from consideration giving me another move with its associated evaluation.
That is a pretty inefficient way of doing it. ...

If you want to get a fixed number of PVs, rather than every PV in a score window, you can set alpha to the Nth score so far.
I agree this is an improvement over restarting the search with excluded moves, but in my engine it was even more efficient to remember the aspiration window for the first N moves from the previous iteration. This is a significant win if the first N moves have widely different scores.