Exact node values
Posted: Wed Jan 16, 2013 11:09 pm
So I've discovered a major bug in my transposition table. Right now I'm only considering nodes that returned an exact value, not nodes that produced cutoffs. Here's the steps I'm taking for it:
1. In the search method, before looping through each move, see if there's an entry in the table for the current hash key. If there is, simply return the value stored in the table.
2. After looping through each move, save the current hash key along with the determined value in the transposition table. Only save the hash key and value if the value is an exact value for the position.
I am under the impression that a node value is exact if and only if: A move was found that beat the current alpha value, and no move was found that exceeded the beta value.
However, my engine is not working with this. It allows its queen to be taken by a pawn. It doesn't do this if I take out the transposition table.
EDIT: I should be more clear. I get it to a point in the game where I move one of my pawns up, threatening my engine's queen. It makes a mindless rook move and allows me to capture the queen. If, however, I clear the Ttable before I make my pawn move, it doesn't allow it's queen to be taken. It makes a perfectly acceptable retreat of its queen.
1. In the search method, before looping through each move, see if there's an entry in the table for the current hash key. If there is, simply return the value stored in the table.
2. After looping through each move, save the current hash key along with the determined value in the transposition table. Only save the hash key and value if the value is an exact value for the position.
I am under the impression that a node value is exact if and only if: A move was found that beat the current alpha value, and no move was found that exceeded the beta value.
However, my engine is not working with this. It allows its queen to be taken by a pawn. It doesn't do this if I take out the transposition table.
EDIT: I should be more clear. I get it to a point in the game where I move one of my pawns up, threatening my engine's queen. It makes a mindless rook move and allows me to capture the queen. If, however, I clear the Ttable before I make my pawn move, it doesn't allow it's queen to be taken. It makes a perfectly acceptable retreat of its queen.