Closed PraxTube closed 1 year ago
One possible way to deduce which illegal moves are causing the issue, we could generate ALL moves to say depth 3 by simply running each board with depth 1 and then add the total number of moves. If the number of moves equals the Shannon number in this case, then the illegal moves are likely caused by either repetition moves or on passant moves.
Note that depth=2
also gives wrong moves. We should see 400
moves, but we see 420
.
Okay, so the problem seemed to be the following:
We counted every single node in the search tree, but the Shannon number only represents the nodes that get evaluated (i.e. the leaf nodes). You can also notice that we 420
instead of 400
, in other words 420 - 20 = 400
. Same with the others 9322 - 420 = 8902
.
So this never really was a bug, but rather a misunderstanding.
It's also likely that the mentioned issue #23 is not related to this at all, though perhaps that too is a misunderstand of sorts?
See debug-node-moves branch for more info.
The current engine calculates the following amount of moves:
Depth 3: 9322
Depth 4: 206603
However the actual numbers are
Depth 3: 8902
Depth 4: 197281
See Shannon number
So the current engine somehow calculates too many moves. My suspicion is that moves like en passant aren't woring correctly or that moves regarding check are broken.
This might also be because of the 3 move repetition draw rule, which is not checked in the chess engine.