Moderator: Andres Valverde
You should hash the castle keys whenever the king loses its castle rights permanently, whether this is by doing the castle or moving the rook or king doesn't matter.
I did it also in some earlier versions, but eventually took it out for those reasons.
As a principle I want the same position to be evaluated the same no matter
how it is reached.
As a principle I want the same position to be evaluated the same no matter
how it is reached.
Sune Fischer wrote:Tom:
"The hash table returned an exact hit because the search had managed to create the same position by transposition except that the pawn took two moves to reach the critical mating square, when an en'passant was not valid. "
This would seem like the same problem, I'm guessing a hash bug.
"Tom:
So you see - when the uncastled king wanders to same location and same resulting position (and so same hashkey) the evaluation is going to be different depending on whether it was a castled into this position or transposed into this position. "
You should hash the castle keys whenever the king loses its castle rights permanently, whether this is by doing the castle or moving the rook or king doesn't matter.
The same position should not have two corresponding keys (inefficient) and more importantly two positions must never have the same key (huge bug).
Unfortunately this is a bit ugly since you have to check for it at every rook and king move. At least I have not found a better way
Sune Fischer wrote:What Uri does is very impressive.
Not only is it a novel approach but he can actually make it work too.
Tom Likens wrote:It's possible of course, but I don't believe so (I've *never* had a bug in my hash table :D). The position in question *was* a mate if the opponent couldn't capture the checking pawn en'passant (the pawn actually delivered the mate). The search managed to create two identical positions but in one the en'passant capture was illegal and hence a real mate. In the 2nd the mate could be prevented by the pawn capture. The mate position was stored in the hash tree first and later retrieved incorrectly for the non-mate position because the hash keys, without the en'passant information, were the same.
Regardless, the problem was eliminated when I added en'passant information to the key.
Tom Likens wrote:What approach does Uri take? "
Sune Fischer wrote:Hi Tom,
Ahem okay, so let's not call it a bug. Let's just say there was something
unintentionally missing in the code that caused the engine to seemingly misbehave a little bit at random.
Tom Likens wrote:What approach does Uri take? "
He takes the non-transpositional approach
Really attacking an old dogme of computer chess, and not completely
unsuccessful at it either
Perhaps some day they have to rewrite the books on graph theory and
tree search.
Who knows what will happen when Movei becomes WCCC.
-S.
Return to Programming and Technical Discussions
Users browsing this forum: No registered users and 33 guests