Page 1 of 1

UCI multiPV specification question

Posted: Thu Jan 03, 2019 5:23 pm
by elcabesa
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?

Re: UCI multiPV specification question

Posted: Thu Jan 03, 2019 5:44 pm
by hgm
I would be surprised if there was any GUI that required you to add artificial dummy PVs just to get the requested number.

Re: UCI multiPV specification question

Posted: Thu Jan 03, 2019 5:49 pm
by syzygy
elcabesa wrote: Thu Jan 03, 2019 5: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.

Re: UCI multiPV specification question

Posted: Thu Jan 03, 2019 6:08 pm
by elcabesa
this was my interpretation too, but since I have only used Arena as Giu, i don't know if there are some other interpretations

Re: UCI multiPV specification question

Posted: Thu Jan 03, 2019 10:46 pm
by hgm
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.

Re: UCI multiPV specification question

Posted: Thu Jan 03, 2019 11:37 pm
by Ras
elcabesa wrote: Thu Jan 03, 2019 5:23 pmWhat 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.

Re: UCI multiPV specification question

Posted: Fri Jan 04, 2019 10:37 am
by elcabesa
Thank you all :P