Blocked Position (No computer common sense)

General discussion about computer chess...
zullil
Posts: 82
Joined: Thu Jun 10, 2010 10:17 am
Real Name: Louis Zulli
Location: Pennsylvania, USA

Re: Blocked Position (No computer common sense)

Post by zullil » Thu May 24, 2012 9:58 pm

hyatt wrote:
zullil wrote:
hyatt wrote:
zullil wrote:
biscuit1953 wrote:I have no idea where I got this position but found it in some old files I was getting rid of. It's amazing that of all the engines I tested all except Critter think that White's position is hopeless while obviously it is a dead draw.

6kr/5b1p/2p3pP/rpPp1pP1/pP1PpP2/P3P3/1K6/8 w - -
The evaluation itself is irrelevant, as long as the engine avoids taking the rook.

If your evaluation does not understand this, you will ALWAYS take a free rook when offered. Basic minimax guarantees that. So you have to have something in the evaluation that says that +5 gain should be ignored...
The position that arises if White takes the rook evaluates as -INFINITY for White. Crafty-23.4 prefers Ka1, which evaluates as -15 or so. Even if Ka1 evaluated as -400, Crafty would still prefer it to bxa5. That's what I meant. No special draw detection code is needed in this position, as long as you have a decent search.
The game is more complicated than that. What if that is a "terminal position" rather than at the root? Now you have no deep search to figure out what is going on, and your q-search will greedily plan on ripping the rook. Which guides the game into a position where you think you are winning, but are actually drawing...

Not good...
Yes, I understand. Correct evaluation of the position at hand is always paramount. Thanks.

Richard Vida
Posts: 50
Joined: Thu Jun 10, 2010 12:48 am

Re: Blocked Position (No computer common sense)

Post by Richard Vida » Fri May 25, 2012 3:04 am

biscuit1953 wrote:I have no idea where I got this position but found it in some old files I was getting rid of. It's amazing that of all the engines I tested all except Critter think that White's position is hopeless while obviously it is a dead draw.

6kr/5b1p/2p3pP/rpPp1pP1/pP1PpP2/P3P3/1K6/8 w - -

Code: Select all

Critter v1.5.45 64-bit, by Richard Vida
hardware POPCNT enabled
setboard 6kr/5b1p/2p3pP/rpPp1pP1/pP1PpP2/P3P3/1K6/8 w - -
info string GTB Init OK (5 piece set)
info string Using 1 thread(s), 64 MB hash LP=off
go depth 28
16/19  00:00   424439   2848K  +0.00 Kc3 Ra6 Kd2 Be6 Ke2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00:03   10083K   2793K  -0.05 Kc3 Ra6 Kd2 Be6 Ke2 Bc8 Kf2 Bb7 Kg3 Kf7 Kg2 Rc8 Kg3 Ke7 Kh4 Ba8 Kg3 Kd8 Kf2 Kc7 Kg3 Kb8 Kf2 Ka7 Kg3
26/35  00:05   15194K   2835K  +0.00 Kc3 Ra6 Kd2 Be6 Ke2 Bc8 Kf2 Bb7 Kg3 Kf7 Kg2 Rc8 Kg3 Ke7 Kh4 Ba8 Kg3 Kd8 Kf2 Kc7 Kg3 Kb8 Kf2 Ka7 Kg3 Kb8
27/35  00:05   15494K   2832K  -0.05 Kc3 Ra6 Kd2 Be6 Ke2 Bc8 Kf2 Bb7 Kg3 Kf7 Kg2 Rc8 Kg3 Ke7 Kh4 Ba8 Kg3 Kd8 Kf2 Kc7 Kg3 Kb8 Kf2 Ka7 Kg3 Rc7 Kf2
28/37  00:08   24279K   2920K  +0.00 Kc3 Ra6 Kd2 Be6 Ke2 Bc8 Kf2 Bb7 Kg3 Kf7 Kg2 Rc8 Kg3 Ke7 Kh4 Ba8 Kg3 Kd8 Kf2 Kc7 Kg3 Kb8 Kf2 Ka7 Kg3 Rc7 Kf2 Rc8
bestmove Kc3 ponder Ra6

time: 8323 nodes: 24283414 evals: 11712416 knps: 2917
phash: 99.43% evalcache: 49.83% lazy: 1.00% eg_recog: 527


Richard Vida
Posts: 50
Joined: Thu Jun 10, 2010 12:48 am

Re: Blocked Position (No computer common sense)

Post by Richard Vida » Fri May 25, 2012 3:22 am

Just to boast a bit - the new Critter recognizes a lot of blocked positions by pure static evaluation. While it is cool, it costs quite a bit of speed (and ELO)...

6k1/4p3/3pPp2/3P1P2/3P1P2/8/8/6K1 w - - 0 1
Critter v1.5.45 64-bit, by Richard Vida
hardware POPCNT enabled
setboard 6k1/4p3/3pPp2/3P1P2/3P1P2/8/8/6K1 w - - 0 1
info string GTB Init OK (5 piece set)
info string Using 1 thread(s), 64 MB hash LP=off
go
 2/ 2  00:00       67       0  +0.00 Kf2 Kf8
 3/ 3  00:00       91   45500  +0.00 Kf2 Kf8 Ke3
 4/ 4  00:00      143   35750  +0.00 Kf2 Kf8 Ke3 Ke8
 5/ 5  00:00      231   38500  +0.00 Kf2 Kf8 Ke3 Ke8 Ke4
 6/ 6  00:00      361   40111  +0.00 Kf2 Kf8 Ke3 Ke8 Ke4 Kf8
 7/ 7  00:00      548   49818  +0.00 Kf2 Kf8 Ke3 Ke8 Ke4 Kf8 Ke3
 8/ 8  00:00      766   51066  +0.00 Kf2 Kf8 Ke3 Ke8 Ke4 Kf8 Ke3
 9/ 9  00:00     1036   57555  +0.00 Kf2 Kf8 Ke3 Ke8 Ke4 Kf8 Ke3
10/10  00:00     1338   63714  +0.00 Kf2 Kf8 Ke3 Ke8 Ke4 Kf8 Ke3
11/11  00:00     1698   70750  +0.00 Kf2 Kf8 Ke3 Ke8 Ke4 Kf8 Ke3
12/12  00:00     2093   77518  +0.00 Kf2 Kf8 Ke3 Ke8 Ke4 Kf8 Ke3
13/13  00:00     2558   82516  +0.00 Kf2 Kf8 Ke3 Ke8 Ke4 Kf8 Ke3
14/14  00:00     3059   89970  +0.00 Kf2 Kf8 Ke3 Ke8 Ke4 Kf8 Ke3
15/15  00:00     4196  113405  +0.00 Kf2 Kf8 Ke3 Kg7 Ke4 Kf8 Ke3
16/16  00:00     4742  118550  +0.00 Kf2 Kf8 Ke3 Kg7 Ke4 Kf8 Ke3
17/17  00:00     7380  167727  +0.00 Kf2 Kg7 Ke3 Kh6 Ke4 Kh5 Ke3 Kh6
18/19  00:00     9069  188937  +0.00 Kf2 Kg7 Ke3 Kh6 Ke4 Kh5 Ke3 Kh6
19/19  00:00    11317  217634  +0.00 Kf2 Kg7 Ke3 Kh6 Ke4 Kh5 Ke3 Kh6
Last edited by Richard Vida on Fri May 25, 2012 3:27 am, edited 1 time in total.

Richard Vida
Posts: 50
Joined: Thu Jun 10, 2010 12:48 am

Re: Blocked Position (No computer common sense)

Post by Richard Vida » Fri May 25, 2012 3:26 am

... another cool puzzle:
3B4/1r2p3/r2p1p2/bkp1P1p1/1p1P1PPp/p1P4P/PP1K4/3B4 w - - 0 1
Critter v1.5.45 64-bit, by Richard Vida
hardware POPCNT enabled
setboard 3B4/1r2p3/r2p1p2/bkp1P1p1/1p1P1PPp/p1P4P/PP1K4/3B4 w - - 0 1
info string GTB Init OK (5 piece set)
info string Using 1 thread(s), 64 MB hash LP=off
go depth 20
10/26  00:00   235291   1755K  -6.45 c4+ Kxc4 b3+ Kxd4 exf6 exf6 Bxf6+ Ke4 Be2 Ra8 fxg5 Rf8 Bf1 Kf4 Bg2 Rbf7 Bd5 Rxf6 gxf6 Rxf6 Kd3
11/26  00:00   332548   1696K  -6.45 c4+ Kxc4 b3+ Kxd4 exf6 exf6 Bxf6+ Ke4 Be2 Ra8 fxg5 Rf8 Bf1 Kf4 Bg2 Rbf7 Bd5 Rxf6 gxf6 Rxf6 Kd3
12/31  00:00   500732   1714K  -6.53 c4+ Kxc4 b3+ Kxd4 exf6 exf6 Bxf6+ Ke4 Be2 Ra8 fxg5 Rf8 Bf1 Kf4 Bg2 Rbf7 Bd5 Rxf6 gxf6 Rxf6 Kd3 Bd8
12/31+ 00:00   664434   1686K  -6.05 Ba4+ Kxa4 b3+ Kb5 c4+ Kc6 d5+ Kd7 e6+ Kxd8 f5
12/31+ 00:00   665548   1668K  -5.44 Ba4+ Kxa4 b3+ Kb5 c4+ Kc6 d5+ Kd7 e6+ Kxd8 f5
12/31+ 00:00   666991   1655K  -4.54 Ba4+ Kxa4 b3+ Kb5 c4+ Kc6 d5+ Kd7 e6+ Kxd8 f5
12/31+ 00:00   668792   1639K  -3.19 Ba4+ Kxa4 b3+ Kb5 c4+ Kc6 d5+ Kd7 e6+ Kxd8 f5
12/31+ 00:00   672035   1627K  -1.16 Ba4+ Kxa4 b3+ Kb5 c4+ Kc6 d5+ Kd7 e6+ Kxd8 f5
12/31  00:00   864877   1765K  +0.00 Ba4+ Kxa4 b3+ Kb5 c4+ Kc6 d5+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  00:02    5881K   2130K  -0.05 Ba4+ Kxa4 b3+ Kb5 c4+ Kc6 d5+ Kd7 e6+ Kc8 f5 Rc6 Bxa5 Ra7 Kd3 Kb8 Bd8 Rc8 Ke4 Kb7 Kf3 Ka6 Kg2 Rd7 Ba5 Kxa5 Kh1 Ra7 Kh2 Re8 Kg2 Ra6 Kh2 Rg8 Kg2
20/38  00:04    8881K   2096K  -0.05 Ba4+ Kxa4 b3+ Kb5 c4+ Kc6 d5+ Kd7 e6+ Kc8 f5 Rc6 Bxa5 Ra7 Kd3 Kb8 Bd8 Rc8 Ke4 Kb7 Kf3 Ka6 Kg2 Rd7 Ba5 Kxa5 Kh1 Ka6 Kg2 Kb6 Kf2 Ka5 Kg2 Ka6 Kf3
bestmove Ba4+ ponder Kxa4

time: 6393 nodes: 12893206 evals: 9537298 knps: 2016
phash: 73.61% evalcache: 19.75% lazy: 40.21% eg_recog: 14950

Richard Vida
Posts: 50
Joined: Thu Jun 10, 2010 12:48 am

Re: Blocked Position (No computer common sense)

Post by Richard Vida » Fri May 25, 2012 3:42 am

This position is from a real game (Critter 1.4 vs Komodo4) in one of the Graham Banks tournaments. Both engines showed a winning advantage for white...

3k4/p7/Pp6/1Pp5/2P5/5B2/6K1/8 w - - 0 1
Critter v1.5.45 64-bit, by Richard Vida
hardware POPCNT enabled
setboard 3k4/p7/Pp6/1Pp5/2P5/5B2/6K1/8 w - - 0 1
info string GTB Init OK (5 piece set)
info string Using 1 thread(s), 64 MB hash LP=off
go
 2/ 2  00:00       38       0  +0.05 Bd5 Ke7
 3/ 3  00:00       94   47000  -0.05 Bd5 Ke7 Kf3
 4/ 4  00:00      218   54500  +0.05 Bd5 Ke7 Kf3 Kd6
 5/ 5  00:00      476   68000  -0.05 Bd5 Ke7 Kf3 Kd6 Ke4
 6/ 6  00:00      939  104333  +0.05 Bd5 Ke7 Kf3 Kd6 Ke4 Ke7
 7/ 7  00:00     2198  169076  +0.00 Bd5 Ke7 Kf3 Kd6 Ke4 Ke7 Kf3
 8/ 8  00:00     5080  298823  +0.05 Bd5 Ke7 Kf3 Kd6 Ke4 Ke7 Bc6 Kd6
 9/10  00:00     8737  416047  +0.00 Bd5 Ke7 Kf3 Kd6 Ke4 Ke7 Bc6 Kd6 Bd5
10/10  00:00    17688  655111  +0.05 Bd5 Ke7 Kf3 Kd6 Ke4 Ke7 Bc6 Kd6 Kd3 Ke7
11/12  00:00    33854  940388  +0.00 Bd5 Ke7 Kf3 Kd6 Ke4 Ke7 Bc6 Kd6 Kd3 Ke7 Ke4
11/12  00:00    51864   1127K  +0.05 Bg4 Ke7 Kf3 Kd6 Ke4 Kc7 Ke5 Kb8 Kd6 Ka8 Bf3+ Kb8
12/13  00:00    57165   1120K  +0.05 Bg4 Ke7 Kf3 Kd6 Ke4 Kc7 Ke5 Kb8 Kd6 Ka8 Kd5 Kb8 Kd6
13/14  00:00    75640   1240K  +0.05 Bg4 Ke7 Kf3 Kd6 Ke4 Kc7 Ke5 Kb8 Kd6 Ka8 Kd5 Kb8 Kc6 Ka8
14/17  00:00   106500   1401K  +0.05 Bg4 Ke7 Kf3 Kd6 Ke4 Kc7 Ke5 Kb8 Kd6 Ka8 Kd5 Kb8 Kc6 Ka8 Kd6 Kb8
15/18  00:00   148247   1594K  +0.05 Bg4 Ke7 Kf3 Kd6 Ke4 Kc7 Ke5 Kb8 Kd6 Ka8 Kd5 Kb8 Kc6 Ka8 Kd6 Kb8 Kd5 Ka8 Kd6

User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: Blocked Position (No computer common sense)

Post by User923005 » Fri May 25, 2012 6:02 am

It might be worthwhile having the special evaluation as something that can be turned on or off.
Replaceable function pointers are one way to do this (Scalable Search in Computer Chess by Heinz suggests this idea).
As an alternative, you could create a "game playing version" which gets maximum Elo for games even though it gets confused sometimes, and an "analysis version" which always strives for the right answer even it if costs a little time.

At any rate, getting the right answer is incredibly valuable for analysis.

biscuit1953
Posts: 29
Joined: Sun Apr 29, 2012 5:54 pm

Re: Blocked Position (No computer common sense)

Post by biscuit1953 » Sat May 26, 2012 1:50 am

Whatever elo points that may be lost must not be very much considering Critter is among the top three engines.

User avatar
Carlos Ylich
Posts: 56
Joined: Thu Jun 10, 2010 3:04 am
Location: São Paulo

Re: Blocked Position (No computer common sense)

Post by Carlos Ylich » Sat May 26, 2012 2:07 am

Thanks Richard,
His work is much admired :!:

biscuit1953
Posts: 29
Joined: Sun Apr 29, 2012 5:54 pm

Two programs lose in this position

Post by biscuit1953 » Sat May 26, 2012 6:44 pm

I gave this position to Slow Chess Blitz and it resigned. I let Nagaskaki play it out and White was checkmated. Those are the only two I tested but obviously they don't have a proper evaluation. Both captured the rook.
6kr/5b1p/2p3pP/rpPp1pP1/pP1PpP2/P3P3/1K6/8 w - -

User avatar
Sean Evans
Posts: 173
Joined: Fri Jun 11, 2010 1:21 am
Real Name: Sean Evans

Re: Blocked Position (No computer common sense)

Post by Sean Evans » Sun Jun 03, 2012 5:34 pm

hyatt wrote:
biscuit1953 wrote:I have no idea where I got this position but found it in some old files I was getting rid of. It's amazing that of all the engines I tested all except Critter think that White's position is hopeless while obviously it is a dead draw.

6kr/5b1p/2p3pP/rpPp1pP1/pP1PpP2/P3P3/1K6/8 w - -

There are versions of Crafty that find this instantly. By evaluation. The problem is, how often have you seen such a position? How much will recognizing that improve a program? And most importantly, how much time does that waste in the evaluation and what is the cost in the positions where such locked pawns don't occur? Answer to the second question. It won't improve the Elo at all. The answer to the third question is "it costs quite a few Elo because it slows the NPS down and reduces the depth slightly." If you look at crafty 19.10 and a few versions after that, there is specific code (not written by myself, contributed by someone else. If you compile with -DDETECT_DRAWS it should find that instantly. Unfortunately the cost was too high and it was removed in later versions...
Closed positions are quite common in chess and should be reflected in a chess programs evaluation, ex. Knights are better than Bishops in closed positions!

Post Reply