MutliPV behavior?

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

User avatar
Ovyron
Posts: 1948
Joined: Tue Jul 03, 2007 2:30 am

MutliPV behavior?

Post by Ovyron » Thu Jan 25, 2018 3:47 am

Back in the times of Rybka 3, the best behavior for MultiPV was very clear, and standard among the engines that implemented it:

-If the move fails low, sit tight, and resolve it.

Eventually, more and more engines started to check all alternative moves on a fail low, and would move one as best if they found it was better, with the best move just disappearing not allowing the user to know what happened to it, sometimes only to resurface later, again, as best, if a fail high after the fail low happened.

I have also seen the engine just switching moves on losing positions that keep failing and never giving a score to them until later which seems to lose time.

This behavior might be the best for finding the best move ASAP, in games (after all, it must bring elo or programmers wouldn't have switched to it), but in analysis, with the purpose of MultiPV being to give the user a list of the best moves and their scores to the user, I think this is suboptimal.

I even suggested Vas to implement the "Always score main move" feature to Rybka, so that it would behave like this ("sit tight" on fail lows), and it has survived up to Fritz 16.

What do you think? Is this new behavior as bad as it sounds? Or is it actually better and only gives the illusion of being bad? (since it's best at SinglePV, maybe it also finds best moves faster for alternative line, but looks sloppy.)

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

Re: MutliPV behavior?

Post by elcabesa » Thu Jan 25, 2018 7:20 am

I don't understand what you mean by "more and more engine",
My engine and stockfish resolve the fail low/high before moving to any other move when analizyng in multiPV mode.

what is your experience?

User avatar
Ovyron
Posts: 1948
Joined: Tue Jul 03, 2007 2:30 am

Re: MutliPV behavior?

Post by Ovyron » Thu Jan 25, 2018 7:37 am

elcabesa wrote: stockfish resolve the fail low/high before moving to any other move when analizyng in multiPV mode.
No, it doesn't, you can check on the part of the GUI that shows what move is being analysed, like this:

#/*

Where * is the total number of moves, and # is the number of the move being analyzed.

For a position with 30 available moves, when Stockfish is starting the iteration, it reads:

1/30

Now, pay attention, and you may see the 1 quickly cycling through 2-30. If you stop the engine at that time, Stockfish will show the fail low. If any of the moves 2-30 are better, Stockfish will silently switch to it, and it will appear as new best (i.e. it becomes the 1/30 move.)

Stockfish just hides the fail low on MultiPV, so the user doesn't even know it happened on the output.

All Stockfish derivatives behave like this.

AndrewGrant
Posts: 281
Joined: Tue Apr 19, 2016 4:08 am
Contact:

Re: MutliPV behavior?

Post by AndrewGrant » Thu Jan 25, 2018 8:15 am

I can tell you from SF source every search is resolved. If you stop the search midway, then what you are seeing is not SF failing to resolve something.

You are seeing SF print partial results

https://github.com/official-stockfish/S ... h.cpp#L401

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

Re: MutliPV behavior?

Post by elcabesa » Thu Jan 25, 2018 8:22 am

what you see are intermediate results.


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 ....

User avatar
Ovyron
Posts: 1948
Joined: Tue Jul 03, 2007 2:30 am

Re: MutliPV behavior?

Post by Ovyron » Thu Jan 25, 2018 8:31 am

elcabesa wrote:what you see are intermediate results.
That's not what I'm seeing, Stockfish is doing the "2 to 30" thing before assigning the main move a score, and it's always on fail low.

It's weird that we can't agree on how it behaves, do I really have to make a video about what I see?

Try to do this:

Let Stockfish reach depth 29, so the "2 to 30" isn't as fast.

If at depth 30 Stockfish just outputs a score for the first move, it did't fail low, try again with some other position.

Now, if it does, stop the engine in the middle of "2 to 30", Stockfish would show the fail now.

Note that this would be impossible if the "2 to 30" happened after Stockfish already gave a score to the first move, and it wouldn't show a fail low because it already knows the first move's score.

Please, instead of looking at the code and telling me this is impossible, try it for yourself, I managed to reproduce it first try.

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

Re: MutliPV behavior?

Post by elcabesa » Thu Jan 25, 2018 8:38 am

please, show us what do you mean because we haven't understood.

give us a reproducible example, with reproducible step and maybe some screenshot of what you thins is worng.

thank you

AndrewGrant
Posts: 281
Joined: Tue Apr 19, 2016 4:08 am
Contact:

Re: MutliPV behavior?

Post by AndrewGrant » Thu Jan 25, 2018 8:39 am

If you are stopping Stockfish in the middle of an iteration, you are most certainly seeing intermediate results, which are reported here

https://github.com/official-stockfish/S ... h.cpp#L401

You are either seeing partial results because SF reports the fail highs/lows when 3 seconds have passed, OR you are seeing a partial result because stopping the search has set Threads.stop to be true.

If you delete the time condition and the Threads.stop condition you will no longer see the behavior you are seeing.

abulmo2
Posts: 131
Joined: Fri Dec 16, 2016 10:04 am
Contact:

Re: MutliPV behavior?

Post by abulmo2 » Thu Jan 25, 2018 8:59 am

Not sure to understand. Is that what you want: when a new iteration is started, always display the score of the previous best move, even if it is no more the best move, or in case of multiPV search, one of the k-best moves ?
Richard Delorme

User avatar
Ovyron
Posts: 1948
Joined: Tue Jul 03, 2007 2:30 am

Re: MutliPV behavior?

Post by Ovyron » Thu Jan 25, 2018 9:07 am

elcabesa wrote:give us a reproducible example, with reproducible step and maybe some screenshot of what you thins is worng.
Did you try the steps I posted? What did you see?

It's useles for me to post reproducible example with reproducible step if people aren't even trying...

IN MULTIPV STOCKFISH IS CHECKING ALTERNATIVE MOVES BEFORE GIVING A SCORE TO THE MAIN MOVE IN FAIL LOWS

Please, try it in some position and tell me you see differently.

Post Reply