]> git.sesse.net Git - stockfish/commit
Sort PV moves always in two steps
authorMarco Costalba <mcostalba@gmail.com>
Tue, 2 Aug 2011 08:53:56 +0000 (09:53 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 2 Aug 2011 17:00:47 +0000 (18:00 +0100)
commitc71ae794df257e3d6f1e925b6d013434bb2f99ef
treeb8f8fd8f6d4a97a12ce727b8a8ae1df20c0ec261
parent409930e98c48f9d149c2324c911c52325f368edd
Sort PV moves always in two steps

This should fix following issue:

Suppose the search with MultiPVIteration == 0 returns an exact score

move = Nxf4, score = 100

Now search with MultiPVIteration == 1 and get two scores

move = Qg8, score = 150
move = Ra1, score = 180

If we now reorder all the moves in one step we end up with

pv[0] = Ra1, pv[1] = Qg8

Instead reordering as the current patch we end up in:

pv[0] = Ra1, pv[1] = Nxf4

preserving the first searched move.

No functional change in single PV.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp