PDA

View Full Version : Detecting fortresses

Kevin Bonham
16-11-2016, 01:27 PM
Here are a couple of silly positions. The first one is a dead position of the sort that a watching arbiter must immediately declare drawn.

3k4/8/8/1p2p1p1/1P2P1P1/1P2PBP1/1P2P3/2K5 w - - 0 1

The second is dead only from one side. If Black just shuffles pieces white can't do anything.

3kn3/8/8/1p2p1p1/1P2P1P1/1P2PBP1/1P2P3/2K5 w - - 0 1

When I enter the top one into Stockfish 4 it recognises the position is drawn in about a minute.

I have had the second one in for 15 minutes and it is yet to recognise the position is drawn. It gives +1.9 for white.

I'd be interested to know if any better software out there recognises the second position as a draw with best play.

Kevin Bonham
16-11-2016, 04:15 PM
It is the simplicity of the first position rather than the fact of it being blocked that causes the computer to find the draw quickly. Because the bishop is immobile it can find the draw by getting to 100-ply. In contrast for this position:

2k5/8/8/1p1p1p1p/1P1P1P1P/8/1B6/2K5 w - - 0 1

it is much slower because it takes too long to calculate all the bishop's moves.

This position is only blocked from one side but the fact that it's a draw with best play is found immediately:

3k4/8/7p/6p1/1p2p1P1/1Pp1P1P1/B1P1P1P1/2K5 w - - 0 1

Patrick Byrom
16-11-2016, 09:35 PM
Fortresses are definitely an area of chess where humans have an advantage over computers. However, this paper (https://ailab.si/matej/doc/Detecting_Fortresses_in_Chess.pdf) suggests that fortresses could be detected by the simple method of monitoring the evaluation function - if it doesn't change with increasing search depth, that indicates that the position is a fortress. This seems much simpler than using Monte-Carlo methods.

Kevin Bonham
17-11-2016, 10:27 AM
Thanks for the link, interesting.

Ian Rout
17-11-2016, 01:13 PM
Peter Svidler made a similar point in the commentary - not so much as proof that it was a draw but explaining why he could forecast a draw when the computer was saying -2. I think it's a useful idea but has limitations - it's not necessarily true, and there may be tries for the attacker where trying to maintain the fortress loses but abandoning the fortress saves the game.

Patrick Byrom
17-11-2016, 11:01 PM
... I think it's a useful idea but has limitations - it's not necessarily true, and there may be tries for the attacker where trying to maintain the fortress loses but abandoning the fortress saves the game.Do you have examples?

first25plus5
18-11-2016, 05:49 AM
GAMBIT's book Modern Chess Analysis by Robin Smith, (2004), has a good section on the ruler-flat computer evaluations in fortresses and mentioning flat evaluations a number of times. Well worth a read. Thanks for posting the pdf file, good to have programs a little newer used in examples.

Ian Rout
18-11-2016, 02:41 PM
Do you have examples?Not off the top of my head, though I imagine that trivial examples could be composed without too much trouble, For something realistic you would probably need a more powerful computer than those existing in order to prove it.

Broadly the point is that there is no such thing as a position with an evaluation, or a correct one at least, of 1.79. I's either a win (mate) for White or for Black, or (eventually) a draw in some way. If a computer can't see far enough to prove any of these options it assesses a position by bean-counting. If at some point it sees an option that yields 1.56 to the attacker and which would win if it could have seen far enough it will still treat it as a 1.79 position since that's the conclusion with "best" play.

FM_Bill
16-09-2019, 02:36 PM
I did not the paper mention earlier in depth, so it might have already covered this.

However I once come up with an algorithmn some years ago. The basic idea is the closer you get to 100 ply (the 50 move rule) without making progress, the more the advantage is reduced. The simple way to represent making progress is a capture or pawn move, though other ways may be possible. Maybe some pawn moves should not constitute progress, for example if there an opposing pawn in front on the same file.

A linear relationship would mean after 10 ply the advantage would diminish by 10%, by 90 ply by 90%.
For example a fortress position with a material advantage of rook versus bishop with equal pawns might initially be +2, but drop to +.2 (close to =)
by 90 ply. This will alternatives more attractive.

A crude approach is to reduce the no progress to less than 100 ply. If its reduced to say 20 ply, many fortress positions would be discovered
quickly but there would need to be conditions.

Some curve like sigmoid might work better.

pappubahry
31-10-2020, 06:19 PM
I recently upgraded from Stockfish 8 to Stockfish 12 and noticed that the endgame evaluations were much better, e.g. an opposite-coloured bishops fortress being evaluated as 0.00 instead of +0.6 to the side with the extra pawns. Stockfish 8 after two minutes assesses the second position in Kevin's OP as +2.24, but Stockfish 12 gets to 0.00 in less than a second.

(I've never tried studying the Stockfish code, but since it's open source, it's in principle possible to work out what algorithm they're using for this.)

FM_Bill
04-09-2021, 08:43 AM
i have read that recent versions of StockFish have implemented an idea similar to the one in my previous post. i.e. the closer the game gets to the 50 move rule, the smaller a material advantage is.

In the positions in the post, an engine could evaluate as drawn if the side with more material had no checks or captures possible for x moves in the principal variation. I'm not sure what x should be set at though. Maybe 20 or 30 ply?