]> git.sesse.net Git - stockfish/commitdiff
Partial insertion sort
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Thu, 20 Apr 2017 18:15:48 +0000 (11:15 -0700)
committerJoona Kiiski <joona@zoox.com>
Thu, 20 Apr 2017 18:19:01 +0000 (11:19 -0700)
the order of elements returned by std::partition is implementation defined (since not stable) and could depend on the version of libstdc++ linked.
As std::stable_partition was tested to be too slow (http://tests.stockfishchess.org/tests/view/585cdfd00ebc5903140c6082).
Instead combine partition with our custom implementation of insert_sort, which fixes this issue.
Implementation based on a patch by mstembera (http://tests.stockfishchess.org/tests/view/58d4d3460ebc59035df3315c), which suggests some benefit by itself.
Higher depth moves are all sorted (INT_MIN version), as in current master.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 33116 W: 6161 L: 6061 D: 20894

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 88703 W: 11572 L: 11540 D: 65591

Bench: 6256522

Closes #1058
Closes #1065


No differences found