Ordering of Root moves and search instability !

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

MahmoudUthman
Posts: 234
Joined: Sat Jan 17, 2015 11:54 pm

Ordering of Root moves and search instability !

Post by MahmoudUthman »

Changing the ordering of root moves results in different search results , is this normal ?
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: Ordering of Root moves and search instability !

Post by Henk »

At least it is understandable. Different search means different results.
MahmoudUthman
Posts: 234
Joined: Sat Jan 17, 2015 11:54 pm

Re: Ordering of Root moves and search instability !

Post by MahmoudUthman »

it's a start-position search to depth=8 , with everything as is (new instance of the engine ,no hash, pruning,..etc.. ,just eval & AB search ) with the ordering method for root moves as the sole difference .
PK
Posts: 893
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: Ordering of Root moves and search instability !

Post by PK »

It can happen for a couple of reasons. I don't know which ones might apply in Your case or how advanced Your engine is.

First, two moves of the same value. Suppose that Your engine, while analyzing starting position, thinks that 1...e6 is the best reply to both 1.e4 and 1.d4 and in both cases wants to continue as white with the other central pawn. Then the choice between 1.e4 and 1.d4 is determined solely by which move is searched first.

The second legitimate reason might be the check extension (or any other extension/reduction trick that You might be using, but it's easier to explain with check extension). Suppose You compare the following lines: 1.d4 Nf6 2. c4 e6 3. Nc3 Bb4 (no check!) 4. Nf3 and 1.d4 Nf6 2.c4 e6 3.Nf3 Bb4 (check!) 4.Nc3. If You search them in that order, the second one is searched one ply deeper. However, if You switch the order, transposition table will ensure that score is the same.

And as Your engine becomes more complex, there are more and more ways for root move ordering change to change the score, like late move reduction with variable depth + history table.

But, just in case, try running both versions of Your engine against each other, to make sure that it is one of the reasons I listed and not a bug.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Ordering of Root moves and search instability !

Post by bob »

MahmoudUthman wrote:Changing the ordering of root moves results in different search results , is this normal ?
Yep. Change ordering, change LMR, change hash hits, change killer/counter moves, just for starters...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Ordering of Root moves and search instability !

Post by bob »

MahmoudUthman wrote:it's a start-position search to depth=8 , with everything as is (new instance of the engine ,no hash, pruning,..etc.. ,just eval & AB search ) with the ordering method for root moves as the sole difference .
You MIGHT get a different move. you must NOT get a different score, if you are not reducing, pruning or hashing. Time to hunt a bug...