### perft/divide bug in roce38 and Sharper? [SOLVED]

Posted:

**16 Oct 2013, 17:02**Hello,

I'm relatively new to chessengine programming. Currently I'm trying to squash all the bugs in my movegenerator using perft/divide-functions of other engines (roce38 and sharper). It might be that I still understand something wrong but I think I found a bug/inconsistent behaviour.

The position in question is the following:

rnbqkbnr/1ppppppp/8/8/1p6/P7/2PPPPPP/RNBQKBNR w KQkq - 0 3

Sharper:

roce38:

Both engines give (c2c4 26). My engine however gives (c2c4 25). So, naturally, I try the position with c2c4 played with (divide 1) and to my surprise both engines now give 25:

Sharper:

roce38:

Is this really a bug or am I crazy?

I hope someone could verify this or enlighten me.

Thank you very much in advance!

I'm relatively new to chessengine programming. Currently I'm trying to squash all the bugs in my movegenerator using perft/divide-functions of other engines (roce38 and sharper). It might be that I still understand something wrong but I think I found a bug/inconsistent behaviour.

The position in question is the following:

rnbqkbnr/1ppppppp/8/8/1p6/P7/2PPPPPP/RNBQKBNR w KQkq - 0 3

Sharper:

- Code: Select all
`setboard rnbqkbnr/1ppppppp/8/8/1p6/P7/2PPPPPP/RNBQKBNR w KQkq - 0 3`

divide 2

b1c3 26

c1b2 25

a1a2 25

g1h3 25

g1f3 25

c2c3 26

c2c4 26

d2d3 25

d2d4 25

e2e3 25

e2e4 25

f2f3 25

f2f4 25

g2g3 25

g2g4 25

h2h3 25

h2h4 25

a3a4 23

a3b4 25

Nodes: 476

Moves: 19

roce38:

- Code: Select all
`roce: setboard rnbqkbnr/1ppppppp/8/8/1p6/P7/2PPPPPP/RNBQKBNR w KQkq - 0 3`

roce: divide 2

a3a4 23

a3b4 25

c2c3 26

c2c4 26

d2d3 25

d2d4 25

e2e3 25

e2e4 25

f2f3 25

f2f4 25

g2g3 25

g2g4 25

h2h3 25

h2h4 25

a1a2 25

b1c3 26

c1b2 25

g1h3 25

g1f3 25

Moves: 19

Nodes: 476

Both engines give (c2c4 26). My engine however gives (c2c4 25). So, naturally, I try the position with c2c4 played with (divide 1) and to my surprise both engines now give 25:

Sharper:

- Code: Select all
`setboard rnbqkbnr/1ppppppp/8/8/1pP5/P7/3PPPPP/RNBQKBNR b KQkq - 0 3`

divide 1

b7b6 1

b7b5 1

c7c6 1

c7c5 1

d7d6 1

d7d5 1

e7e6 1

e7e5 1

f7f6 1

f7f5 1

g7g6 1

g7g5 1

h7h6 1

h7h5 1

a8a7 1

a8a6 1

a8a5 1

a8a4 1

a8a3 1

b8c6 1

b8a6 1

b4b3 1

b4a3 1

g8h6 1

g8f6 1

Nodes: 25

Moves: 25

roce38:

- Code: Select all
`roce: setboard rnbqkbnr/1ppppppp/8/8/1pP5/P7/3PPPPP/RNBQKBNR b KQkq - 0 3`

roce: divide 1

b7b6 1

b7b5 1

c7c6 1

c7c5 1

d7d6 1

d7d5 1

e7e6 1

e7e5 1

f7f6 1

f7f5 1

g7g6 1

g7g5 1

h7h6 1

h7h5 1

b4b3 1

b4a3 1

a8a7 1

a8a6 1

a8a5 1

a8a4 1

a8a3 1

b8a6 1

b8c6 1

g8f6 1

g8h6 1

Moves: 25

Is this really a bug or am I crazy?

I hope someone could verify this or enlighten me.

Thank you very much in advance!