UCI multiPV specification question

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
elcabesa
Posts: 806
Joined: Sun May 23, 2010 11:32 am
Contact:

UCI multiPV specification question

Post by elcabesa » Thu Jan 03, 2019 4:23 pm

I was reading UCI specifications some days ago trying to improve Vajolet compliance and a doubt arise when reading MULTIPV specification.
in the spec this is all I can find about MultiPV:
* multipv
this for the multi pv mode.
for the best move/pv add "multipv 1" in the string when you send the pv.
in k-best mode always send all k variants in k strings together.
* = MultiPV, type spin
the engine supports multi best line or k-best mode. the default value is 1
it says to send all the K best moves together, but what if in a position with only 3 legal moves multiPV is set to 12?
The implementation of the engines I know is to send the info only for the 3 legal moves, and the GUI I know ( mostly arena ) accept few lines than the specified amount without too much problems.
A solution that came to my mind was to send 12 lines to the gui with the PV set at 0000.
info multipv 4 depth 0 pv 0000 score cp 0
What is the general consensus in this case?
There are some GUI that implement multiPV in a strict way, and what is it?

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

Re: UCI multiPV specification question

Post by hgm » Thu Jan 03, 2019 4:44 pm

I would be surprised if there was any GUI that required you to add artificial dummy PVs just to get the requested number.

syzygy
Posts: 4450
Joined: Tue Feb 28, 2012 10:56 pm

Re: UCI multiPV specification question

Post by syzygy » Thu Jan 03, 2019 4:49 pm

elcabesa wrote:
Thu Jan 03, 2019 4:23 pm
it says to send all the K best moves together, but what if in a position with only 3 legal moves multiPV is set to 12?
The implementation of the engines I know is to send the info only for the 3 legal moves, and the GUI I know ( mostly arena ) accept few lines than the specified amount without too much problems.
A solution that came to my mind was to send 12 lines to the gui with the PV set at 0000.
Your solution does not seem to be UCI compliant, since the specification says nothing about PVs "set at 0000". It is also certain to confuse many GUIs.

I agree with you that the UCI specification is worded too loosely, but the solution adopted by most (if not all) GUIs and engines seems to be the most reasonable interpretation: if MultiPV=12 and there are just 3 legal moves, send 3 lines.

elcabesa
Posts: 806
Joined: Sun May 23, 2010 11:32 am
Contact:

Re: UCI multiPV specification question

Post by elcabesa » Thu Jan 03, 2019 5:08 pm

this was my interpretation too, but since I have only used Arena as Giu, i don't know if there are some other interpretations

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

Re: UCI multiPV specification question

Post by hgm » Thu Jan 03, 2019 9:46 pm

All I can say is that it should not be a problem for the UCI2WB adapters I know, as CECP doesn't have any restriction on the number of PVs you would sent in any situation (and indeed many engines do send multiple PVs even in single PV mode, when they overturn a previous PV). So they simply pass along to the GUI any PV+info the engine spits out that was not passed along already.

Ras
Posts: 1142
Joined: Tue Aug 30, 2016 6:19 pm
Contact:

Re: UCI multiPV specification question

Post by Ras » Thu Jan 03, 2019 10:37 pm

elcabesa wrote:
Thu Jan 03, 2019 4:23 pm
What is the general consensus in this case?
Send as many PVs as legally possible and drop the rest. Just tested that situation with Shredder, which should be a reference UCI implementation, and it behaves this way.
Rasmus Althoff
https://www.ct800.net

elcabesa
Posts: 806
Joined: Sun May 23, 2010 11:32 am
Contact:

Re: UCI multiPV specification question

Post by elcabesa » Fri Jan 04, 2019 9:37 am

Thank you all :P

Post Reply