LinkBack Thread Tools Display Modes
  #1   Report Post  
Old November 14th 03, 11:22 PM
Ken Stauffer
Posts: n/a
Default validation for a new chess engine

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

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.

Stauffer Computer Consulting

  #2   Report Post  
Old November 15th 03, 05:17 PM
Werner Mühlpfordt
Posts: n/a
Default validation for a new chess engine

In article om,
"Ken Stauffer" writes:
What is the solution??? What techniques can be used to verify
the correctness of chess engines?

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.

Best regards;
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT +1. The time now is 07:34 AM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright ©2004-2019 ChessBanter.
The comments are property of their posters.

About Us

"It's about Chess"


Copyright © 2017