Principal Variation Search and MultiPV

Discussion of chess software programming and technical issues.

Moderator: Ras

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

Re: Principal Variation Search and MultiPV

Post by hgm »

Ras wrote: Fri Oct 08, 2021 8:23 pm
hgm wrote: Thu Oct 07, 2021 5:13 pmI would not be much interested in the second-best move if it loses a Rook compared to the best...
I would because I like to see how much worse the lines are. Like in, "I have good two moves, but all others will lose the game." And sure, if there are fewer legal moves than requested PV lines, the engine returns fewer. That's how e.g. Stockfish does it.
If I want to know that, I just set a margin large enough to qualify as a certain loss. If only a single moves scores above it (and consequently will be shown) I know that all others lose the game.
User avatar
Ras
Posts: 2703
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Principal Variation Search and MultiPV

Post by Ras »

hgm wrote: Fri Oct 08, 2021 11:17 pmIf only a single moves scores above it (and consequently will be shown) I know that all others lose the game.
Not quite. Especially in winning endgames, there's often only one winning move, but the others don't lose - they draw. When I find that I would have thrown away the win with a move that looked good to me, so I wonder why my choice would have drawn and analyse that.

Besides, displaying fewer PVs when the position just doesn't have as many legal moves is rooted in chess itself so that every user understands that, but reducing PVs to to a fail-low margin is an artifact of alpha-beta-search. The consequence is that at lower depth, it may look like there is only one move that e.g. wins, but then at higher depth, it turns out that this is a trap, and the position isn't even won at all, and then you'd end up with the PV number jumping back and forth. To the user, this would just look buggy.
Rasmus Althoff
https://www.ct800.net
User avatar
hgm
Posts: 28395
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Principal Variation Search and MultiPV

Post by hgm »

I don't get it. When you bungled a win with a certain move, and wonder why that move didn't win, you analyze the position after the move. Usually there are many moves that draw in a drawn end-game that you just bungled, and if the engine can really see that, even a tiny multi-PV margin would show a large number of moves, all with score 0. If you fix the number of lines, the engine would show you a random selection of those. You consider that better??? If the engine doesn't see the draw, it will distinguish 'good' drawing moves from 'poor' drawing moves, and only show you the 'best' N drawing moves, or an undetermined number of moves that do not draw too much worse than the best draw move. Which all seems a bit non-sensical...

As to looking buggy... I don't see why. In fact I consider it silly when it shows lines that are not worth considering. And yes, engines can change their mind, with increasing depth. You might as well argue that because of that they shouldn't show any lines before they reach the ultimate depth, because changing the PV move will look buggy to the user.