transposition table pseudocode

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
zenpawn
Posts: 299
Joined: Sat Aug 06, 2016 6:31 pm
Location: United States

Re: transposition table pseudocode

Post by zenpawn » Wed Aug 24, 2016 10:21 am

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.

Sven
Posts: 3830
Joined: Thu May 15, 2008 7:57 pm
Location: Berlin, Germany
Full name: Sven Schüle
Contact:

Re: transposition table pseudocode

Post by Sven » Wed Aug 24, 2016 10:54 am

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.
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
Posts: 299
Joined: Sat Aug 06, 2016 6:31 pm
Location: United States

Re: transposition table pseudocode

Post by zenpawn » Wed Aug 24, 2016 11:20 am

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.
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.

Henk
Posts: 5833
Joined: Mon May 27, 2013 8:31 am

Re: transposition table pseudocode

Post by Henk » Wed Aug 24, 2016 11:41 am

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;

              ..
        }

Henk
Posts: 5833
Joined: Mon May 27, 2013 8:31 am

Re: transposition table pseudocode

Post by Henk » Wed Aug 24, 2016 12:07 pm

I'd better call it Search.Expired

Post Reply