Surprisingly difficult stalemate problem (for some engines)

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

Moderators: hgm, Rebel, chrisw

Warp
Posts: 9
Joined: Sun May 15, 2016 9:20 am

Surprisingly difficult stalemate problem (for some engines)

Post by Warp »

One day I was running a Spike 1.4 vs. Stockfish 6 with moderate time controls (40 moves in 20 minutes), and by move 67 Stockfish was clearly ahead (eval over +6 for black). Then, suddenly, and surprisingly, Spike, playing white, stalemated the game in just a few moves. Stockfish completely failed to see the stalemate and avoid it.

The crucial point in the game was this (white to play and stalemate):

[d]8/5R2/1p2p1pk/p6p/P2R3P/8/r5r1/7K w - - 0 68

It turns out that for some engines (including Stockfish), it's surprisingly hard to see the stalemate, while for other engines (such as Spike) it's very easy. When I analyze that position with several engines, using 4 threads on an i5, it takes on average about this much for them to see the stalemate (it can vary quite a lot between runs):

- Stockfish (even very recent versions): Between 2 and 8 minutes.
- Texel 1.02: Between 1 and 8 minutes.
- Gull 3: Doesn't seem to ever see the stalemate, no matter how long I let it run.
- Spike 1.4: Less than a second.
- Hakkapeliitta 3.0: 6 seconds (very consistently).
- Rybka 2.3.2a: Between 2 and 14 seconds.
- Bobcat 7.1: Doesn't seem to ever see the stalemate, no matter how long I let it run.
- Ruffian 1.0.5: Less than a second.
- Hermann 2.8: About one second.

I don't have Komodo, but I have been reported that it, too, can take several minutes to see the stalemate (although I don't know about the most recent versions).

What I find fascinating and interesting about this is that it's not an artificially constructed position, but it's an actual position that came up in an engine vs. engine game (and in which the stronger engine missed victory because it didn't see it).
User avatar
hgm
Posts: 27791
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Surprisingly difficult stalemate problem (for some engin

Post by hgm »

This is a rabid Rook, not a forced stalemate, right?
Warp
Posts: 9
Joined: Sun May 15, 2016 9:20 am

Re: Surprisingly difficult stalemate problem (for some engin

Post by Warp »

hgm wrote:This is a rabid Rook, not a forced stalemate, right?
I suppose black can avoid the stalemate by never capturing the other rook (in which case I suppose it becomes 3-fold repetition before the 50-move rule), but the actual game itself ended in stalemate anyway.
User avatar
hgm
Posts: 27791
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Surprisingly difficult stalemate problem (for some engin

Post by hgm »

Rabid Rook is notoriously difficult to recognize. The 50-move barrier is usually way beyond the horizon, so you are dependent on 3-fold reps to recognize the draw. Hash hits can often shield the repeats, however.
whereagles
Posts: 565
Joined: Thu Nov 13, 2014 12:03 pm

Re: Surprisingly difficult stalemate problem (for some engin

Post by whereagles »

Well, if you set SF to multi PV = 23 or something, it will see the stalemate in a few secs :)
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Surprisingly difficult stalemate problem (for some engin

Post by zullil »

Warp wrote:
[d]8/5R2/1p2p1pk/p6p/P2R3P/8/r5r1/7K w - - 0 68

It turns out that for some engines (including Stockfish), it's surprisingly hard to see the stalemate, while for other engines (such as Spike) it's very easy. When I analyze that position with several engines, using 4 threads on an i5, it takes on average about this much for them to see the stalemate (it can vary quite a lot between runs):

I don't have Komodo, but I have been reported that it, too, can take several minutes to see the stalemate (although I don't know about the most recent versions).
Komodo 9.42 64-bit (20 threads):

Code: Select all

info depth 36 time 64578 nodes 3162417350 score cp -915 nps 48970506 hashfull 768 tbhits 0 pv d4e4 g2d2 h1g1 e6e5 f7f6 a2a1 f6f1 d2d4 f1a1 d4e4 a1b1 e4b4 b1a1 b4h4 g1g2 h6g5 a1a2 h4b4 g2h3 h5h4 a2d2 b4a4 d2d5 g5f5 d5d8 a4a3 h3g2 a3b3 d8f8 f5g4 f8f2 b3b4 f2e2 e5e4 g2h2 g6g5 e2g2 g4h5 g2f2 a5a4 f2a2 g5g4 h2g2 h5g5 g2f1 h4h3 f1e2 h3h2 a2a1
info currmove d4c4 currmovenumber 2
info nodes 3275337671
info nodes 3492246571
info nodes 3722380846
info nodes 3949866331
info nodes 4173557247
info currmove d4d3 currmovenumber 3
info currmove f7g7 currmovenumber 4
info currmove d4f4 currmovenumber 5
info currmove f7f4 currmovenumber 6
info currmove d4d1 currmovenumber 7
info currmove d4d2 currmovenumber 8
info currmove f7b7 currmovenumber 9
info currmove f7h7 currmovenumber 10
info depth 36 time 80095 nodes 4326758150 score cp 0 lowerbound nps 54020327 hashfull 768 tbhits 0 pv f7h7 h6h7 d4d7
info depth 37 time 80095 nodes 4326762553 nps 54020382 hashfull 768
info currmove f7h7 currmovenumber 1
info depth 37 time 80101 nodes 4327090298 score cp 0 nps 54020427 hashfull 768 tbhits 0 pv f7h7 h6h7 d4d7 h7g8 d7g7 g8f8 g7f7 f8e8 f7e7 e8d8 e7d7 d8c8 d7c7 c8d8 c7d7
Very latest Stockfish (20 threads):

Code: Select all

info depth 30 seldepth 53 multipv 1 score cp -767 upperbound nodes 1209339977 nps 48544475 hashfull 998 tbhits 0 time 24912 pv d4e4 g2b2
info depth 30 currmove d4e4 currmovenumber 1
info depth 30 currmove f7c7 currmovenumber 2
info depth 30 currmove f7a7 currmovenumber 3
info depth 30 currmove f7f2 currmovenumber 4
info depth 30 currmove f7e7 currmovenumber 5
info depth 30 currmove d4d3 currmovenumber 6
info depth 30 currmove f7f3 currmovenumber 7
info depth 30 currmove d4d1 currmovenumber 8
info depth 30 currmove f7f8 currmovenumber 9
info depth 30 currmove d4d6 currmovenumber 10
info depth 30 currmove d4b4 currmovenumber 11
info depth 30 currmove f7d7 currmovenumber 12
info depth 30 currmove d4d7 currmovenumber 13
info depth 30 currmove f7f4 currmovenumber 14
info depth 30 currmove d4f4 currmovenumber 15
info depth 30 currmove d4c4 currmovenumber 16
info depth 30 currmove d4g4 currmovenumber 17
info depth 30 currmove f7f6 currmovenumber 18
info depth 30 currmove d4d8 currmovenumber 19
info depth 30 currmove f7f1 currmovenumber 20
info depth 30 currmove d4d2 currmovenumber 21
info depth 30 currmove f7b7 currmovenumber 22
info depth 30 currmove d4d5 currmovenumber 23
info depth 30 currmove f7h7 currmovenumber 24
info depth 30 seldepth 55 multipv 1 score cp 0 lowerbound nodes 1374129901 nps 48191411 hashfull 999 tbhits 0 time 28514 pv f7h7
User avatar
Nordlandia
Posts: 2821
Joined: Fri Sep 25, 2015 9:38 pm
Location: Sortland, Norway

Re: Surprisingly difficult stalemate problem (for some engin

Post by Nordlandia »

It took about 60 seconds before SF Dev quickly changed eval from -6-7 to 0.00.

New game
8/5R2/1p2p1pk/p6p/P2R3P/8/r5r1/7K w - - 0 1

Analysis by Stockfish 140516 64 BMI2:

68.Rh7+ Kxh7 69.Rd7+ Kg8 70.Rg7+ Kf8 71.Rf7+ Ke8 72.Re7+ Kd8 73.Rd7+ Kc8 74.Rc7+ Kb8 75.Rb7+ Kxb7
= (0.00) Depth: 95/58 00:01:52 2710MN, tb=7269128
(, 16.05.2016)
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: Surprisingly difficult stalemate problem (for some engin

Post by Rebel »

Warp wrote:- Ruffian 1.0.5: Less than a second.
- Hermann 2.8: About one second.
Also.
PK
Posts: 893
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: Surprisingly difficult stalemate problem (for some engin

Post by PK »

Rodent is also fast on that one.