Page 1 of 2

Saving killer moves...

Posted: Wed Apr 25, 2018 3:16 am
by MOBMAT
when (score >= beta), the literature says to only save quiet moves, but i saw in at least one code example where the save was not done when also in check (quiet or in-check).

is this typical, and if so, why doesn't the basic literature on killers mention it?

I could have missed it, of course.

Re: Saving killer moves...

Posted: Wed Apr 25, 2018 4:45 am
by tomitank
MOBMAT wrote:when (score >= beta), the literature says to only save quiet moves, but i saw in at least one code example where the save was not done when also in check (quiet or in-check).

is this typical, and if so, why doesn't the basic literature on killers mention it?

I could have missed it, of course.
.. and dont save the promotion move.

This depends of move ordering (score of moves), prunings, reductions, extensions, etc.

You need to find the best variation..

Tamás

Re: Saving killer moves...

Posted: Wed Apr 25, 2018 4:46 am
by AndrewGrant
I only store quiets. Whether I am in check or not.

I have not seen this in any source, but If you have it is either because

1) The author made a mistake
2) The author determined it to be worth elo
3) With or without incheck is worth 0 elo, and they prefer one way over the other.

I'm going to test this now for my engine, and see what it is worth.

Re: Saving killer moves...

Posted: Wed Apr 25, 2018 2:11 pm
by MOBMAT
Rodent III does it.

but you are correct, there might be another reason for doing so.

Re: Saving killer moves...

Posted: Wed Apr 25, 2018 2:35 pm
by hgm
Killers are moves that you want to try against other preceding moves of the opponent. If you are in check, you must resolve the check. It is very unlikely that any other moves of the opponent would also deliver check. An it is also unlikely that the best move to resolve a check would be a good move to try when not in check. (It might be a move with your King!) An if another move woul put you in check, it s unlikely you woul want to resolve it in the same way. (The check may come from a different direction, so you will have to interpose on another ray.) So saving evasions as killers can be expected to be bad. Likewise, trying killers to evade check also makes little sense; they might not even be legal.

Re: Saving killer moves...

Posted: Wed Apr 25, 2018 4:40 pm
by tomitank
MOBMAT wrote:Rodent III does it.

but you are correct, there might be another reason for doing so.
Stockfish was the first as far as I know. Then Senpai 1.0, Rodent etc.. and tomitankChess does it as well.

Re: Saving killer moves...

Posted: Wed Apr 25, 2018 6:48 pm
by Volker Annuss
Captures can become killers in Arminius to have these capture moves searched before others.

There is one important exception. Moves that capture the last moved piece never become killers.

Re: Saving killer moves...

Posted: Wed Apr 25, 2018 7:49 pm
by jwes
Volker Annuss wrote:Captures can become killers in Arminius to have these capture moves searched before others.

There is one important exception. Moves that capture the last moved piece never become killers.
Do you also check if the move is still a capture?

Re: Saving killer moves...

Posted: Wed Apr 25, 2018 8:49 pm
by Volker Annuss
No, any move that is not en passant, underpromotion and not moving to the same square as the move one ply before is a killer move. When ordering moves they get a bonus that makes killers more important than quiet moves and captures more important than most other captures.

Re: Saving killer moves...

Posted: Wed Apr 25, 2018 10:50 pm
by AndrewGrant
Went ahead and tried the logic from your post.

While Intuitive, it seems to be not worth any elo...

Test 1) Don't store into the killer table when we are in check

SPRT @ 5.0+0.05s Threads=1 Hash=8MB
LLR: -2.24 (-2.20, 2.20) [0.00, 5.00]
Games: 5475 W: 1324 L: 1398 D: 2753

Test 2) Don't store or read the killer table when we are in check

SPRT @ 3.0+0.03s Threads=1 Hash=2MB
LLR: 2.21 (-2.20, 2.20) [0.00, 5.00]
Games: 8225 W: 2270 L: 2119 D: 3836

SPRT @ 15.0+0.15s Threads=1 Hash=32MB
LLR: -0.79 (-2.20, 2.20) [0.00, 5.00]
Games: 5375 W: 1137 L: 1146 D: 3092

I'll give the longer test some more time, as the error bars are still decently large. The gain (if any) might just be the slight speedboost from not trying to make the killer moves which, as you said, are likely illegal when in check anyway.