killer index by "ply" or "ply"

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.
User avatar
xr_a_y
Posts: 663
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

killer index by "ply" or "ply"

Post by xr_a_y » Sun Aug 04, 2019 1:45 pm

In Minic I index killer table by "real ply" (count of half move of the position) but I see some engines using "ply" as ply from the root position being search.

Xiphos is even clearing next killer slot by

Code: Select all

sd->killer_moves[ply + 1][0] = sd->killer_moves[ply + 1][1] = 0;
at the beginning of move loop in pvs.

I was thinking that it might help to save killer indexed by real ply but I am now wondering if it's the good thing to do ...

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

Re: killer index by "ply" or "ply"

Post by hgm » Sun Aug 04, 2019 2:49 pm

Killers are a very local thing. The more positions differ, the less likely it is that the same move will work in both of them. Sibblings are already separated by 2 half-moves. If you don't clear the killer slots of the next level at the start of a node, they would recommend moves that worked in positions that differ by four ply. That could be a waste of time more often than not.

User avatar
xr_a_y
Posts: 663
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: killer index by "ply" or "ply"

Post by xr_a_y » Sun Aug 04, 2019 2:58 pm

I do clear all killers when search begins but not each ply+1 killers at each pvs node.

Writting this I understand that it is worthless to store killers index by "real half move" as I fully clear the killer table ... :oops:

But I still don't get why Xiphos is clearing ply+1 killers.

User avatar
xr_a_y
Posts: 663
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: killer index by "ply" or "ply"

Post by xr_a_y » Sun Aug 04, 2019 3:14 pm

xr_a_y wrote:
Sun Aug 04, 2019 2:58 pm
Writting this I understand that it is worthless to store killers index by "real half move" as I fully clear the killer table ... :oops:
in fact I use this in MoveSorter in order to get "current" killers without knowing the current ply ... halfmove is used. Anyway

D Sceviour
Posts: 439
Joined: Mon Jul 20, 2015 3:06 pm
Contact:

Re: killer index by "ply" or "ply"

Post by D Sceviour » Sun Aug 04, 2019 3:44 pm

xr_a_y wrote:
Sun Aug 04, 2019 2:58 pm
I do clear all killers when search begins but not each ply+1 killers at each pvs node.

Writting this I understand that it is worthless to store killers index by "real half move" as I fully clear the killer table ... :oops:

But I still don't get why Xiphos is clearing ply+1 killers.
Xiphos change log noted the idea was taken from Stockfish or Ethereal, but it did not produce much elo difference. It is probably unnecessary.

RubiChess
Posts: 99
Joined: Fri Mar 30, 2018 5:20 am

Re: killer index by "ply" or "ply"

Post by RubiChess » Sun Aug 04, 2019 4:14 pm

This was discussed here: viewtopic.php?f=7&t=69744
I tested myself clearing the killers at ply+1 but couldn't make it work.

- Andreas

User avatar
xr_a_y
Posts: 663
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: killer index by "ply" or "ply"

Post by xr_a_y » Sun Aug 04, 2019 4:49 pm

RubiChess wrote:
Sun Aug 04, 2019 4:14 pm
This was discussed here: viewtopic.php?f=7&t=69744
I tested myself clearing the killers at ply+1 but couldn't make it work.

- Andreas
Thanks

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

Re: killer index by "ply" or "ply"

Post by hgm » Sun Aug 04, 2019 6:55 pm

Even if it doesn't produce any Elo, I like the clearing, because it means that no killers can leak from one search into another. This improves reproducibility, which helps debugging.

User avatar
xr_a_y
Posts: 663
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: killer index by "ply" or "ply"

Post by xr_a_y » Sun Aug 04, 2019 8:31 pm

Cleaning at each search begin is OK and done already, for reproducibility indeed.
On the other hand, cleaning ply+1 slots before the move loop at pvs(ply) is not improving anything in Minic at least.

bob
Posts: 20392
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: killer index by "ply" or "ply"

Post by bob » Tue Aug 06, 2019 4:34 am

I remember when Dave Slate wrote the first paper I saw on this topic. He gave a position where black was on move, and white had the move Nxc7+ forking the black king and rook. As black tries different moves, almost ALL are refuted by the same move, Nxc7. Except for say Rac8 and Kd8 or Kd7 or even Kf8 to avoid the check. This is an example where clearing killers at ply+1 actually hurts significantly. And over the years it seems to me that while killers are pretty local, If you clear killers ply+1 before searching at ply, then the above won't happen, but back up two plies where white plays Nb5 and then Nxc7+ Black has to stop either Nb5 or Nxc7. Which are killer moves for most black replies. Zeroing ply+1 would at the very least wipe out the Nxc7+ move over and over whenever white plays Nb5. If he doesn't, that move is not legal and has no negative effect to speak of.

I've tried zeroing them but always found a small cost in tree size. In fact, I even try killers[ply-2] before giving up on trying killer moves, and that tested positive for me.

YMMV of course.

Post Reply