Using piece-square table score for move ordering

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Using piece-square table score for move ordering

Post by maksimKorzh »

Hi all!

I've been playing around with move ordering in my chess engine and tried to apply piece-square positional score evaluation table (knight scores worked best, probably due to being centralizing mostly) to score history moves. Now bearing in mind the fact that history scores are stored as:

Code: Select all

history_moves[board[get_move_source(move)]][get_move_target(move)] += depth; // on alpha increase
I just thought that as far as we are evaluating target square to order history moves higher why not to add positional scores to it so that centralizing history moves would be scored higher than those that going to the side of the board? I understand that history scores are actually appearing due to the better static evaluation of those quiet moves that occupies the central squares of the board but still - adding positional scores to order history moves seems to be working slightly better, here're some tests:

History score move ordering

Code: Select all

info score cp 30 depth 1 nodes 41 pv d2d4 
info score cp 0 depth 2 nodes 140 pv d2d4 b8c6 
info score cp 30 depth 3 nodes 1181 pv d2d4 b8c6 e2e4 
info score cp 0 depth 4 nodes 4164 pv d2d4 b8c6 e2e4 g8f6 
info score cp 30 depth 5 nodes 34685 pv d2d4 b8c6 b1c3 g8f6 e2e4 
info score cp 0 depth 6 nodes 165881 pv d2d4 g8f6 b1c3 b8c6 e2e4 d7d5 
info score cp 20 depth 7 nodes 1294690 pv d2d4 g8f6 b1c3 b8c6 g1f3 d7d5 c1f4 
History score += knight_score[get_move_target(move)]

Code: Select all

info score cp 30 depth 1 nodes 41 pv d2d4 
info score cp 0 depth 2 nodes 146 pv d2d4 d7d5 
info score cp 30 depth 3 nodes 1162 pv d2d4 d7d5 b1c3 
info score cp 0 depth 4 nodes 4568 pv d2d4 d7d5 b1c3 g8f6 
info score cp 30 depth 5 nodes 33399 pv d2d4 d7d5 b1c3 g8f6 g1f3 
info score cp 0 depth 6 nodes 179353 pv d2d4 d7d5 b1c3 g8f6 g1f3 b8c6 
info score cp 20 depth 7 nodes 1263793 pv d2d4 d7d5 b1c3 g8f6 g1f3 b8c6 c1f4
1294690 − 1263793 = 30897 nodes saved on depth 7 which is not much but still a little better result.
I'm a bit confused with actually worse results on depths 2 and 4

So my question are:
1. Does this technique make sense?
2. Any pitfalls potentially slowing down the search?
3. Did anyone try it before?
User avatar
Kotlov
Posts: 266
Joined: Fri Jul 10, 2015 9:23 pm
Location: Russia

Re: Using piece-square table score for move ordering

Post by Kotlov »

Я в свое время пробовал по-разному, но лучшие результаты все равно были у обычной эвристики истории. Дело в том, что наибольшее значение в альфа-бета поиске имеет не сколько порядок силы ходов по убыванию, а вероятность как можно раньше найти самый сильный ход который вызовет отсечку по бете. Эвристика истории как раз и хранит статистику этих отсечек и вкупе с таблицей транспозиций угадывает лучшие ходы довольно хорошо. Поэтому нет смысла заботится о сортировке поздних ходов по двум причинам 1) все равно лучший ход угадать будет сложно 2) если отсечка не происходит ранее, то разбираться надо с улучшением эвристик связанных с досрочными отсечками, а не сортировкой (которую все равно не угадать с помощью лишь pst)
Eugene Kotlov
Hedgehog 2.1 64-bit coming soon...