For this reason I never try to zoom in on an erroneous perft count by just calculating a sub-tree. I always calculate the full tree that originally showed the error, and just do a deeper divide on it.Bloodbane wrote:I had a bug like this long ago, it was caused by faulty updating of castling rights in unmake. Basically the program messed the rights up when getting out of one part of the tree and it affected the counts in the others. When divide was done the part of the tree which messed the right up was no longer there so everything was fine. Of course in your case it might not be castling rights but given the position it seems like it's the most likely explanation.
Newbie programmer: weird bug in perft, node count changing
Moderators: hgm, Rebel, chrisw
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Newbie programmer: weird bug in perft, node count changi
-
- Posts: 1334
- Joined: Sun Jul 17, 2011 11:14 am
Re: Newbie programmer: weird bug in perft, node count changi
Aren't Heisenbugs* fun?hgm wrote:For this reason I never try to zoom in on an erroneous perft count by just calculating a sub-tree. I always calculate the full tree that originally showed the error, and just do a deeper divide on it.Bloodbane wrote:I had a bug like this long ago, it was caused by faulty updating of castling rights in unmake. Basically the program messed the rights up when getting out of one part of the tree and it affected the counts in the others. When divide was done the part of the tree which messed the right up was no longer there so everything was fine. Of course in your case it might not be castling rights but given the position it seems like it's the most likely explanation.
Matthew:out
*Heisenbug - a bug which disappears when you try to debug it
Some believe in the almighty dollar.
I believe in the almighty printf statement.
I believe in the almighty printf statement.
-
- Posts: 83
- Joined: Mon Mar 24, 2014 12:26 am
- Location: Glen Carbon, IL USA
Re: Newbie programmer: weird bug in perft, node count changi
As opposed to a Schrodinger's Bug, which is a bug only when you are looking at it.ZirconiumX wrote:Aren't Heisenbugs* fun?hgm wrote:For this reason I never try to zoom in on an erroneous perft count by just calculating a sub-tree. I always calculate the full tree that originally showed the error, and just do a deeper divide on it.Bloodbane wrote:I had a bug like this long ago, it was caused by faulty updating of castling rights in unmake. Basically the program messed the rights up when getting out of one part of the tree and it affected the counts in the others. When divide was done the part of the tree which messed the right up was no longer there so everything was fine. Of course in your case it might not be castling rights but given the position it seems like it's the most likely explanation.
Matthew:out
*Heisenbug - a bug which disappears when you try to debug it