Stockfish MateFinder Update

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

kgburcham
Posts: 2016
Joined: Sun Feb 17, 2008 4:19 pm

Re: Stockfish MateFinder Update

Post by kgburcham »

[D] r2q1r2/1b2bpkp/n3p1p1/2ppP1P1/p6R/1PN1BQR1/NPP2P1P/4K3 w - -

Engine: Houdini 4 Pro x64 (8192 MB)
by Robert Houdart

20/58 0:50 -0.19++ 1.Qf6+ (1.068.303.025) 21232
20/58 0:50 -0.03++ 1.Qf6+ (1.072.006.101) 21234
other best move - reduce depth to 17
17/58 0:50 +0.31++ 1.Qf6+ (1.072.988.498) 21234
17/58 0:50 +1.48++ 1.Qf6+ (1.074.653.574) 21233
17/64 0:53 +4.40 1.Qf6+ Bxf6 2.gxf6+ Qxf6 3.exf6+ Kxf6 4.Bg5+ Kg7 5.Bh6+ Kg8 6.Bxf8 axb3 7.Bd6 bxa2 8.Nxa2 d4 9.b4 Rc8 10.b5 Nc7 11.Bxc7 Rxc7 12.Nc1 Bd5 13.Nd3 e5 14.Rgh3 (1.145.781.430) 21222

Engine: Sting SF 6.7 64bit (8192 MB)
by Tord Romstad, Marco Costalba, Joona Kii

31.09 3:34 -0.16++ 1.Qf6+ (2.823.067.755) 13150
31.01 3:34 -0.08++ 1.Qf6+ (2.823.886.964) 13150
31.01 3:35 +0.04++ 1.Qf6+ (2.828.931.091) 13149
31.01 3:35 +0.22++ 1.Qf6+ (2.832.592.389) 13148
31.01 3:35 +0.49++ 1.Qf6+ (2.834.731.137) 13147
31.01 3:36 +0.90++ 1.Qf6+ (2.840.702.449) 13145
31.01 3:36 +1.51++ 1.Qf6+ (2.845.667.113) 13146
31.01 3:41 +2.42++ 1.Qf6+ (2.921.284.116) 13159
31.01 3:51 +3.79++ 1.Qf6+ (3.068.037.802) 13237
no chess program was born totally from one mind. all chess programs have many ideas from many minds.
tpoppins
Posts: 919
Joined: Tue Nov 24, 2015 9:11 pm
Location: upstate

Re: Stockfish MateFinder Update

Post by tpoppins »

zullil wrote:I was simply curious if (ordinary) Stockfish could solve the problem, albeit with powerful hardware.
SF6 can see it on upper mid-range h/w (11 threads) @d=40/59. This is an old position that all top engines have been able to solve for a (long) while.

[d]r2q1r2/1b2bpkp/n3p1p1/2ppP1P1/p6R/1PN1BQR1/NPP2P1P/4K3 w - - 0 1

Code: Select all

Analysis by Stockfish 6 64 POPCNT:

<...>
1.bxa4 
  =  (-0.08 ++)   Depth&#58; 40/59   00&#58;28&#58;48  20480MN, tb=2617
1.Qf6+ 
  =  &#40;0.12 ++)   Depth&#58; 40/59   00&#58;29&#58;38  21113MN, tb=2859
1.Qf6+ 
  +/=  &#40;0.43 ++)   Depth&#58; 40/59   00&#58;29&#58;42  21158MN, tb=2864
1.Qf6+ 
  +/-  &#40;0.90 ++)   Depth&#58; 40/59   00&#58;29&#58;48  21227MN, tb=2864
1.Qf6+ 
  +/-  &#40;1.60 ++)   Depth&#58; 40/59   00&#58;29&#58;58  21366MN, tb=2875
1.Qf6+ 
  +-  &#40;2.65 ++)   Depth&#58; 40/59   00&#58;30&#58;16  21580MN, tb=2880
1.Qf6+ Bxf6 2.gxf6+ Qxf6 3.exf6+ Kxf6 4.Bg5+ Kg7 5.Bh6+ Kg8 6.Bxf8 axb3 7.Bd6 bxa2 8.Ra4 Rd8 9.Be5 Nb4 10.Nxa2 Nxc2+ 11.Kd2 Nd4 12.Bxd4 cxd4 13.Ra7 Bc6 14.Nb4 Bb5 15.Rb7 Be8 16.Ra3 Kg7 17.Kd3 e5 18.f4 exf4 19.Kxd4 g5 20.Nd3 Kf6 21.b4 Kf5 22.b5 g4 23.Re7 Kf6 24.Raa7 g3 25.hxg3 fxg3 26.b6 g2 
  +-  &#40;3.74&#41;   Depth&#58; 40/74   00&#58;40&#58;29  29696MN, tb=5822
User avatar
yurikvelo
Posts: 710
Joined: Sat Dec 06, 2014 1:53 pm

Re: Stockfish MateFinder Update

Post by yurikvelo »

If I correct understand - MateFinder is beneficial IF AND ONLY regular engine hit +123.
If engine didn't reach +123, MateFinder will reach even less depth
User avatar
Nordlandia
Posts: 2821
Joined: Fri Sep 25, 2015 9:38 pm
Location: Sortland, Norway

Re: Stockfish MateFinder Update

Post by Nordlandia »

yurikvelo wrote:If I correct understand - MateFinder is beneficial IF AND ONLY regular engine hit +123.
If engine didn't reach +123, MateFinder will reach even less depth
Yuri, - do you know what the parameter "study" is?
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Stockfish MateFinder Update

Post by zullil »

Nordlandia wrote:What happends if i checkmark "Study" parameter?
From search.cpp:

Code: Select all

   if &#40;study && ss->ply < depth / 2 - ONE_PLY&#41;
              r = DEPTH_ZERO;
So it seems that if Study is checked, then late move reductions are effectively disabled "early" in each iteration of the search. At least that's my interpretation, not being very familiar with the Stockfish code.
jhellis3
Posts: 546
Joined: Sat Aug 17, 2013 12:36 am

Re: Stockfish MateFinder Update

Post by jhellis3 »

If I correct understand - MateFinder is beneficial IF AND ONLY regular engine hit +123.
No... But I am sure most people who actually use it can see the differences for themselves quickly enough...
tpoppins
Posts: 919
Joined: Tue Nov 24, 2015 9:11 pm
Location: upstate

Re: Stockfish MateFinder Update

Post by tpoppins »

[d]r2q1r2/1b2bpkp/n3p1p1/2ppP1P1/p6R/1PN1BQR1/NPP2P1P/4K3 w - - 0 1

Code: Select all

Analysis by SF MF110416 64 POPCNT&#58;

<snip>

1.bxa4 d4 2.Qxb7 dxe3 3.Ne4 Nc7 4.Rxe3 Rxa4 5.Ra3 Rxa3 6.Nf6 h5 7.bxa3 Nd5 8.Ra4 Bxf6 9.gxf6+ Kh7 10.Ra7 Nf4 11.Qe7 Qb8 12.Qd6 Qb1+ 13.Kd2 Qxa2 14.Qxf8 Qd5+ 15.Kc1 Ne2+ 16.Kb2 Qd4+ 17.Kb1 Qd1+ 18.Ka2 Qxc2+ 19.Ka1 Qc1+ 20.Ka2 Qc2+ 
  =  &#40;0.00&#41;   Depth&#58; 38/64   00&#58;32&#58;58  25144MN, tb=16057
1.Qf6+ 
  =  &#40;0.06 ++)   Depth&#58; 39/64   00&#58;39&#58;55  30302MN, tb=27874
1.Qf6+ 
  =  &#40;0.13 ++)   Depth&#58; 39/64   00&#58;41&#58;11  31234MN, tb=28499
<lots of fail-highs snipped>
1.Qf6+ Bxf6 2.gxf6+ Qxf6 3.Bh6+ Kg8 4.exf6 d4 5.Bg7 h5 6.Rgh3 Kh7 7.Ne2 e5 8.Ng3 Bf3 9.Bxf8 Rxf8 10.Ne4 axb3 11.cxb3 Bxe4 12.Rxe4 Re8 13.f4 Rb8 14.Rxe5 Rb6 15.Nc1 Rxf6 16.Nd3 Kh6 17.Nxc5 Nxc5 18.Rxc5 Rxf4 19.b4 d3 20.b5 Rb4 21.Rxd3 Rxb2 22.Rd2 Rb1+ 23.Kf2 Kg7 24.Rd6 
  +-  &#40;5.27&#41;   Depth&#58; 39/74   01&#58;10&#58;31  53537MN, tb=42598
Takes 10 minutes (33%) longer than vanilla SF6 to find Qf6+, and a full 30 min (75%) longer to resolve a winning PV (the ipman compile linked earlier in the thread was used)

Perhaps the Study mode is the way to go?

Code: Select all

<snip>
1.bxa4 Qd7 2.Bd2 Rh8 3.Nb5 d4 4.Qf4 Kg8 5.Nd6 Bxd6 6.exd6 e5 7.Qf6 Re8 8.Rgh3 h5 9.gxh6 Rh7 10.Bg5 Bg2 11.Qg7+ Rxg7 12.hxg7 Qxh3 13.d7 Ra8 14.Rxh3 Bxh3 15.d8Q+ Rxd8 16.Bxd8 Kxg7 17.Nc1 f6 18.Kd2 Kf7 19.b3 Bf5 20.c3 Be6 21.a5 Bd5 22.Bb6 Ke6 23.Nd3 Kd6 24.Bd8 Ke6 25.Bb6 
  =  &#40;0.00&#41;   Depth&#58; 38/66   00&#58;31&#58;09  22885MN, tb=6307
1.bxa4 d4 2.Qxb7 dxe3 3.Ne4 exf2+ 4.Kxf2 Nc7 5.Rd3 Nd5 6.Nf6 h5 7.b3 Qa5 8.Nxd5 Bxg5 9.Rc4 exd5 10.Qxd5 Rad8 11.Qxc5 Qa8 12.Qc6 Qa5 13.Qc5 
  =  &#40;0.00&#41;   Depth&#58; 39/66   00&#58;45&#58;40  33815MN, tb=46792
1.Qf6+ 
  =  &#40;0.06 ++)   Depth&#58; 40/66   00&#58;55&#58;47  41423MN, tb=70525
Cf. Houdini 4 Pro Tactical:

Code: Select all

<snip>

1.bxa4 
  =  (-0.16 ++)   Depth&#58; 20/65   00&#58;00&#58;43  704MN
1.bxa4 Qd7 2.Bd2 Rh8 3.b3 Kg8 4.Rgh3 h5 5.gxh6 Bxh4 6.Rxh4 Rh7 7.Qf4 Bc6 8.Kf1 Rb8 9.Kg1 Kf8 10.Rg4 d4 11.Ne4 Bxe4 12.Qxe4 Nc7 13.a5 Nd5 14.a6 Ra8 
  =  (-0.21&#41;   Depth&#58; 20/65   00&#58;00&#58;53  903MN
1.Qf6+ 
  =  &#40;0.00 ++)   Depth&#58; 20/72   00&#58;01&#58;13  1279MN
1.Qf6+ 
  +/=  &#40;0.35 ++)   Depth&#58; 20/72   00&#58;01&#58;13  1280MN
1.Qf6+ 
  +/-  &#40;1.53 ++)   Depth&#58; 20/72   00&#58;01&#58;13  1282MN
1.Qf6+ Bxf6 2.gxf6+ Qxf6 3.exf6+ Kxf6 4.Bg5+ Kg7 5.Bh6+ Kg8 6.Bxf8 axb3 7.Bd6 bxa2 8.Nxa2 Kg7 9.Rb3 Bc6 10.Rb6 Bd7 11.Nc1 g5 12.Rg4 h6 13.Nd3 c4 14.Ne5 f5 15.Rg1 
  +-  &#40;4.37&#41;   Depth&#58; 20/72   00&#58;01&#58;20  1399MN
Is this a case of picking the wrong tool for the job? Is SFMF only suitable for "find-mate-in-x-moves" puzzles? If yes, what is the upperbound on the x?

A comment on Luis' attempt to interpret what the Study mode does would be nice, too.
jhellis3
Posts: 546
Joined: Sat Aug 17, 2013 12:36 am

Re: Stockfish MateFinder Update

Post by jhellis3 »

Is this a case of picking the wrong tool for the job? Is SFMF only suitable for "find-mate-in-x-moves" puzzles?
No, it is just an example of a chess position which is very difficult for strong engines to resolve. This is due to the rook sac which is also necessary after the queen sac in order to complete both mate threats, which forces black to return the queen in order to avoid mate.

The second mate threat is a mate in 10, so the fact that Houdini finds it at depth 20 (without sacrificing tons of Elo) is quite remarkable. From the output, I can guess this is achieved with some extension heuristic. Though what that heuristic is, I have no idea. All I can say is RH is certainly more clever than I am in this regard. If you have code which can improve the results of SF without sacrificing Elo, I am more than happy to implement it...
Is SFMF only suitable for "find-mate-in-x-moves" puzzles?
Only you can answer what SFMF is suitable for in your situation. As for what kind of chess SFMF plays, you might have it play a match against SF6 and H4 in order to see...
If yes, what is the upperbound on the x?
Mate in 64 full moves is the best it can currently do.
A comment on Luis' attempt to interpret what the Study mode does would be nice, too.
Study mode is intended (as the name suggests), for studies which SFMF can not solve otherwise. It should not be left on, and is not suitable for general play.
User avatar
Nordlandia
Posts: 2821
Joined: Fri Sep 25, 2015 9:38 pm
Location: Sortland, Norway

Re: Stockfish MateFinder Update

Post by Nordlandia »

It seems Matefinder have to convert the already known Syzygy win to mate.

[d]6K1/8/8/1P4p1/8/8/7p/5B1k w - - 0 1

So i presume using Nalimov DTM is the better combo right?
jhellis3
Posts: 546
Joined: Sat Aug 17, 2013 12:36 am

Re: Stockfish MateFinder Update

Post by jhellis3 »

Certainly, if you have a version of SF which supports 6man nalimov TBs, you can use that :).