What if the TT knew the number of moves

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
MOBMAT
Posts: 63
Joined: Sat Feb 04, 2017 10:57 pm
Location: USA

What if the TT knew the number of moves

Post by MOBMAT » Fri Jun 15, 2018 1:27 am

If the TT could return the number of legal moves for EXACT/ALPHA positions, what could that information be used for?
What comes to mind is if we know there is only one move available, but not sure what to do with it.
Ideas?

Code: Select all

NumberOfMoves = 0
get next move ()
   {
   if !legal()
      continue
   increment NumberOfMoves
   // do stuff
   }
if NumberOfMoves = 0, return mate or draw
// if we make it all the way through to here
// we have tried every move....
if we have a best move
   store TT (EXACT, NumberOfMoves)
else
   store TT(ALPHA, NumberOfMoves)
Vince S
Author of MOBMAT

"Reductions, extensions, and pruning, oh my!"

Dann Corbit
Posts: 8953
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: What if the TT knew the number of moves

Post by Dann Corbit » Fri Jun 15, 2018 2:32 am

I think the number is mostly superfluous, since you are probably going to generate the moves anyway.

It can have other uses as well, besides knowing if something is a singular move.

If you have {for instance} only 5 possible legal moves, you should prune less.

If you have {for instance} 150 possible legal moves, you can prune more.

If you do have a singular move, many engines make than an extension to search deeper.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

syzygy
Posts: 4319
Joined: Tue Feb 28, 2012 10:56 pm

Re: What if the TT knew the number of moves

Post by syzygy » Fri Jun 15, 2018 10:48 am

MOBMAT wrote:
Fri Jun 15, 2018 1:27 am
If the TT could return the number of legal moves for EXACT/ALPHA positions, what could that information be used for?
What comes to mind is if we know there is only one move available, but not sure what to do with it.
Ideas?
My first engine set a bit in a position's TT entry if the search had figured out there was only one legal move. That bit was then used to trigger an extension the next time the position was encountered.

Post Reply