TT score

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
metax
Posts: 344
Joined: Wed Sep 23, 2009 3:56 pm
Location: Germany

TT score

Post by metax » Wed Feb 03, 2010 4:30 pm

Normally you only take the score from the TT (and then test if you can prune the branch safely) if the depth of the TT entry is greater than or equal the remaining depth. Would it be safe to ignore this condition if the score stored is a mate value since it would be useless to search that branch again (of course only if the alpha-beta bounds indicate that pruning is safe)?

User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 7:30 pm
Location: Chicago, Illinois, USA
Contact:

Re: TT score

Post by michiguel » Wed Feb 03, 2010 5:42 pm

metax wrote:Normally you only take the score from the TT (and then test if you can prune the branch safely) if the depth of the TT entry is greater than or equal the remaining depth. Would it be safe to ignore this condition if the score stored is a mate value since it would be useless to search that branch again (of course only if the alpha-beta bounds indicate that pruning is safe)?
Yes, If I understood correctly. Once you find a mate score in a sub-branch, the score could become only better for the mating side (if your implementation of mates is bug free). So, the score could be mate or better, no matter how deeper you search. There is no point in searching deeper if a mater score will suffice to cut off.

Miguel

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

Re: TT score

Post by hgm » Wed Feb 03, 2010 7:28 pm

indeed, mate scores are valid to any depth. At one point I stored them with infinite depth in the hash table, but that was a bad idea when I used the depth to make replacement decisions. very rapidly the hash table was completely poisoned with mate scores, leaving no room for other entries...

zamar
Posts: 613
Joined: Sun Jan 18, 2009 6:03 am

Re: TT score

Post by zamar » Wed Feb 03, 2010 7:46 pm

metax wrote:Normally you only take the score from the TT (and then test if you can prune the branch safely) if the depth of the TT entry is greater than or equal the remaining depth. Would it be safe to ignore this condition if the score stored is a mate value since it would be useless to search that branch again (of course only if the alpha-beta bounds indicate that pruning is safe)?
Stockfish does this.
Joona Kiiski

metax
Posts: 344
Joined: Wed Sep 23, 2009 3:56 pm
Location: Germany

Re: TT score

Post by metax » Wed Feb 03, 2010 8:11 pm

hgm wrote:indeed, mate scores are valid to any depth. At one point I stored them with infinite depth in the hash table, but that was a bad idea when I used the depth to make replacement decisions. very rapidly the hash table was completely poisoned with mate scores, leaving no room for other entries...
It is simple to add a condition for the score itself anyway. You can simply use "if (entry->Depth >= depth || IsMateScore(entry->Score))" instead of only "if (entry->Depth >= depth)" which is much simpler than playing around with infinite depths.

Just waned to know if this is safe, but it seems so. Btw, is this the reason (together with Mate Distance Pruning) for Stockfish reaching depth 100 pretty quickly when it has found a (short) mate?

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

Re: TT score

Post by hgm » Wed Feb 03, 2010 10:15 pm

mate-distance pruning alone is enough for that. You will see the same in micro-Max. (Except that I limited the depth to 28 there, for no real reason.)

Joker does not even deepen beyond 2N-1 ply when it finds a mate-in-N, so you would never see it go to 100.

Post Reply