TT score
Moderators: hgm, Rebel, chrisw
-
- Posts: 344
- Joined: Wed Sep 23, 2009 5:56 pm
- Location: Germany
TT score
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)?
-
- Posts: 6401
- Joined: Thu Mar 09, 2006 8:30 pm
- Location: Chicago, Illinois, USA
Re: TT score
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.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)?
Miguel
-
- Posts: 27809
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: TT score
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...
-
- Posts: 613
- Joined: Sun Jan 18, 2009 7:03 am
Re: TT score
Stockfish does this.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)?
Joona Kiiski
-
- Posts: 344
- Joined: Wed Sep 23, 2009 5:56 pm
- Location: Germany
Re: TT score
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.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...
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?
-
- Posts: 27809
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: TT score
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.
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.