Sorting captures

Discussion of chess software programming and technical issues.

Moderator: Ras

Pablo Vazquez
Posts: 154
Joined: Thu May 31, 2007 9:05 pm
Location: Madrid, Spain

Re: Sorting captures

Post by Pablo Vazquez »

I was talking about the generate captures only function.
Harald Johnsen

Re: Sorting captures

Post by Harald Johnsen »

Pablo Vazquez wrote:I did an experiment: I took fruit 2.1 source and I removed line 311 in sort.cpp (list_sort(sort->list);) for captures. This increased the nodes by 20%, but then I noticed that fruit generates pawn captures in the last place so I moved the code to generate them first and now the increase was only 1%, like in my case.

So my question is: why does fruit and crafty generate pawn captures last?
And also, has anybody tried this also in his program?

Thanks for your answers.
In line 311 the captures are all 'good' or 'equal' captures. This sort don't move 'bad' captures to the end, they are allready at the end.
Removing this line will - perhaps - make the engine try things like NxN before NxQ, that's why there is more nodes.
What is really important is to try all the good captures first and only after that to try bad captures.

Note that a pawn capturing something is normaly not a bad capture, but you can have more interesting captures.

HJ.