Missing checkmates

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Missing checkmates

Postby Robert Pope » 28 Oct 2010, 17:51

I just ran a comparison of WAC, where my program, Beaches, doesn't find the right move until it searches at least an order of magnitude more nodes than Gerbil.

Starting with WAC.001, Gerbil finds the mate in 2 in 10K nodes, while Beaches doesn't find it until ply 6 and 20M nodes.

I haven't dug in yet, but is this by definition a bug, or are there valid causes for a 4 ply search not to find a 3 ply mate? e.g. hash collisions, etc.
Robert Pope
 
Posts: 39
Joined: 08 Apr 2006, 17:27

Re: Missing checkmates

Postby Robert Pope » 28 Oct 2010, 18:00

Well, it doesn't do that in an older version, so it's definitely a bug.
Robert Pope
 
Posts: 39
Joined: 08 Apr 2006, 17:27

Re: Missing checkmates

Postby YvesLejeail » 30 Oct 2010, 14:39

Hi,
I don't know if it is the last version, (not easy to verify it) but I have used Beaches as a partner for Milady recently. I noticed it had sometimes bugs in the hash-table, playing suddenly a very bad move (that's why I suppose it was due to hash). Maybe it is related to the problem you mentioned. Also, WAC1 is a mate in 3 plies, but if you have some nullmoves or LMR enables, the solution can be found later than 3 plies.
My 2 cents,
Yves
User avatar
YvesLejeail
 
Posts: 48
Joined: 03 Aug 2005, 17:36
Location: Pertuis, France

Re: Missing checkmates

Postby Robert Pope » 01 Nov 2010, 22:18

Thanks for the comment Yves. If you double-click the exectuable so it runs in a console window, it will say "Welcome to Beaches x.xx". Can you try that on the version you were testing?

It looks like the current issue is related to what Quies returns if there are no legal moves (vs. no captures available) from a position.
Robert Pope
 
Posts: 39
Joined: 08 Apr 2006, 17:27

Re: Missing checkmates

Postby YvesLejeail » 02 Nov 2010, 21:50

It says "Welcome to Beaches 1.52" ,so please don't take into account my comment, it was for an old Beaches version.
To my opinion the normal search should catch the mate in 3, (you detect the mate at the beginning of Alpha-Beta), so why a Quiesce problem would modify the result ?
I suggest the problem could also be due to agressive LMR settings
Yves
User avatar
YvesLejeail
 
Posts: 48
Joined: 03 Aug 2005, 17:36
Location: Pertuis, France

Re: Missing checkmates

Postby crystalclear » 29 Oct 2011, 04:06

There are various places in a chess program that you can test for checkmate, or ways of doing it.

example 1.
When a move is made, the program might mark check positions with a flag or something and for check positions might further analyse them to see if they are checkmate.

example 2.
Another way of doing things is to use the count of the number of moves created by the move generator when doing the search and if it is zero then the position is mate: checkmate or stalemate. If it is some kind of mate, then you can see whether the position has a check or not to distinguish the two case.

=

In example 1, the first time an iterative deepening search encounters the position, it see that it is checkmate, scores it as such and return an extreme score value. The program will find a mate in 3 with a depth 3 search.

In example 2, depth 2 searches don't come across the checkmate position for a mate in 3. A depth 3 search will see the position, but just score it on its material value etc. And then iterative deepening looking at depth 4, will try all the moves from that position, find there are none, realise that the position is mate: checkmate, since there is a check, and return the extreme value that would finish a mate search, but only at depth 4 for a mate in 3.

Since a lot of extra searching is potentially done, I don't think many engines work like example 2, at least after some initial testing and improvements.

===

There is a potential recusion problem with the method of example 1: if makeing a move tests for mate, if testing for mate consists of counting moves from the move generator, and if the moves generator tests moves for legality by making them and verifying the mover has not left himself in check.
To avoid that, I think some chess engines have a full blown make-move and a lazy or quick make-move.

=

Incidentally, I have just started looking at mate searches and I had the idea of having a mate search specific evaluation function that pretty much ignoresthe value of the material on the board and instead scores positons by rewarding mate related ideas like checks, removal of flight squares etc. (Is that spelling right? Flight from the verb flee, not flight from fly!)

Is there anything written anywhere that could guide me in writing a good mate-search-specific evaluation function?

Also, if I don't find mate in 3 (5 ply search), the next possible mate (if I am not looking also for mated!) is mate in 4, ie (7 ply).
Are there any tricks I should know with regard to treating the odd and even plys differently?

====

A final note: most of the recent posts are mine. If I am writing too much and should shut up, please say. Really, I thought this forum would be more busy when I registered and I am starting to feel I am talking to myself most of the time!
crystalclear
 
Posts: 91
Joined: 22 Sep 2011, 14:19


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 18 guests