Score to Mate vagueries

Discussion of chess software programming and technical issues.

Moderator: Ras

stevenaaus
Posts: 613
Joined: Wed Oct 13, 2010 9:44 am
Location: Australia

Score to Mate vagueries

Post by stevenaaus »

How come engines sometime/often dont give the whole mating PV ?

Here's my test pos
[d]2BQ4/pb2N3/1p3n2/1kp5/3P4/8/PPP2PPP/R5K1 b - - 2 28
So when Critter sends a line like this

Code: Select all

info multipv 1 depth 28 seldepth 27 nodes 85745410 time 9125 nps 9396757 hashfull 994 tbhits 0 score mate -6 pv b7a8 a2a4 b5b4 d4c5 a8d5 e7d5 b4c5 d5f6 c5c6 f6e4 b6b5 
but omits the final "d8d6" (even though it reports "score mate -6")

Why doesnt the engine always show the mating move in pv ?

1.e4 d5 2.exd5 Qxd5 3.Nc3 Qe6+ 4.Be2 Qd7 5.Nf3 e6 6.d4 f6 7.O-O Bb4 8.Ne4 f5 9.Ne5 Qe7 10.Bh5+ g6 11.Nxg6 hxg6 12.Bxg6+ Kd8 13.Bg5 Qxg5 14.Nxg5 Bd6 15.Nf7+ Ke7 16.Nxh8 Nd7 17.Qh5 Ndf6 18.Qg5 c5 19.Rfe1 b6 20.Bxf5 Bb7 21.Qg7+ Ke8 22.Rxe6+ Be7 23.Ng6 Rd8 24.Qf8+ Kd7 25.Rxe7+ Kc6 26.Qxd8 Nxe7 27.Nxe7+ Kb5 28.Bc8 1-0
lucasart
Posts: 3243
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Score to Mate vagueries

Post by lucasart »

stevenaaus wrote:How come engines sometime/often dont give the whole mating PV ?
The full list of reasons is complex and varies from enging to engine. But a typical reason that probably affects most engines is TT pruning in PV nodes. Not doing it loses (a little bit of) elo, but doing it means printing truncated PVs sometimes.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
User avatar
Bloodbane
Posts: 154
Joined: Thu Oct 03, 2013 4:17 pm

Re: Score to Mate vagueries

Post by Bloodbane »

In my engine mate distance pruning causes that behaviour, for example in the position [d] rq2r3/5pk1/p7/4b1P1/1p2P2P/5Q2/PP4K1/5R1R w - -

without mate distance pruning we get

info depth 12 score mate 7 time 812 nodes 1960007 nps 2413000 pv f3f7 g7h8 f7h5 h8g8 f1f7 e5g7 g5g6 g7h6 h5h6 b8g3 g2g3 e8e4 h6h7

but with mate distance pruning we get

info depth 12 score mate 7 time 721 nodes 1768462 nps 2452000 pv f3f7 g7h8 f7h5 h8g8 f1f7 e5g7 g5g6 g7h6 h5h6 b8g3 g2g3 e8e4
Functional programming combines the flexibility and power of abstract mathematics with the intuitive clarity of abstract mathematics.
https://github.com/mAarnos
User avatar
hgm
Posts: 28457
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Score to Mate vagueries

Post by hgm »

The funny thing is that with engines that extract the PV out of the hash table after the search, you can have the opposite effect. Joker often gave a non-mate-score, and then a PV that ended in checkmate!
stevenaaus
Posts: 613
Joined: Wed Oct 13, 2010 9:44 am
Location: Australia

Re: Score to Mate vagueries

Post by stevenaaus »

Ok, thanks. I'm fixing up Scid vs. PC's depth-based engine annotation, and just noticed this Score to Mate issue.

Scid converts the PV to San and looks for a trailing "#" to determine whether to use "[M3]" or "[score]"

If i just go by the info's "score mate 3" instead, i run into the problem that people see "[M3]" and click Add Variation, but the new line may not result in mate
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: Score to Mate vagueries

Post by Michel »

I may also be because the mate happens in quiescence search (and the pv is not recorded in quiescence search), combined with mate distance pruning.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Score to Mate vagueries

Post by bob »

lucasart wrote:
stevenaaus wrote:How come engines sometime/often dont give the whole mating PV ?
The full list of reasons is complex and varies from enging to engine. But a typical reason that probably affects most engines is TT pruning in PV nodes. Not doing it loses (a little bit of) elo, but doing it means printing truncated PVs sometimes.
There is a well-known solution to solve this without giving up exact TT matches along the PV. See Crafty as one example.