I've discovered a thing that has confused me at very least...
So I was debugging my search because it returned weird moves when time is up.
I didn't yet manage to fix that while my JS implementation seems to be the same as C one,
but that doesn't matter.
So I've started breaking down the process and suddenly realized that if I do following:
Code: Select all
nodes = 0;
alphabeta(-infinity, infinity, 4);
nodes = 0;
alphabeta(-infinity, infinity, 4);
nodes = 0;
alphabeta(-infinity, infinity, 4);
nodes = 0;
alphabeta(-infinity, infinity, 4);
Code: Select all
output:
nodes: 6515
nodes: 2806
nodes: 3846
nodes: 3546
So I started to think: if the difference in nodes is caused by the beta cutoffs it means that the move ordering is changing.
So I disabled move ordering but the node count was still different every next run.
Finally I decided to check piece lists and yes - that was the matter of piece order in piece list.
My piece list incremental updates are implemented exactly the same way as in VICE, so in VICE (JS) same test gives similar results.
Did anyone reveal this behavior before?
Is it ok for piece lists to swap piece order while piece-square associations remain correct?
Can we exploit this behavior to improve move ordering?
P.S. What does it means if engine sacs queen or does similar weird move when the time is up?