Login

It's Free!

Who's Online

17 Guests Online
16 Users Online

Related Tags

None found

 
 post new topic

validation for a new chess engine

Related Forum Topics:
Pawn Check Mate, Forced Mate in 10
Pawn Check Mate, Forced Mate in 10
New longest mate found
Found an article to improve my chess game
Shortest grandmaster game ending in mate
Found a defence for a spectacular mate in ...


validation for a new chess engine - 2006/08/28 23:47 My chess engine is done. It plays decent chess. It beats my Excalibor Chess game at various skill levels etc... But I really don't know if I implmented the various search algorithms correctly. In fact, I just found a bug in which I was assigning a score of "Infinity - depth" to a stale-mate condition. The result was decent game play... most of the time. But then during a routine chess game, I found my engine select a move that caused a stale-mate, when there was a perfectly good move that would cause check-mate.

Had I not stumbled onto this end-game situation during testing, this bug would have remained in my program for a very long time.

I don't think visual inspection of the code is a viable way to verify the correctness of my engine. Even though I understand the alpha-beta algorithm, its easy to overlook an error when there's a lot of other stuff going on (like transposition lookups). But it also seems that playing chess games is not a productive way to find the errors in a chess engine either.
What is the solution??? What techniques can be used to verify the correctness of chess engines?
Ken Stauffer

PS. The fix for my bug was to assign use a value of "zero" (instead of Infinity) when a stale-mate was detected, and this in fact fixed my problem..
---------
Success is simply a matter of luck. Ask any failure.



  Popular posts by hogfather
bitboards and evaluation functio...
Looking for a chess program
Chess game download
  | | | post reply
re:validation for a new chess engine - 2006/08/29 00:28 I ran into exactly the same stalemate problem three weeks ago, and encountered it in a game as well. Obviously, this is not really satisfying. The feature had worked before, but a redesign of the search broke it. Normally, I write a unit test case for each such piece of functionality, and frequently run the entire suite.
For the stalemate detection (sooo trivial I skipped this and it promptly backfired.

My suggestion to approach the problem in general is only valid if you use real objects (with real information hiding and so on):
use something like CPPunit (Google will help if required) to make each of your objects well-behaved. Have a test case ready for each piece of functionality, and implement the test even before the feature. Run the test, be sure it fails, implement the feature, be sure it passes. Use suites of positions for everything that is not local to a few objects, and pick these positions carefully.
The real challenge is not to come up with a set of test cases that supply good coverage, but to also make them maintainable..
---------
Forty is the old age of youth; fifty the youth of old age.



  Popular posts by MorningDove16
Newbie question
bitboards and evaluation functio...
Is it necessary to include emty ...
  | | | post reply



© 2008 ChessCircle
Joomla! is Free Software released under the GNU/GPL License.