A pair of test files just for you

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

A pair of test files just for you

Post by sje »

Point your Java-enabled browser at:

http://idisk.mac.com/chessnotation-Public?view=web

And you'll see a couple of downloadable FEN files that may be useful with the testing of your program.

The first is named checkmates.fen and it has 100,000 different FEN positions where each is a checkmate.

The second is named stalemates.fen and it has 100,000 different FEN positions where each is (you've guessed it) a stalemate.

Each position is legal and is one that can occur in normal play.
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: A pair of test files just for you

Post by Dann Corbit »

sje wrote:Point your Java-enabled browser at:

http://idisk.mac.com/chessnotation-Public?view=web

And you'll see a couple of downloadable FEN files that may be useful with the testing of your program.

The first is named checkmates.fen and it has 100,000 different FEN positions where each is a checkmate.

The second is named stalemates.fen and it has 100,000 different FEN positions where each is (you've guessed it) a stalemate.

Each position is legal and is one that can occur in normal play.
I guess it is to be able to recognize that you are checkmated or stalemated.

I have found that many programs are balky about analyzing positions that are already checkmates. I'm not sure if it is good or bad.
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: A pair of test files just for you

Post by Edmund »

Isn't this an issue that should be checked by the GUI?

Especially concerning the UCI-protocol, where the gui sends a position and then says 'go' if can't be expecting the engine to analyze a 'broken' position.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: A pair of test files just for you

Post by sje »

Dann Corbit wrote:I guess it is to be able to recognize that you are checkmated or stalemated.

I have found that many programs are balky about analyzing positions that are already checkmates. I'm not sure if it is good or bad.
The test files are intended to help with testing and performance measurements of:

1) the FEN file reader,
2) the FEN string decoder,
3) the checkmate detector (false negatives for checkmates.fen),
4) the stalemate detector (false negatives for stalemates.fen),
5) the perft routine (all counts should be zero).

I hadn't seen any test files like these so I thought I'd post them for other authors. The data may be freely reposted, of course.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: A pair of test files just for you

Post by sje »

Codeman wrote:Isn't this an issue that should be checked by the GUI?

Especially concerning the UCI-protocol, where the gui sends a position and then says 'go' if can't be expecting the engine to analyze a 'broken' position.
Not every program uses a GUI. Some programs may use a GUI (or two), but still have a non-GUI command mode.

Also, GUI programs should themselves be tested.
Dave Gomboc

Re: A pair of test files just for you

Post by Dave Gomboc »

Codeman wrote:Isn't this an issue that should be checked by the GUI?

Especially concerning the UCI-protocol, where the gui sends a position and then says 'go' if can't be expecting the engine to analyze a 'broken' position.
Understanding the chess position is by definition the domain of the chess engine.

When software that plays matches between two programs detects and acts upon a checkmate or stalemate, it's acting as an arbiter, which is also legitimate. The software playing the matches may also be a GUI, but arbitration and user-interface are separate roles that may be but are not necessarily performed by the same software.

Dave
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

A third test file

Post by sje »

I've added another file: matein1.fen, a collection of 100,000 unique positions that have at least one checkmating move.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: A pair of test files just for you

Post by sje »

Codeman wrote:Isn't this an issue that should be checked by the GUI?

Especially concerning the UCI-protocol, where the gui sends a position and then says 'go' if can't be expecting the engine to analyze a 'broken' position.
Symbolic does do position checking on search entry just in case of a GUI failure or of a failure is some other part of the program.

Specifically, the search returns an enumeration variable, sts (search termination status) that can take one of about a dozen values. One such value is "StsBadParameters" for an invalid position; another is "StsNoMoves" for a checkmate or stalemate position.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

A fourth test file

Post by sje »

It's not there yet because of service failure at Apple's MobileMe, but I hope you will all soon see:

matein2.fen 100,000 unique mate-in-two positions

These were produced with the assistance of Symbolic's specially coded IsPosMateIn2() routine. This function is used to help implement the program's Capablanca feature that causes a resignation before any checkmate can be delivered. (Jose Capablanca, a long time world champion and likely the greatest natural chess talent, was never checkmated.) Symbolic goes one move further and is designed to resign if it detects an unstoppable mate in two against it, so the program has also never been checkmated (outside of non-event test games).

The idea is that if a program is going to play like a grandmaster, then it should also know when to resign like a grandmaster. Any opponent that can force Symbolic into a mate in two is nearly certain not to miss the mate in two execution.
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: A pair of test files just for you

Post by Dann Corbit »

sje wrote:Point your Java-enabled browser at:

http://idisk.mac.com/chessnotation-Public?view=web

And you'll see a couple of downloadable FEN files that may be useful with the testing of your program.

The first is named checkmates.fen and it has 100,000 different FEN positions where each is a checkmate.

The second is named stalemates.fen and it has 100,000 different FEN positions where each is (you've guessed it) a stalemate.

Each position is legal and is one that can occur in normal play.
Just as a suggestion:
EPD is a lot more convenient than FEN. Most programs and nearly all chess interfaces can read EPD but a lot less can read FEN.