Thank you all for your validations and suggestions. It helped me to stop focusing on these parts and find the silly bug in code not shown here.
Hopefully the initial pseudocode, with the followup correction and your tweaks, will serve as a good starting place for the next intrepid chess programmer adding a transposition table to their engine.
transposition table pseudocode
Moderators: hgm, Dann Corbit, Harvey Williamson
Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
-
- Posts: 3969
- Joined: Thu May 15, 2008 7:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
- Contact:
Re: transposition table pseudocode
Nice to read that. So was the bug related to transposition table handling or not? You seemed to have excluded that it wasn't.zenpawn wrote:Thank you all for your validations and suggestions. It helped me to stop focusing on these parts and find the silly bug in code not shown here.
Hopefully the initial pseudocode, with the followup correction and your tweaks, will serve as a good starting place for the next intrepid chess programmer adding a transposition table to their engine.
Re: transposition table pseudocode
Yes, related. It's a bit embarrassing, but here goes... At some point, I decided it was clever to use the fact a move was the only one available to save its eval before the alpha-beta checks in the pseudocode above as, get this, an Exact type. It didn't hurt too badly until I added TT to the qsearch, which has many more "only" moves. However, it was wrong it both cases.Sven Schüle wrote: Nice to read that. So was the bug related to transposition table handling or not? You seemed to have excluded that it wasn't.
Re: transposition table pseudocode
PK wrote:popular source of transposition table bugs is saving score after a search has run out of time.
Code: Select all
public void Store( ... )
{
if (Position.Expired) return;
..
}
Re: transposition table pseudocode
I'd better call it Search.Expired