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, Rebel, chrisw
-
- Posts: 349
- Joined: Sat Aug 06, 2016 8:31 pm
- Location: United States
-
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
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.
-
- Posts: 349
- Joined: Sat Aug 06, 2016 8:31 pm
- Location: United States
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.
-
- Posts: 7216
- Joined: Mon May 27, 2013 10:31 am
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;
..
}
-
- Posts: 7216
- Joined: Mon May 27, 2013 10:31 am
Re: transposition table pseudocode
I'd better call it Search.Expired