Page 1 of 1

ROCE en-passant bug

PostPosted: 30 Jan 2011, 12:23
by Roy van Rijn
Hi (again),

First: Sorry for the overload of topics/questions lately...

Yesterday I started solving the many small bugs in my chess engine using perft/divide. This proved very usefull indeed. For this I've been using ROCE since Roman has a good description on how to use perft/divide on his website including examples.

But now I've run into a problem, with the following position:
8/2p5/3p4/KP5r/1R3pPk/8/4P3/8 b g3 - 0 1

My own engine claims there are 17 legal positions, and so does the cpw (!) but ROCE claims there are 18 positions.
After a short analysis I've found out the move: f4g3.
ROCE claims this is legal, but it isn't. The en-passant move will put the black king in check with the discovered rook on b4!

Which tools do you guys use to track down bugs? Are there better chess engines with such an easy perft/divide as ROCE has?

Update
Also when playing the f4g3 move in ROCE it doesn't see that it is now done. It continues to play with the rook in plain view of the king hehe.

Re: ROCE en-passant bug

PostPosted: 30 Jan 2011, 12:47
by Roman Hartmann
Hi,
you're right regarding the en-passant bug. And actually you're not the first to discover this bug. You might also have noted that the bug is color dependent.

Anyway, time to release a fixed version even though this bug-fixed version won't play any stronger than the previous version 0.390.

Might take a few hours though as I'm planning to release a 64-bit of it as well.

If you tell me what you're using (Windows, Linux, Mac) I could provide you with an extra link to a fixed version in a few minutes though.

best regards
Roman

output of the fixed version:
Code: Select all
roce: setboard 8/2p5/3p4/KP5r/1R3pPk/8/4P3/8 b g3 - 0 1

roce: divide 1

h4g4 1
h4h3 1
h4g3 1
h4g5 1
c7c6 1
c7c5 1
d6d5 1
f4f3 1
h5g5 1
h5f5 1
h5e5 1
h5d5 1
h5c5 1
h5b5 1
h5h6 1
h5h7 1
h5h8 1
Moves: 17

Re: ROCE en-passant bug

PostPosted: 30 Jan 2011, 12:53
by Roy van Rijn
Wow, very quick response...

I'm using Windows and I'd love to have the fixed version (64 bit would be fine as well). My own engine has different results a couple of iterations further on, a bug I want to eliminate.
(http://chessprogramming.wikispaces.com/Perft+Results, Position 3, perft 6 and 7)

Re: ROCE en-passant bug

PostPosted: 30 Jan 2011, 13:34
by Roman Hartmann
Ok, took me a little longer but I wanted to run a sanity-check first so I don't release something completely buggy.

Direct link to windows binary (64-bit systems only): http://www.rocechess.ch/roce395.zip

Let me know if it works on your system. It's my first compile of an 64-bit exe for windows so I would like some feedback.

For those running tournaments with my engine included better wait till I make an official release.

best regards
Roman

Re: ROCE en-passant bug

PostPosted: 30 Jan 2011, 13:47
by Roy van Rijn
Works like a charm on WIndows 7, 64 bit. Thanks!

Re: ROCE en-passant bug

PostPosted: 30 Jan 2011, 14:18
by Aleks Peshkov
"8/2p5/3p4/KP5r/1R3pPk/8/4P3/8 b g3 - 0 1" is not valid FEN
"8/2p5/3p4/KP5r/1R3pPk/8/4P3/8 b - g3 0 1" is.

Re: ROCE en-passant bug

PostPosted: 30 Jan 2011, 14:50
by Roy van Rijn
Sorry, obviously a typo!