## Stockfish MateFinder Update

**Moderators:** bob, hgm, Harvey Williamson

**Forum rules**

This textbox is used to restore diagrams posted with the [d] tag before the upgrade.

### Re: Stockfish MateFinder Update

[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

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.

### Re: Stockfish MateFinder Update

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.zullil wrote:I was simply curious if (ordinary) Stockfish could solve the problem, albeit with powerful hardware.

[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: 40/59 00:28:48 20480MN, tb=2617
1.Qf6+
= (0.12 ++) Depth: 40/59 00:29:38 21113MN, tb=2859
1.Qf6+
+/= (0.43 ++) Depth: 40/59 00:29:42 21158MN, tb=2864
1.Qf6+
+/- (0.90 ++) Depth: 40/59 00:29:48 21227MN, tb=2864
1.Qf6+
+/- (1.60 ++) Depth: 40/59 00:29:58 21366MN, tb=2875
1.Qf6+
+- (2.65 ++) Depth: 40/59 00:30: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
+- (3.74) Depth: 40/74 00:40:29 29696MN, tb=5822
```

### Re: Stockfish MateFinder Update

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

If engine didn't reach +123, MateFinder will reach even less depth

- Nordlandia
**Posts:**2631**Joined:**Fri Sep 25, 2015 7:38 pm**Location:**Sortland, Norway

### Re: Stockfish MateFinder Update

Yuri, - do you know what the parameter "study" is?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

### Re: Stockfish MateFinder Update

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

Code: Select all

```
if (study && ss->ply < depth / 2 - ONE_PLY)
r = DEPTH_ZERO;
```

### Re: Stockfish MateFinder Update

No... But I am sure most people who actually use it can see the differences for themselves quickly enough...If I correct understand - MateFinder is beneficial IF AND ONLY regular engine hit +123.

### Re: Stockfish MateFinder Update

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

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?

Cf. Houdini 4 Pro Tactical:

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.

Code: Select all

```
Analysis by SF MF110416 64 POPCNT:
<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+
= (0.00) Depth: 38/64 00:32:58 25144MN, tb=16057
1.Qf6+
= (0.06 ++) Depth: 39/64 00:39:55 30302MN, tb=27874
1.Qf6+
= (0.13 ++) Depth: 39/64 00:41: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
+- (5.27) Depth: 39/74 01:10:31 53537MN, tb=42598
```

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.Qf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 1399MN
```

A comment on Luis' attempt to interpret what the Study mode does would be nice, too.

### Re: Stockfish MateFinder Update

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.Is this a case of picking the wrong tool for the job? Is SFMF only suitable for "find-mate-in-x-moves" puzzles?

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

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...Is SFMF only suitable for "find-mate-in-x-moves" puzzles?

Mate in 64 full moves is the best it can currently do.If yes, what is the upperbound on the x?

Study mode is intended (as the name suggests), forA comment on Luis' attempt to interpret what the Study mode does would be nice, too.

*studies*which SFMF can not solve otherwise. It should not be left on, and is not suitable for general play.

- Nordlandia
**Posts:**2631**Joined:**Fri Sep 25, 2015 7:38 pm**Location:**Sortland, Norway

### Re: Stockfish MateFinder Update

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?

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

So i presume using Nalimov DTM is the better combo right?

### Re: Stockfish MateFinder Update

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