Author: James Swafford
Date: 19:53:48 05/29/05
A while back I read a suggestion on this forum by Tord about testing
for symmetry bugs in the evaluation function by flipping the board
and calling eval again (the score should be the opposite).
I was pretty sure my simple eval wouldn't have any symmetry bugs-
but I was wrong. My bug was in the king safety evaluation.
Here's the pseudocode (score is from white's POV):
If there is no white pawn on G2
{
If a white pawn is on G3, score -= small penalty
else if a white pawn is on G4, score -= slightly larger penalty
else .... <more stuff>
}
If there is no black pawn on G7
{
If a black pawn is on G6, score += small penalty
If a black pawn is on G5, score += slightly larger penalty
else ... <more stuff>
}
I don't know how many times I missed the 'else' in the black
king safety code- even after I *knew* there was a symmetry bug somewhere
in that section of the code!
I estimate that subtle bug is a couple of years old.
What are some of the oldest bugs you have found?
--
James
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.