Depth extensions and effect on transposition queries

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.
Post Reply
kdjones
Posts: 9
Joined: Mon Feb 08, 2016 6:06 pm
Location: Nova Scotia, Canada

Depth extensions and effect on transposition queries

Post by kdjones » Mon Apr 16, 2018 4:15 pm

Question: if a chess engine uses extensions such as check extension, say

Code: Select all

if ( InCheck( sideToMove ) ) depth ++;
will this not mess up subsequent TT queries which use depth to decide whether the query is a hit or a miss?

If so, what can be done about it?

User avatar
hgm
Posts: 23724
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Depth extensions and effect on transposition queries

Post by hgm » Mon Apr 16, 2018 5:06 pm

As long as you store the depth to which you are comparing on a probe, (i.e. both before or after the extension) there is no problem. Whether you are in check or not isn't path dependent. I usually store unextended depth, so that I can probe before having determined whether I am in check. So I have to subtract the extension from the depth when storing in the TT. If the TT contains the info whether you are in check, it might be easier to give the extension as the first thing you do, and only then start comparing depths. Then you can store the depth unmodified.

PK
Posts: 826
Joined: Mon Jan 15, 2007 10:23 am
Location: Warsza
Contact:

Re: Depth extensions and effect on transposition queries

Post by PK » Tue Apr 17, 2018 11:45 am

However, check extension can make search scores path-dependent. There is nothing to do about it. It does not harm, and anyway the effect is minor when compared to late move reduction.

Suppose Your engine played 1.d4 Nf6 2.c4 e6. Now 3.Nf3 Bb4+ 4.Nc3 and 3.Nc3 Bb4 4.Nf3 would be searched to different depth. When using transposition table, final score depends on which move will be searched first.

User avatar
hgm
Posts: 23724
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Depth extensions and effect on transposition queries

Post by hgm » Tue Apr 17, 2018 5:09 pm

When using TT you can sometimes get extra depth through grafting. That doesn't have anything to do with check extension per se; there are many cases where you can get grafting without any checks. E.g. from the start position 1.e3 null 2. e4 will hit upon the position after 1.e4 if the latter was searched before it, and gain an enormous depth (2 ply plus null reduction).

kdjones
Posts: 9
Joined: Mon Feb 08, 2016 6:06 pm
Location: Nova Scotia, Canada

Re: Depth extensions and effect on transposition queries

Post by kdjones » Wed Apr 18, 2018 4:22 pm

Thank you, HGM and Pawel for your insights.

Ken

Post Reply