hgm wrote:Well, all your facility proves is that you have not been able to find a good way to sort the moves. Not that such a way does not exist...
What is the ratio of cutoffs by a late move compared and the number of ALL nodes? How many moves do you have to search before you typically hit such a cut move now, and how many moves do you on average search in an ALL node? That should tell you how much there is to gain by sorting.
Simple. I added a trivial bit of code so that Crafty would answer the following three questions cumulatively thru the first few moves of a normal game from a normal starting position from my cluster test set (starts 12 moves into the game, and accumulates the totals for 5 moves and then prints them and exits.)
1. What percent of all fail high conditions happen on the _first_ move (I am excluding the q-search here as that distorts the number upward significantly. So here I only include "full-width nodes" in any of these totals, which are the nodes where move ordering decisions like history and such might be useful). Answer: 92% average.
2. What percent of all fail high conditions happen while I am searching the well-ordered part of the moves (hash first, then non-bad SEE captures, then 2 killers). Whatever this is means that the remaining fail highs occur in the rest of the moves where I do ordering only based on moving advanced pieces first, and moving them to more advanced squares first, as that is how they are generated). Answer: 95%. So To re-order the remaining moves, there is the potential for picking up some fraction of that 5%, although obviously nowhere near all of it
3. What is the total cutoffs by first move searched, second move searched, ..., last move searched? This is a big table that looks like this:
Code: Select all
0- 15: 32594507 1560828 422503 172914 106243 78280 65414 57394 50396 43542 36508 32766 30324 27882 25807 23766
16- 31: 21823 18893 17161 15276 13886 13125 12314 11403 10653 9509 8861 8258 7163 6366 5639 4949
32- 47: 4362 3738 3176 2563 2110 1585 1223 934 700 525 341 230 178 114 68 42
48- 63: 24 25 16 7 7 1 2 2 1 1 0 0
Note that the above numbers come from a non-tactical test. Just a normal position, with normal moves to be made, no wild capture solution or anything.
One other interesting note. On the first search, I noticed that 92% of the fail highs were on the first move searched. But when I measured question #2, I discovered that only 74% of those fail highs were from hash, capture and killer moves. The remaining 18% of the fail high on first move cases were simply caused by the first move generated. This is a typical result of a null-move search, where you are material ahead in some strange path, and any move is good enough to fail high and get you out of there.
You say "my facility proves I have not been able to find a good way to sort the moves." I would claim that it has proven that most "sorting approaches" are simply no good, and if they incur any significant cost, even the simplistic idea of delta-piece-square-table values has a cost since you have to either do this once for every move, or use a selection sort which does it for every move tried by passing over the move list N times if it contains N moves, assuming you do not get a cutoff along the way.
As always, size doesn't necessarily count. Here it is all about time, not size.
Feel free to compare your results to mine. These searches were about 300M nodes each, for reference. If I count q-search fail highs, the percentage goes to 99%+, which is not very meaningful, although q-search is the biggest contributor of nodes obviously.
edit:
just realized I did not explain that table above. the first line, labelled 0-15, represents the first 16 moves searched. If the cutoff occurred on the first move (move zero in my way of counting) then the first value gets incremented. If the fail high occurs on the second move, the next value gets incremented. Add 'em all up and you get the total number of fail highs in the non-qsearch part of the tree. Each individual number tells how many times the Nth move was the move that caused this fail high.