Transposition table in PV nodes

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Transposition table in PV nodes

Post by metax »

Why do we use the transposition table for move ordering in PV nodes if we want to search the move from the triangular PV array first anyway?
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Transposition table in PV nodes

Post by hgm »

I don't even have a triangular array in Joker. Why would you want a triangular array if you have a transposition table?

I just implemented a triangular array in Fairy-Max, to have something to print after the search, but the PVs I get from there are very incomplete. PV hits cut them short too often. I should collect some statistics on the number of PV nodes. If there aren't too many, perhaps it would be a good idea to store the complete PV in the hash table with a PV node. Most PV nodes will have low draft anyway, so a pretty short PV. Moves can be encoded in a single byte, and in Joker the hash entries are 9 bytes. S if I reserve 2 entries in stead of 1 for a PV node, it would allow me to store the PV for any PV node with a draft <= 9.
Last edited by hgm on Mon Jan 18, 2010 10:46 pm, edited 1 time in total.
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: Transposition table in PV nodes

Post by jwes »

metax wrote:Why do we use the transposition table for move ordering in PV nodes if we want to search the move from the triangular PV array first anyway?
If you stuff the pv into the transposition table at the start of the search, you don't need any special code to handle the old pv.
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Transposition table in PV nodes

Post by metax »

Because at least in my program, I only do a move entry in the transposition table if the search has failed high, which rarely happens. Otherwise I don't even save the best move in the TT. Is this wrong?
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Transposition table in PV nodes

Post by metax »

jwes wrote:If you stuff the pv into the transposition table at the start of the search, you don't need any special code to handle the old pv.
Whyt do you mean by 'stuff the pv into the transposition table'?
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: Transposition table in PV nodes

Post by Gerd Isenberg »

metax wrote:Why do we use the transposition table for move ordering in PV nodes if we want to search the move from the triangular PV array first anyway?
Even with a triangular PV array most PV-Nodes are not leftmost in practice.
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: Transposition table in PV nodes

Post by Gerd Isenberg »

metax wrote:Because at least in my program, I only do a move entry in the transposition table if the search has failed high, which rarely happens. Otherwise I don't even save the best move in the TT. Is this wrong?
Storing Cut-nodes is fine and happens frequently. Anyway you should store PV-nodes as well, despite triangular array. It is also common to store upper-bound scores of All-nodes.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Transposition table in PV nodes

Post by hgm »

metax wrote:Because at least in my program, I only do a move entry in the transposition table if the search has failed high, which rarely happens. Otherwise I don't even save the best move in the TT. Is this wrong?
Yes, this is wrong. You have a best move whenever score > alpha, and you might as well store it. Because what is a PV node now will become a cut-node when a later side-branch supeseeds the current PV. And in the next iteration you will revisit that cut node, and then you don't have any idea what could be a cut move, while you could have known even which move was best.

Your hash table will contain tens of thousands of PV nodes, and he triangular array only a dozen.
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: Transposition table in PV nodes

Post by jwes »

metax wrote:
jwes wrote:If you stuff the pv into the transposition table at the start of the search, you don't need any special code to handle the old pv.
Whyt do you mean by 'stuff the pv into the transposition table'?
At the start of each iteration, you put the positions in the pv into the hash table, so that getting a best move from the hash table for a position in the pv gets the pv move.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Transposition table in PV nodes

Post by bob »

metax wrote:Why do we use the transposition table for move ordering in PV nodes if we want to search the move from the triangular PV array first anyway?
Because you ought to have the PV array moves in the TT already. This avoids special-purpose code for PV nodes, and a test that would be false most of the time (is this a pv node? then search this first, else search the TT move first).

Just a matter of efficiency/speed, nothing more.