A strange position

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Alessandro Scotti

A strange position

Post by Alessandro Scotti »

I've stumbled in this easily won position:

[D]8/8/7K/3Q4/1kp4P/8/r7/8 w - -

Here Hamsters played Kg5?? and lost the game to Ra5. Surprisingly, I've analyzed the position with Rybka 2.3.2 and it also wants to play Kg5 for a long time, before switching to h5.

I wonder what does your engine play and what could be the reason for looking so favorably at losing one's queen? :shock:
Arash

Re: A strange position

Post by Arash »

Hi,

This is what ARChess thinks about the given position:

1 +374 0 70 h5
2 +374 0 171 h5 Rb2
3 +374 0 397 h5 Rb2 Qh1
4 +336 0 2457 Qd4 Kb3 Qd5 Rf2
5 +374 1 4656 h5 Rf2 Qd4 Ra2 Kg7
6 +336 4 21027 Qd6+ Kb3 Qb6+ Kc2 Qe6 Kb3
7 +374 10 8810 Qd6+ Kb3 Qb6+ Kc2 Qe6 Kb3 h5
8 +373 25 95822 h5 Ra6+ Kg7 c3 Qe4+ Kc5 h6 Ra2
9 +374 33 35901 h5 Rb2 Qd4 Rg2 Qd5 Rb2 Qd4 Rg2 Qd5
10 +374 47 91057 h5 Rb2 Qd4 Kb3 Qd5 Kc3 Kg5 Rd2 Qe4 Kb3
11 +374 62 96746 h5 Rb2 Qd4 Kb3 Qd5 Kb4 Qd4 Kb3 Qd1+ Ka3 Kg5
12 +374 94 282708 h5 Rb2 Qd4 Kb3 Qd5 Kb4 Qd4 Kb3 Qd1+ Ka3 Qd6+ Kb3
13 +374 154 911328 h5 Rb2 Qd4 Kb3 Qd5 Kb4 Qd4 Kb3 Qd1+ Ka3 Qd6+ Kb3 Qd5
14 +378 236 1666401 h5 Rb2 Kg7 c3 h6 c2 Qd2+ Kc4 h7 Rb7+ Kg6 Rb6+ Kg7 Kb3
15 +398 601 7404828 h5 Ra5 Qc6 c3 Kg6 Rc5 Qb6+ Kc4 h6 c2 Qe6+ Kc3 Qh3+ Kd2 h7
16 +436 1190 11737106 h5 Ra5 Qe4 Kb3 Qb7+ Kc2 Kg6 c3 h6 Re5 h7 Re8 Kh5 Kc1 Qb5 Re3
17 +436 2205 20538048 h5 Ra4 Kg6 c3 Qc6 Kb3 h6 Rg4+ Kf5 Rh4 Qb7+ Kc2 h7 Rh2 Qa7 Kc1 Kg4
18 +490 4452 42800599 h5 Ra4 Kg7 Ra7+ Kf8 Ra5 Qd6+ Kb3 h6 Ra8+ Kg7 Ra7+ Kg6 Ra8 h7 Re8 Qc6 Rh8

Best Regards,
Arash Panahi Rad
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: A strange position

Post by hgm »

Any tablebase probing going on here? End-game recognizers? Or just plain search and hashing?
Last edited by hgm on Fri Jul 06, 2007 11:08 am, edited 1 time in total.
FrancoisK
Posts: 80
Joined: Tue Jul 18, 2006 10:46 pm

Re: A strange position

Post by FrancoisK »

Hi :)

No suicide tendancies for BugChess on this peculiar position ;-)
At first sight, this looks like a bug to me :-/

FEN: 8/8/7K/3Q4/1kp4P/8/r7/8 w - - 0 1

BugChess2_V1_5:
1 00:00 2 2 +3,56 d5-d1
1 00:00 10 10 +3,64 d5-f3
1 00:00 12 12 +3,78 d5-d4
1 00:00 42 42 +4,00 d5-b7 b4-a5
1 00:00 54 54 +4,02 h4-h5
2 00:00 88 88 +4,01 h4-h5 b4-b3
2 00:00 378 378 +4,13 d5-b7 b4-c5 h4-h5
3 00:00 1.710 1.710 +4,04 d5-b7 b4-a4 b7-d7 a4-b3 h4-h5
3 00:00 2.166 2.166 +4,16 h4-h5 a2-b2 h6-g6
4 00:00 3.684 3.684 +4,20 h4-h5 b4-c3 h6-g6 c3-b3
5 00:00 9.988 9.988 +4,22 h4-h5 a2-e2 h6-g6 c4-c3 h5-h6
6 00:00 23.631 2.363.100 +4,30 h4-h5 a2-b2 h6-g6 c4-c3 d5-d4 b4-b3 h5-h6
7 00:00 58.047 967.450 +4,27 h4-h5 a2-b2 h6-g7 c4-c3 d5-b7 b4-a4 b7-a7 a4-b5 h5-h6
8 00:00 188.903 1.049.461 +4,30 h4-h5 a2-a5 d5-b7 a5-b5 b7-e7 b5-c5 h6-g6 c4-c3 e7-b7 c5-b5 b7-c7
9 00:00 331.695 1.036.546 +4,36 h4-h5 a2-a5 d5-b7 a5-b5 b7-e7 b5-c5 h6-g6 c4-c3 e7-b7 c5-b5 b7-e4 b4-c5 h5-h6
10 00:00 671.688 1.002.519 +4,48 h4-h5 a2-a5 d5-b7 a5-b5 b7-e7 b5-c5 h6-g6 c4-c3 h5-h6 c3-c2 h6-h7 c2-c1>q h7-h8>Q
11 00:01 1.152.731 1.047.937 +4,48 h4-h5 a2-a5 d5-b7 a5-b5 b7-e7 b5-c5 h6-g6 c4-c3 h5-h6 c3-c2 h6-h7 c2-c1>q h7-h8>Q
12 00:02 2.574.341 1.072.642 +4,49 h4-h5 a2-a5 d5-b7 a5-b5 b7-e7 b5-c5 h6-g6 c4-c3 h5-h6 c3-c2 e7-b7 b4-c3 h6-h7 c2-c1>q h7-h8>Q c3-c4
13 00:07 7.839.867 1.121.583 +4,56 h4-h5 a2-a5 d5-d4 a5-c5 h6-g6 c5-c6 g6-g5 c6-c5 g5-g4 b4-b5 h5-h6 c4-c3 d4-d7 c5-c6 d7-d5 c6-c5 d5-b7 b5-c4
14 00:10 12.306.892 1.119.826 +4,59 h4-h5 a2-a5 d5-d4 a5-c5 h6-g6 c5-c6 g6-g5 b4-a5 d4-c3 a5-b5 c3-b2 b5-a5 h5-h6 c4-c3 b2-a3 a5-b6 a3-b4 b6-c7 h6-h7
15 00:41 53.408.897 1.302.656 +5,89 h4-h5 a2-a5 d5-e4 a5-a2 h6-g6 a2-a6 g6-g5 a6-a5 g5-g4 a5-a6 e4-e7 b4-a4 e7-c5 c4-c3 c5xc3 a4-b5 c3-e5 b5-c6 h5-h6
16 01:08 91.590.550 1.346.919 +6,20 h4-h5 a2-a5 d5-e4 b4-b3 e4-b7 b3-a3 h6-g6 c4-c3 h5-h6 c3-c2 b7-c6 a3-b4 c6xc2 a5-a6 g6-f7 a6-a7 f7-f8 a7-a8 f8-g7 b4-b5

:? :?
Stan Arts

Re: A strange position

Post by Stan Arts »

Could be an error in pawnrace code?

Neurosis says:

Code: Select all

Legal moves: 31   Static score: 512
Ply Score  Time     Nodes      Best move and expected line
------------------------------------------------------------
2   520    1        149        Kg5 Rf2
2   521    1        239        h5 Re2
3   530    3        936        h5 Rf2 Kg5
4   528    3        3296       h5 Re2 Kg5 c3 Qd4+ Kb3
5   533    6        11309      h5 Re2 Qd6+ Kc3 Kg5
6   533    12       33774      h5 Re2 Qd6+ Kc3 Kg5 Ra2
7   534    30       85522      h5 Re2 Qd6+ Kc3 Kg5 Rd2 Qe5+ Kb4 Qe7+ Ka4
8   537    101      325379     h5 Rb2 Kg5 c3 h6 Rd2 Qe4+ Kc5 h7 c2
9   543    286      961595     h5 Rb2 Kg5 c3 h6 Rd2 Qb7+ Ka3 h7 c2 Qc6 Kb4 Kf5
10  548    955      3323899    h5 Ra6+ Kg7 Ra5 Qd6+ Rc5 Qb6+ Rb5 Qd6+ Rc5 Qb6+ Rb5 Qd6+ Rc5
11  546    1748     6124736    h5 Ra6+ Kg7 Ra5 Qd6+ Rc5 Qb6+ Rb5 Qd6+ Rc5 Qb6+ Rb5 Qd6+ Rc5
12  556    6455     22903978   h5 Ra6+ Kg7 Ra7+ Kf6 Ra5 Qd6+ Rc5 h6 c3 Qb8+ Ka4 Qd6 Rc4 Qd5 Qxc4+ Ka5
13  568    20097    72382445   h5 Ra4 Qd6+ Kb3 Qd1+ Kb4 Kg5 Ra5+ Kf4 Ra6 Qb1+ Kc5 Qf5+ Kb4 h6 Ra8 Qd5 Ra6 Ke5 Ra2 h7 Re2+ Kf4 Rh2 Qb7+ Ka3 Kg3
Total nodes:106173741 n/sec:358800  (q-nodes:14% max depth:33)
Forcing Kg5 and having my engine search for black loses violently for white. However it needs some depth to figure out the pawnrace before it turns out to lose violently. Could be where to look for the bug.
(On a sidenote my engine's king-in-square-of-pawn code only returns small values. (in the region of a pawn, instead of the value of a queen) )

Code: Select all

Legal moves: 19   Static score: -524
Ply Score  Time     Nodes      Best move and expected line
------------------------------------------------------------
2   -530   0        203        Rf2 h5
2   18     0        401        Ra5 Qxa5+ Kxa5
3   18     0        470        Ra5 Qxa5+ Kxa5
4   6      0        671        Ra5 Qxa5+ Kxa5 h5
5   28     0        1015       Ra5 Qxa5+ Kxa5 Kf4 c3
6   48     1        1450       Ra5 Qxa5+ Kxa5 Kf4 c3 Ke3 c2 Kd2
7   48     1        2706       Ra5 Qxa5+ Kxa5 Kf4 c3 Ke3 c2 Kd2
8   48     1        4022       Ra5 Qxa5+ Kxa5 Kf4 c3 Ke3 c2 Kd2
9   30     3        6042       Ra5 Qxa5+ Kxa5 Kf4 c3 Ke3 Kb5 Kd3 Kb4 Kb5 Kb4 Kb5
10  36     5        13142      Ra5 Qxa5+ Kxa5 Kf4 c3 Ke3 Kb4 Kd3 Kb3 h5 c2 Kd2
11  12     8        21764      Ra5 < - > Qxa5+ Kxa5 Kf4 Kb5 Ke3 Kc5 h5 Kd5 Kd2 Ke5
11  -52    8        25756      Ra5 Qxa5+ Kxa5 Kf4 Kb5 Ke3 Kc5 h5 c3 h6 c2 Kd2
12  -52    22       64141      Ra5 Qxa5+ Kxa5 Kf4 c3 Ke3 Kb4 h5 Kc4 h6 c2 Kd2
13  -28    53       152824     Ra5 < + > Qxa5+ Kxa5 Kf4 c3 Ke3 Kb4 Kf3 c2 Ke3 c1=Q+ Kd3 h5
13  47     55       157633     Ra5 < + > Qxa5+ Kxa5 Kf4 c3 Ke3 Kb4 Kf3 c2 Ke3 c1=Q+ Kd3 h5
13  287    56       162427     Ra5 < + > Qxa5+ Kxa5 Kf4 c3 Ke3 Kb4 Kf3 c2 Ke3 c1=Q+ Kd3 h5
13  911    475      1704417    Ra5 Qxa5+ Kxa5 Kf4 c3 Ke3 Kb4 h5 Kb3 Kd4 c2 h6 c1=Q h7 Qb2+ Ke4 Kb4 K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20  1056   16731    52519561   Ra5 Qxa5+ Kxa5 Kf4 c3 Ke3 Kb4 Ke2 Kb3 Kd1 Kb2 Ke2 c2 Kf3 c1=Q Kg4 Qg1+ Kf4 Qf2+ Kg4 Kb3 Kg5 Qg2+ Kf6 Qh2 Kg5 Qg3+ Kf5 Qxh4 Ke5 Qg3+ Kd4 Ka3 Kd5
Total nodes&#58;89705946 n/sec&#58;303100  &#40;q-nodes&#58;11% max depth&#58;40&#41;
Alessandro Scotti wrote:I've stumbled in this easily won position:

[D]8/8/7K/3Q4/1kp4P/8/r7/8 w - -

Here Hamsters played Kg5?? and lost the game to Ra5. Surprisingly, I've analyzed the position with Rybka 2.3.2 and it also wants to play Kg5 for a long time, before switching to h5.

I wonder what does your engine play and what could be the reason for looking so favorably at losing one's queen? :shock:
Alessandro Scotti

Re: A strange position

Post by Alessandro Scotti »

Initially I thought it was a bug, and actually I was very happy to find it because I've already played and analyzed more than 600 games looking for it. But when I see Rybka has the same behavior I think maybe engines are fooled for some reasons I don't yet understand... I'm quite puzzled by this and will have to wait until tonight before I can run some tests with Hamsters! :-(
Alessandro Scotti

Re: A strange position

Post by Alessandro Scotti »

Stan Arts wrote:Could be an error in pawnrace code?
That's something I am definitely considering... argh, so many hours to wait till I can get my hands on the code! :?
MartinBryant

Re: A strange position

Post by MartinBryant »

This looks like a pawn runner code problem.

After Kg5 Ra5 QxR+ KxQ Kf4 white's king is inside the black pawn square but the black king is outside the white pawn square, so superficially it looks like a white win.

Maybe some engines will therefore prune this line early, for many iterations, mistakenly thinking it's bad for black.
Alessandro Scotti

Re: A strange position

Post by Alessandro Scotti »

Thanks all guys, and great job by Martin and Stan... it was indeed a pawn race bug!
I wanted to code it in such a way that it would only trigger against a lone king, but ended up adding a bug that allowed it also in other cases... :-(
But it's fixed now... on to the next bug! :-)