Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Interesting mate test for hashing

Author: James Robertson

Date: 08:54:02 09/10/99

Go up one level in this thread


On September 10, 1999 at 09:41:17, Robert Hyatt wrote:

>On September 10, 1999 at 02:34:09, James Robertson wrote:
>
>>On September 10, 1999 at 00:19:37, Robert Hyatt wrote:
>>
>>I store all my mates as bounds, a la Ferret (I think). My program solves the
>>position in 1 second at ply 13 on my P233, 4MB hash table. (I used the EPD
>>string from William's post).
>>
>> 1  -350          0          3 Kh3
>> 2  -370          0         16 Kh3 f2
>> 3  -365          0         51 Kh3 f2 Kg2
>> 4  -360          0        418 Kh2 Kf4 Kg1 Ke4
>> 5> -497          0        872 Kh3 Kf4 Kh2 Kg4 Kg1 Kxh4
>> 5  -497         50        872 Kh3 Kf4 Kh2 Kg4 Kg1 Kxh4
>> 6 -1169         50       1341 Kh3 f2 Kg2 Ke2 Kg3 f1=q
>> 7 -1169         50       1894 Kh3 f2 Kg2 Ke2 Kh2 f1=q Kg3
>> 8 -1176         50       2636 Kh3 f2 Kg2 Ke2 Kh2 f1=q Kg3 Kd3
>> 9 -1246         50       3593 Kh3 f2 Kg2 Ke2 Kh2 f1=q Kg3 Qa1 Kf4 Qxa6
>>10 -1263        110      12151 Kh3 f2 Kg2 Ke2 Kh1 f1=q+ Kh2 Ke3 Kg3 Qxa6
>>11 -1326        220      25148 Kh3 f2 Kg2 Ke2 Kh3 f1=q+ Kg3 Qg1+ Kh3 Qg4+ Kh2 Qx
>>h4+
>>12 -1331        380      63883 Kh3 f2 Kg2 Ke2 Kh3 f1=q+ Kg3 Qf3+ Kh2 Qg4 Kh1 Qxh
>>4+
>>13 -29988        990     202497 Kh3 f2 Kg2 Ke2 Kh3 Kf3 Kh2 g5 hxg5 f1=q g6 Qg2+
>>
>>
>>I am surprised a 12 ply search does not see the mate; there might be a bug
>>somewhere?
>>
>
>Maybe...  the move at ply=12 gives mate.  If you go from there to your q-search,
>and you don't recognize mates in your q-search, this might be perfectly normal.
>In my case, when a regular search move gives check, I extend by one ply there.
>In the PV I gave, the last move (at ply=12) is the only check, but it instantly
>extends one ply, so that ply 13 is a full-width node and the mate gets picked
>up.  Otherwise it takes one extra ply, which is not important IMHO.  IE do you
>extend when you _give_ check or at the next ply when you detect you are in
>check?

Thanks for your answer; I think I found why my program does not see it. I
recently revamped my extensions, and I _thought_ I had retained the "if we are
in check but are going into the q-search, instead extend one ply". I guess I
accidentally disabled it.... :\

At every other node it detects and extends when in check normally....

James



>
>
>
>
>>James
>>
>>>Here is an interesting position given to me by Steffen Jakob:
>>>
>>> /p/P5p/7p/7P/4kpK/// w
>>>
>>>       +---+---+---+---+---+---+---+---+
>>>    8  |   |   |   |   |   |   |   |   |
>>>       +---+---+---+---+---+---+---+---+
>>>    7  | *P|   |   |   |   |   |   |   |
>>>       +---+---+---+---+---+---+---+---+
>>>    6  | P |   |   |   |   |   | *P|   |
>>>       +---+---+---+---+---+---+---+---+
>>>    5  |   |   |   |   |   |   |   | *P|
>>>       +---+---+---+---+---+---+---+---+
>>>    4  |   |   |   |   |   |   |   | P |
>>>       +---+---+---+---+---+---+---+---+
>>>    3  |   |   |   |   | *K| *P| K |   |
>>>       +---+---+---+---+---+---+---+---+
>>>    2  |   |   |   |   |   |   |   |   |
>>>       +---+---+---+---+---+---+---+---+
>>>    1  |   |   |   |   |   |   |   |   |
>>>       +---+---+---+---+---+---+---+---+
>>>         a   b   c   d   e   f   g   h
>>>
>>>
>>>Obviously black is getting crushed.  He has one move, Kh3, which leads to a
>>>mate in 6.  Steffen asked me to try this and Crafty found a mate in 4, which
>>>doesn't exist.  I spent the entire day debugging this thing and here is what
>>>I found:
>>>
>>>If you recall the discussion here a couple of weeks ago, I reported that I store
>>>absolute mate scores (EXACT scores) in the hash table, and that I adjust them
>>>so that they are always stored as "mate in N from the current position".  This
>>>has always worked flawlessly for me, and still does.
>>>
>>>For bounds, I once tried adjusting the bounds as well, but found quirks, and
>>>left them alone.  Wrong answer.  To fix this mate in 4 problem, I decided to
>>>adjust the bounds as well, but I now set any bound value that is larger than
>>>MATE-300, by reducing it to exactly MATE-300, but still using the "LOWER"
>>>flag to say that this is the lowest value this position could have.  For bound
>>>values < -MATE+300, I set them to exactly -MATE+300 and leave the flag as is.
>>>
>>>This position is cute.  Because not only is it a mate in 6, but there are
>>>transpositions that lead to mate in 7, mate in 8, and there are shorter (but
>>>non-forced) mates in 4 and 5.  And there are stalemates, and positions with
>>>1 legal move, and so forth.
>>>
>>>You ought to find the following variation as one mate in 6:
>>>
>>>Kh3, f2, Kg2, Ke2, Kg3, f1=Q, Kh2, g5, hg, Kf3, g6, Qg2#
>>>
>>>If you find a shorter mate, it is wrong.  If you find a longer mate, you
>>>are probably just extending like mad on checks (crafty finds a mate in 8 at
>>>shallow depths (9 plies, 2 secs on my PII/300 notebook), and doesn't find the
>>>mate in 6 until depth 10, 3 seconds.
>>>
>>>It is a good test as the transpositions are real cute with white's king caught
>>>in a tiny box, but with several different moves that triangulate and transpose
>>>into other variations...
>>>
>>>If you get it right, you have either handled the bounds right, or else you are
>>>very lucky.  IE Crafty 16.17 gets this dead right.  But if I disable the eval,
>>>it goes bananas, yet the eval is not important when mate is possible.
>>>
>>>Have fun...
>>>
>>>I did... :)



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.