I have read your interested thread of some time ago regarding the historical reasons why the ordering at ply one is done (when score is equal) counting the nodes searched by each move subtree during the previous iteration.
I think I have come up with a different idea that seems better in my tests but needs confirmation.
The idea is to count the beta-cut offs instead of the nodes.
The advantage is that you can differentiate between _our_ beta cutoffs and _opponent_ cutoffs. So you actually have two counters:
int64_t betaCounter[2];
That are reset to zero before searching each root move. When a beta cutoff occurs you increment the counter:
betaCounter[pos.sideToMove()]++;
When root search returns you store the two values:
ourBeta = betaCounter[us];
oppBeta = betaCounter[them];
At the beginning of the next iteration you sort root moves as usually but using betaCounter instead of nodes. So here we have different schemes both for sorting and for increment the counter:
SORTING POLICY:
- Sort on ourBeta value
- Sort on oppBeta value (seems the best!)
- Sort on sum of betas, i.e. on total beta number
INCREMENT POLICY
When a beta cutoff occurs
- Increment the counter (as seen previously)
- Add depth ( betaCounter[threadID][pos.sideToMove()] += depth; )
- Add negated depth (betaCounter[threadID][pos.sideToMove()] += 20-depth;)
- Add the ply (this gives advantage to subtrees that goes further in the search).
I really hope you find this idea interesting because I would like you give it a try on your big iron and post the results.
Thanks in advance
Marco