Zach Wegner wrote:bob wrote:
OK, let me try once more. I understood what you wrote. You are proposing to maintain a second "signature" that is path-based rather than position-based. OK. It isn't free to do this as it is done _everywhere_ in the tree, thru the entire game. It has some sort of cost.
I run thru the hash table once, after the 50-move rule counter passes the 40-move threshold. That has a cost, but it is only incurred on those very rare occasions where a 50-move draw is an issue. My approach has zero affect for 99% of the games, 99% of the moves within each of those games.
That was my point. There is a cost incurred in your approach. If you further try to use it to handle repetitions, there is a much larger cost involved, because that is not confined to positions near a 50-move draw.
As I mentioned, I don't worry about repetition issues anyway, and am not seeing any issues at all since I count all 2-fold repetitions as draws inside the search anyway. 50-move rule draws are an issue and my approach has prevented me from stumbling into 50-move draws blindly, although one could argue that Crafty might well "commit" to a path that leads to a 50-move draw, well before move 40, because the hash table entries concealed the draw score since they had not yet been cleared. I've not seen that happen in testing, although I only looked at this when I was specifically looking at bogus draw issues in a version of Crafty last year...
I would speculate that my overhead is far less than what you are proposing with the new signature overhead that is incurred everywhere.
OK, I think we are getting somewhere here. The important thing that I was trying to tell you is that you don't have to give up the transpositions in the rest of the tree, it is possible to only worry about the 50 move rule. Specifically, the cost of my approach is non-zero, but it is constant throughout the game. This is the only code you need to add:
Inside make_move:
Code: Select all
if (fifty_count < 80)
path_hashkey = hashkey;
else
path_hashkey = hashkey ^ some_constant[fifty_count - 80];
...with an equivalent restoration in unmake.
I don't believe that is enough. You are simply tying it to the 50 move counter at the time you store the position. You really need the _path_ encoded, not just the 50 move counter. Just because the position here is N moves from 50 moves doesn't say a lot about other similar positions at the same 50 move counter, because the paths _prior_ to the key position could be different and have earlier (or later) draws.
There was a dissertation published on this topic and how to fix it, but the cost is simply unbearable...
I will have to think about it a bit, but my first impression is that basing the secondary signature solely on the 50 move counter is not enough... It is certainly better than doing nothing. Whether it is better than invalidating the scores from previous searches (not previous iterations) is another question. And I suspect it still suffers from insufficient information to avoid all such draws by the 50 move rule.
[quote[]\\]
In hash_store:
Code: Select all
hash_entry->hashkey = (hashkey & low_order_bits) | (path_hashkey & high_order_bits);
In hash_probe:
Code: Select all
if ((hash_entry->hashkey & low_order_bits) == (hashkey & low_order_bits))
{
hash_move = hash_entry->move;
/* This will only fail when the fifty move count gets high: */
if ((hash_entry->hashkey & high_order_bits) == (path_hashkey & high_order_bits))
{
accept_cutoffs();
}
}
So yes, the cost is nonzero. But it is a very small linear cost, and doesn't depend on the size of the hash table. You'd maybe lose 1% in NPS, if that even. The important thing is that you can accept cutoffs more intelligently in the late endgame. For instance, if the fifty move counter at the root is 30, and you search 20 plies deep, there will be many hash entries that will be affected by the fifty move rule. You would accept these for cutoffs, as long as the counter at the root is less than 40, whereas my method would only accept them up to the tenth ply, where after it would require hash entries to match the fifty move counter in addition to the position. Additionally, once the fifty counter at the root had reached 40, you would not accept cutoffs from any entry in the hash table, even though many of them are still valid.
It probably won't make a difference, especially considering how little the 50 move draw ever comes up. But I thought you might want to try it out...
I'm not sure why the attitude has to pop up here. You proposed an idea. I don't agree with it. That is grounds to cop an attitude? It is doubtful that I will agree with everything anyone says. Does everyone then cop an attitude about it? You didn't agree with my assessment... did I cop an attitude as a result?
I don't think your proposed solution is a reasonable approach. End of story unless you find a better way to convince me, or change things so that the issues I mentioned become insignificant. But I'm not going to get snotty if you don't agree with me, you are certainly free to test anything you want, good or bad. I've tried more than my share of bad ideas I have come up with, and I suspect I will come up with more that are bad in the future.
It is possible to have discussions, and disagreements, without sarcasm and attitude however. But only if you _want_ to in the first place.
I'm sorry if I come off as rude. I don't really mean it. I know that it's a bad idea to store path information, but it sounded nice when I thought of it. The idea didn't work out though, and I planned to just not say anything about it, like many other ideas that I have had (some of them good...). But I thought it might help you. It's fine if you don't like it, but you were only arguing against an idea that I already knew was bad, not the one that I was trying to propose to you. It didn't seem like you were listening to me at all.
I've just been frustrated with computer chess in general lately. I work so hard, and try to contribute _something_, but everybody just wants to argue about meaningless implementation details. Nobody cares about new ideas anymore, they just care about ELO. More people flock to test the latest stupid Toga fork than to take the time to look at a new engine. The one testing group that has touched my engine in the month that it has been released had a horribly incorrect setup (which could have been solved by looking at the readme), which caused it to lose every game as black. They didn't even notice, and I got no reply when I told them about it. The rating is still there.
Sorry to rant to you, but the past few weeks have been making me seriously considering giving up CC for good...[/quote]
It will continue to have its ups and downs. Hopefully more ups, but only over the long term. Short-term can be ugly at times. Certainly not ugly enough to quit over however. Takes time to make progress...