multi pv

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

djbl

multi pv

Post by djbl »

i mostly just use engines for analysing my corres' games on iccf and so far i have only used the one principle variation when i analyse. i am just wondering if using multi pv weakens analysis in general - that is; does it analyse to the same depth when using multi pv as when it is only analysing the one mainline? also, what would be about the best amout of variations to analyse. i have now just started to use 2 but will use more if there isn't any weakening of the engine. i am basically an idiot when it comes to computers so pls speak in such terms. thx
User avatar
hgm
Posts: 28359
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: multi pv

Post by hgm »

An engine in single PV mode typically uses 30-40% of the time on that PV and the remaining time for all other moves. If you let it calulate 4 PVs, each of those would take about that time. That means the time needed to reach the same depth for all will approximately double.

So requesting 4 PVs is equivalent to reducing the search time by 2, which reduces strength by 70 Elo.

That is just very general; if you want t know exact numbers for a specific engines, just try it out. Run in singe-PV and four-PV mode, and look how much time it takes to reach a certain depth.
djbl

Re: multi pv

Post by djbl »

ah i see, thanks for the info, i imagined as much actually. i guess in engine matches it might be useful but in corres games where only the single best move will do it is crucial and that extra 70elo makes all the difference. back to single mainlines methinks.
Marc MP

Re: multi pv

Post by Marc MP »

Hi Darren,

One very useful tool for analysis is the ability for an engine to include or exclude moves from the analysis.

For example take the following position:

[d]b4rk1/P3q1bp/Q7/3R4/4pp2/2P5/1P3PPP/3R2K1 b - - 0 1

In ChessPartner GUI I'm able to ask ChessTiger 2007 to analyze *only* 1...e3 (so it becomes de facto the main line). It saves you time if you know what you want to analyze... (you can exclude moves also)

You'll get the following result:

Code: Select all

00:00:00.4	-1,02	8	132162	e3 Qc4 exf2+ Kxf2 Qxa7+ Rc5+ Kh8 Rd3 Rb8 

00:00:00.7	-0,98	9	177321	e3 Qc4 exf2+ Kxf2 Qxa7+ Rc5+ Kh8 Rd3 Qb7 Rg5 Qb6+ Ke2 Qxb2+ Kf1 

00:00:04.3	-0,39	10	1032054	e3 R5d3 exf2+ Kxf2 Qe4 Rf3 Qc2+ Qe2 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5 Qa6 Qc5 e2 Re1 Ra8 Qc7 Qxa7 Qxf4 Qe7 Qf3 Re8 

02:05:22.4	0,68	20	2026791151	e3 Qc4 Kh8 Qc5 Qf6 c4 Bxd5 Qxd5 Qa6 Qc5 e2 Re1 Ra8 Qe7 f3 


Some uci engines do this as well, the strongest one I know are Stockfish and Ivanhoe and FireBird and Cyclone.

For winboard engine engine Crafty does it, at least in console mode. You open it in console mode then you type:

setboard b4rk1/P3q1bp/Q7/3R4/4pp2/2P5/1P3PPP/3R2K1 b - - 0 1 (or your fen string)

search e3

analyze


and Crafty will analyze e3 as the PV.

I know Pro Deo has the ability to do it, but I dont know how to make it work (it was working in the latest DOS Rebel).

In Shredder GUI, when you start the infinite analysis with a UCI engine, I think you can hold down the ctrl key while moving the move you want to become the main line by force (I'm not sure how to exclude moves).

I'm not aware how to include or exclude moves from Arena or ChessBase GUI.

EDIT: For Pro Deo I found the following discussion in the archives, but I'm not aware if it was effectively implemented: http://www.stmintz.com/ccc/index.php?id=431110
govert
Posts: 270
Joined: Thu Jan 15, 2009 12:52 pm

Re: multi pv

Post by govert »

Marc MP wrote:Some uci engines do this as well, the strongest one I know are Stockfish and Ivanhoe and FireBird and Cyclone.
Do you know of any GUI that I could use with this functionality?
Robert Weck
Posts: 519
Joined: Thu Mar 09, 2006 10:19 am

Re: multi pv

Post by Robert Weck »

hgm wrote:An engine in single PV mode typically uses 30-40% of the time on that PV and the remaining time for all other moves. If you let it calulate 4 PVs, each of those would take about that time. That means the time needed to reach the same depth for all will approximately double.

So requesting 4 PVs is equivalent to reducing the search time by 2, which reduces strength by 70 Elo.
But i sometimes see, that in multi pv mode an engine finds a (at least in its opinion :wink: ) better move, which it didn't in single mode! And when i go from multi back to single, it keeps this move as the best.

Single pv might be better for analyzing in general, but it seems not to give always the best results in every position...


Robert
alpha123
Posts: 660
Joined: Sat Dec 05, 2009 5:13 am
Location: Colorado, USA

Re: multi pv

Post by alpha123 »

govert wrote:
Marc MP wrote:Some uci engines do this as well, the strongest one I know are Stockfish and Ivanhoe and FireBird and Cyclone.
Do you know of any GUI that I could use with this functionality?
Shredder Classic.

Peter
User avatar
hgm
Posts: 28359
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: multi pv

Post by hgm »

Marc MP wrote:In ChessPartner GUI I'm able to ask ChessTiger 2007 to analyze *only* 1...e3 (so it becomes de facto the main line). It saves you time if you know what you want to analyze...
The conventional way to do this is just make the move e3, and analyze from there.
Robert Weck wrote:But i sometimes see, that in multi pv mode an engine finds a (at least in its opinion :wink: ) better move, which it didn't in single mode! And when i go from multi back to single, it keeps this move as the best.

Single pv might be better for analyzing in general, but it seems not to give always the best results in every position...
Well, searches are not always stable, and searching the other PVs affects the hash table, which can lead to other moves and scores in the next iteration. I doubt if on the average the move found (at the samedepth) in multi-PV mode would be better than that found in single-PV mode. Let alone in the same time.
djbl

Re: multi pv

Post by djbl »

Marc MP wrote:Hi Darren,

One very useful tool for analysis is the ability for an engine to include or exclude moves from the analysis.

For example take the following position:

[d]b4rk1/P3q1bp/Q7/3R4/4pp2/2P5/1P3PPP/3R2K1 b - - 0 1

In ChessPartner GUI I'm able to ask ChessTiger 2007 to analyze *only* 1...e3 (so it becomes de facto the main line). It saves you time if you know what you want to analyze... (you can exclude moves also)

You'll get the following result:

Code: Select all

00:00:00.4	-1,02	8	132162	e3 Qc4 exf2+ Kxf2 Qxa7+ Rc5+ Kh8 Rd3 Rb8 

00:00:00.7	-0,98	9	177321	e3 Qc4 exf2+ Kxf2 Qxa7+ Rc5+ Kh8 Rd3 Qb7 Rg5 Qb6+ Ke2 Qxb2+ Kf1 

00:00:04.3	-0,39	10	1032054	e3 R5d3 exf2+ Kxf2 Qe4 Rf3 Qc2+ Qe2 Qxe2+ Kxe2 Bxf3+ Kxf3 Ra8 

00:00:05.7	-0,75	11	1431682	e3 R5d3 exf2+ Kxf2 Qe4 Rf3 Qc2+ Qe2 Qxe2+ Kxe2 Bxf3+ Kxf3 Ra8 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e2 Re1 Ra8 Qe7 f3 


Some uci engines do this as well, the strongest one I know are Stockfish and Ivanhoe and FireBird and Cyclone.

For winboard engine engine Crafty does it, at least in console mode. You open it in console mode then you type:

setboard b4rk1/P3q1bp/Q7/3R4/4pp2/2P5/1P3PPP/3R2K1 b - - 0 1 (or your fen string)

search e3

analyze


and Crafty will analyze e3 as the PV.

I know Pro Deo has the ability to do it, but I dont know how to make it work (it was working in the latest DOS Rebel).

In Shredder GUI, when you start the infinite analysis with a UCI engine, I think you can hold down the ctrl key while moving the move you want to become the main line by force (I'm not sure how to exclude moves).

I'm not aware how to include or exclude moves from Arena or ChessBase GUI.

EDIT: For Pro Deo I found the following discussion in the archives, but I'm not aware if it was effectively implemented: http://www.stmintz.com/ccc/index.php?id=431110
thanks marc, i actually use the shredder gui and had no idea about this feature. this will come in very handy.
Marc MP

Re: multi pv

Post by Marc MP »

govert wrote:
Marc MP wrote:Some uci engines do this as well, the strongest one I know are Stockfish and Ivanhoe and FireBird and Cyclone.
Do you know of any GUI that I could use with this functionality?
There is a 30-trial for the ChessPartner GUI: http://www.lokasoft.nl/downloads.htm (I'm having the older 5.4 version but I assume it is still available in 6.0.3 version).

I first install Stockfish: Extra - Engine Import Wizard - Winboard/UCI engine - Select the engine.exe - Give a name - Engine Protocol = UCI - terminate.

Select the time control: I use Special level - infinite

Select the engine - Go to Extra - Analyze position - Select a .log file (you need the create one, you can use notepad, and change the extension from .txt to .log) and now you should have the choice betweem all moves - exclude some moves (you choose) - include some moves(you choose).

The engine will now start analyze your move selection. When you press cancel, all the output will be in the log file (or when the allocated time you choose runs out).

I find it handy when I want to focus only on 2 or 3 moves, or when I want to know the second best (I exclude the best from the analysis), some no losses in time incurs about searching what you already now.

Even when you analyze one move, some engine have contempt values, or they won't give the same score if you go one ply ahead:

[d]b4r1k/P5bp/5q2/2Q3R1/5p2/2P1p3/1P3PPP/3R2K1 b - - 5 1

From here I ask CycloneXtreme to analyze only ...e2

Code: Select all

; 00:00:00.1  34... Score: -1,77   depth: 1 e2 Re1 
; 00:00:00.1  34... Score: -1,53   depth: 2 e2 Re1 Qa6 
; 00:00:00.7  34... Score: -1,34   depth: 3 e2 Re1 f3 Rh5 
; 00:00:00.7  34... Score: -1,01   depth: 4 e2 Re1 f3 h4 Qa6 
; 00:00:00.7  34... Score: -0,95   depth: 5 e2 Re1 f3 h4 Bc6 h5 
; 00:00:00.8  34... Score: -0,77   depth: 6 e2 Re1 f3 g3 Be4 Kh1 Qe6 
; 00:00:00.5  34... Score: -0,82   depth: 7 e2 Re1 f3 g3 Bh6 Rh5 Bd2 Qc7 
; 00:00:00.7  34... Score: -0,60   depth: 8 e2 Re1 f3 g4 Rd8 Rf5 Qg6 g5 Be4 

; 00:00:00.5  34... Score: 0,08   depth: 9 e2 Re1 f3 Rg4 fxg2 Rxe2 Bf3 Ra4 Qg6 Ra1 Qd3 Re7 

; 00:00:01.9  34... Score: -0,12   depth: 10 e2 Re1 f3 Rg4 fxg2 Rxe2 Qd8 Rd4 Bxd4 Qxd4+ Qxd4 cxd4 Rd8 f3 Bxf3 Rxg2 Rxd4 Kf1 

; 00:00:02.1  34... Score: -0,26   depth: 11 e2 Re1 f3 Rg4 fxg2 Rxe2 Bf3 Ra4 Bc6 Ra1 Qf3 Re7 Bd5 Rd7 

; 00:00:04.7  34... Score: 0,00   depth: 12 e2 Re1 f3 Rg4 Rd8 Rd4 Rxd4 cxd4 Qd8 gxf3 Bxd4 Qf5 Qg8+ Kh1 Bxf2 Qe5+ Qg7 Qb8+ Qg8 Qe5+ 

; 00:00:07.9  34... Score: 0,01   depth: 13 e2 Re1 f3 Rg4 Qd8 Qg5 Bf6 Qc5 fxg2 Rg3 Re8 Re3 Rxe3 Qxe3 Qg8 

; 00:00:22.5  34... Score: 0,43   depth: 14 e2 Re1 f3 Rg4 Qd8 h4 fxg2 Rxg7 Kxg7 Qe5+ Kg8 Qg3+ Kf7 Qf4+ Qf6 Qc4+ Kg7 Rxe2 Rd8 Re1 Bc6 Qg4+ Kh8 

; 00:00:38.2  34... Score: 0,33   depth: 15 e2 Re1 f3 Rg4 Qd8 h3 fxg2 Rxg7 Kxg7 Qe5+ Qf6 Qxe2 Bf3 Qe7+ Qxe7 Rxe7+ Rf7 Rxf7+ Kxf7 b4 Ke6 h4 Kd6 c4 Kc7 h5 Be4 

; 00:01:16.0  34... Score: 0,53   depth: 16 e2 Re1 f3 Rg4 Qd8 h3 h6 Kh2 fxg2 Rg6 Bf3 Rg3 Qa8 Qe3 Rf7 c4 Qxa7 

; 00:02:01.6  34... Score: 0,42   depth: 17 e2 Re1 f3 Rg4 Qd8 Qg5 Qxg5 Rxg5 Rd8 Ra5 fxg2 f3 Bxf3 Raa1 Be5 Rxe2 Bxe2 a8Q Rxa8 Rxa8+ Kg7 Kxg2 h6 Ra5 Kf6 Kf2 Bc4 

; Analysis completed

This is Cyclone Extreme after ...e2 being played

Code: Select all

00:00:00.0	1,72	1	2	Ra1 
00:00:00.0	1,77	1	5	Re1 
00:00:00.0	1,53	2	371	Re1 Qa6 
00:00:00.0	1,34	3	830	Re1 f3 Rh5 
00:00:00.0	1,01	4	1840	Re1 f3 h4 Qa6 
00:00:00.0	0,95	5	4814	Re1 f3 h4 Bc6 h5 
00:00:00.0	0,77	6	12971	Re1 f3 g3 Be4 Kh1 Qe6 
00:00:00.1	0,82	7	24412	Re1 f3 g3 Bh6 Rh5 Bd2 Qc7 
00:00:00.2	0,67	8	59709	Re1 f3 h3 Bh6 Rh5 Rg8 Rf5 Qh4 Qe5+ Bg7 

00:00:00.5	0,33	9	161216	Re1 f3 h3 Bh6 h4 Be4 Qd4 Qxd4 cxd4 Bxg5 hxg5 Kg7 gxf3 Bxf3 

00:00:02.3	0,13	10	849505	Re1 f3 h3 Bh6 h4 Bc6 b4 fxg2 Rxe2 Rd8 Re1 Bxg5 hxg5 Qf4 

00:00:03.3	0,00	11	1193244	Re1 f3 Rg4 Rd8 Rd4 Rxd4 cxd4 Qd8 gxf3 Bxd4 Qf5 Qg8+ Kh1 Bxf2 Qe5+ Qg7 Qe8+ Qg8 Qe5+ 

00:00:04.9	0,00	12	1744899	Re1 f3 Rg4 Rd8 Rd4 Rxd4 cxd4 Qd8 gxf3 Bxd4 Qf5 Qg8+ Kh1 Bxf2 Qe5+ Qg7 Qe8+ Qg8 Qe5+ 

00:00:07.2	0,00	13	2551440	Re1 f3 Rg4 Rd8 Rd4 Rxd4 cxd4 Qd8 gxf3 Bxd4 Qf5 Qg8+ Kh1 Bxf2 Qe5+ Qg7 Qe8+ Qg8 Qe5+ 

00:00:45.2	-0,61	14	18354945	Re1 f3 Rg4 Qd8 Qg5 Bf6 Qc5 Re8 Qh5 fxg2 Rf4 Re7 Qf5 Rf7 Rg4 Rxa7 Rxe2 

00:01:05.5	-0,71	15	26142748	Re1 f3 Rg4 Qd8 Rxg7 Kxg7 Qe5+ Qf6 Qc7+ Kg8 g3 Rd8 Qc4+ Kh8 Qc7 Be4 Kh1 Rd1 Qc8+ Rd8 

00:01:37.9	-0,51	16	38895502	Re1 f3 Rg4 Qd8 h3 Re8 Qg5 Be5 Qxd8 Rxd8 Rc4 fxg2 Rc5 Rd1 Rc8+ Kg7 Rxa8 Rxe1+ Kxg2 Ra1 c4 

00:02:30.5	-0,31	17	58354185	Re1 f3 Rg4 Qd8 h3 Re8 Qg5 Be5 g3 Qd1 Qg7+ Bxg7 Re4 

00:02:33.1	-0,31	17	59310000	Re1 f3 Rg4 Qd8 h3 Re8 Qg5 Be5 g3 Qd1 Qg7+ Bxg7 Re4 

There scores are reversed, but not exactly the same (I cleared the hash and use only 1 cpu, turned off Cyclone Dynamic Hash so these aren't the reason for it). Maybe their internal bonus for contempt or bonus for side to move??