Killer moves based on distance to common ancestor

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Killer moves based on distance to common ancestor

Post by matthewlai »

Random idea of the day -

In killer moves, we make the assumption that moves that are effective for other nodes at the same ply have a high probability of being effective on the position under consideration as well.

For deep positions, this is really only true when 2 positions have a deep common ancestor. If we have 2 positions at ply=20 from 2 different root moves, chances are they will be entirely unlike one another, and the killer move from one on the other would just be noise.

It is easy to compare ancestry using search stack. An alternative way is to compute the hamming distance between the position under consideration, and the position that generated the killer move.

Is there a way to make use of that information?
Disclosure: I work for DeepMind on the AlphaZero project, but everything I say here is personal opinion and does not reflect the views of DeepMind / Alphabet.
jordanbray
Posts: 52
Joined: Mon Aug 11, 2014 3:01 am

Re: Killer moves based on distance to common ancestor

Post by jordanbray »

It should do that automatically. The killer moves list should be a queue, and when a new one is added, you should also be removing one. This means that nodes close to one another should have (mostly) the same killer moves, and moves with a different root should have different killers.
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Killer moves based on distance to common ancestor

Post by hgm »

Killer moves are almost always moves from direct sibblings (i.e. with the same parent), because those are the nodes visited directly before (at that ply level) when you recursively walk the tree. Some engines (Ippolit) even clear the ply+2 slot before calling any children to make sure you cannot inherit any killer from a cousin..
matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: Killer moves based on distance to common ancestor

Post by matthewlai »

jordanbray wrote:It should do that automatically. The killer moves list should be a queue, and when a new one is added, you should also be removing one. This means that nodes close to one another should have (mostly) the same killer moves, and moves with a different root should have different killers.
Ah yes it does. I didn't think about the tree traversal order.
Disclosure: I work for DeepMind on the AlphaZero project, but everything I say here is personal opinion and does not reflect the views of DeepMind / Alphabet.
matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: Killer moves based on distance to common ancestor

Post by matthewlai »

hgm wrote:Killer moves are almost always moves from direct sibblings (i.e. with the same parent), because those are the nodes visited directly before (at that ply level) when you recursively walk the tree. Some engines (Ippolit) even clear the ply+2 slot before calling any children to make sure you cannot inherit any killer from a cousin..
I wonder if it would be beneficial to do killers based on position similarity (eg. hamming distance) instead of ply. Some sort of fuzzy transposition matching.

It would require a different data structure, though.
Disclosure: I work for DeepMind on the AlphaZero project, but everything I say here is personal opinion and does not reflect the views of DeepMind / Alphabet.
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Killer moves based on distance to common ancestor

Post by hgm »

I think that would be called a 'refutation table'.
matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: Killer moves based on distance to common ancestor

Post by matthewlai »

hgm wrote:I think that would be called a 'refutation table'.
The difficult part is doing fuzzy matching efficiently.
Disclosure: I work for DeepMind on the AlphaZero project, but everything I say here is personal opinion and does not reflect the views of DeepMind / Alphabet.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Killer moves based on distance to common ancestor

Post by cdani »

Instead of position similarity, I use some little hashes of refutation moves for sequences of moves of different length (2, 4 and 6 moves) in Andscacs.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Killer moves based on distance to common ancestor

Post by cdani »

hgm wrote:Some engines (Ippolit) even clear the ply+2 slot before calling any children to make sure you cannot inherit any killer from a cousin..
Thanks to you mentioning it, I just tried on Andscacs and was a little win! :-)