Bug in Frenzee

Archive of the old Parsimony forum. Some messages couldn't be restored. Limitations: Search for authors does not work, Parsimony specific formats do not work, threaded view does not work properly. Posting is disabled.

Bug in Frenzee

Postby Sune Fischer » 06 May 2002, 14:26

Geschrieben von: / Posted by: Sune Fischer at 06 May 2002 15:26:30:
I found a bug in frenzee.
It happens in about 1/20 games, and it will cause a crash.
The error is in collecting the PV.
When extending the search the depth might temporarely go below 0, and if at that position there is a PV move, then pv[depth].move=themove will cause a crash :(
Usually this happens in winning positions (argh).
I could use a good suggestion on how to fix this.
Building the PV from the hash is a possibility, are there others?
Thanks,
-S.
Sune Fischer
 

Re: Bug in Frenzee

Postby Richard Pijl » 06 May 2002, 14:36

Geschrieben von: / Posted by: Richard Pijl at 06 May 2002 15:36:31:
Als Antwort auf: / As an answer to: Bug in Frenzee geschrieben von: / posted by: Sune Fischer at 06 May 2002 15:26:30:
I found a bug in frenzee.
It happens in about 1/20 games, and it will cause a crash.
The error is in collecting the PV.
When extending the search the depth might temporarely go below 0, and if at that position there is a PV move, then pv[depth].move=themove will cause a crash :(
Usually this happens in winning positions (argh).
I could use a good suggestion on how to fix this.
Building the PV from the hash is a possibility, are there others?
Thanks,
-S.
Use separate indexes for keeping track of the depth and the number of plies played.
When starting the search, I set ply=0, and increase ply with every move played, and decrease again on each takeback. This is also useful for other searchdepth dependent stuff like killer heuristic, depth dependent pruning etc.
When generating the pv from the hashtables you will have to overcome a lot of problems. You need to be really sure your hashtable implementation is correct and that all PV moves are in there and remain in there until you need them. If done correctly it does give a small speed increase though ...
Richard.

The Baron's Lair
Richard Pijl
 

Re: Bug in Frenzee

Postby Uri Blass » 06 May 2002, 14:37

Geschrieben von: / Posted by: Uri Blass at 06 May 2002 15:37:18:
Als Antwort auf: / As an answer to: Bug in Frenzee geschrieben von: / posted by: Sune Fischer at 06 May 2002 15:26:30:
I found a bug in frenzee.
It happens in about 1/20 games, and it will cause a crash.
The error is in collecting the PV.
When extending the search the depth might temporarely go below 0, and if at that position there is a PV move, then pv[depth].move=themove will cause a crash :(
I do not understand how the depth can go below 0.
Extensions only increase the remaining depth.
Uri
Uri Blass
 

Re: Bug in Frenzee

Postby Sune Fischer » 06 May 2002, 14:43

Geschrieben von: / Posted by: Sune Fischer at 06 May 2002 15:43:05:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Richard Pijl at 06 May 2002 15:36:31:
Use separate indexes for keeping track of the depth and the number of plies played.
When starting the search, I set ply=0, and increase ply with every move played, and decrease again on each takeback. This is also useful for other searchdepth dependent stuff like killer heuristic, depth dependent pruning etc.
When generating the pv from the hashtables you will have to overcome a lot of problems. You need to be really sure your hashtable implementation is correct and that all PV moves are in there and remain in there until you need them. If done correctly it does give a small speed increase though ...
Richard.
That is good advice, I think I will do that :)
I've tried removing the PV collection scheme, but I didn't really see any speedup, but of course anything that can be done at the root is *free* ;)
Thanks,
-S.
Sune Fischer
 

Re: Bug in Frenzee

Postby Sune Fischer » 06 May 2002, 14:45

Geschrieben von: / Posted by: Sune Fischer at 06 May 2002 15:45:38:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Uri Blass at 06 May 2002 15:37:18:
I found a bug in frenzee.
It happens in about 1/20 games, and it will cause a crash.
The error is in collecting the PV.
When extending the search the depth might temporarely go below 0, and if at that position there is a PV move, then pv[depth].move=themove will cause a crash :(
I do not understand how the depth can go below 0.
Extensions only increase the remaining depth.
Uri
My counter is inversed.
Depth means distance from root, more logical that way IMO :)
-S.
Sune Fischer
 

Re: Bug in Frenzee

Postby Richard Pijl » 06 May 2002, 14:58

Geschrieben von: / Posted by: Richard Pijl at 06 May 2002 15:58:57:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Sune Fischer at 06 May 2002 15:43:05:
I've tried removing the PV collection scheme, but I didn't really see any speedup, but of course anything that can be done at the root is *free* ;)
It got me about 5% more nodes a second, but it also took me a considerable amount of time to get it right. Especially lower bounds hashentries with a move in it that were inherited from a previous search ruined things.
Are you sure that when you tried this you didn't break moveordering?
Richard.

The Baron's Lair
Richard Pijl
 

Re: Bug in Frenzee

Postby Uri Blass » 06 May 2002, 14:59

Geschrieben von: / Posted by: Uri Blass at 06 May 2002 15:59:02:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Sune Fischer at 06 May 2002 15:45:38:
I found a bug in frenzee.
It happens in about 1/20 games, and it will cause a crash.
The error is in collecting the PV.
When extending the search the depth might temporarely go below 0, and if at that position there is a PV move, then pv[depth].move=themove will cause a crash :(
I do not understand how the depth can go below 0.
Extensions only increase the remaining depth.
Uri
My counter is inversed.
Depth means distance from root, more logical that way IMO :)
-S.
I do not see why is it more logical.
I have a variable with the name ply that gives the distance from the root in plies and another variable with the name depth that gives the remaining depth to search.
tscp is using these variables in the same way.
Uri
Uri Blass
 

Re: Bug in Frenzee

Postby Sune Fischer » 06 May 2002, 15:01

Geschrieben von: / Posted by: Sune Fischer at 06 May 2002 16:01:29:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Uri Blass at 06 May 2002 15:59:02:
I found a bug in frenzee.
It happens in about 1/20 games, and it will cause a crash.
The error is in collecting the PV.
When extending the search the depth might temporarely go below 0, and if at that position there is a PV move, then pv[depth].move=themove will cause a crash :(
I do not understand how the depth can go below 0.
Extensions only increase the remaining depth.
Uri
My counter is inversed.
Depth means distance from root, more logical that way IMO :)
-S.
I do not see why is it more logical.
I have a variable with the name ply that gives the distance from the root in plies and another variable with the name depth that gives the remaining depth to search.
tscp is using these variables in the same way.
Uri
I do not see why yours is more logical than mine.
-S.
Sune Fischer
 

Re: Bug in Frenzee

Postby Sune Fischer » 06 May 2002, 15:07

Geschrieben von: / Posted by: Sune Fischer at 06 May 2002 16:07:23:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Richard Pijl at 06 May 2002 15:58:57:
I've tried removing the PV collection scheme, but I didn't really see any speedup, but of course anything that can be done at the root is *free* ;)
It got me about 5% more nodes a second, but it also took me a considerable amount of time to get it right. Especially lower bounds hashentries with a move in it that were inherited from a previous search ruined things.
Are you sure that when you tried this you didn't break moveordering?
Richard.
Probably, but I was just considering the nps count, and I could notice any difference at all. I think maybe a more well tuned search will produce more pv moves so it becomes more important. At my stage, it isn't a problem and for the moment I just like having an accurate PV for debugging reasons :)
-S.
Sune Fischer
 

Re: Bug in Frenzee

Postby Richard Pijl » 06 May 2002, 15:24

Geschrieben von: / Posted by: Richard Pijl at 06 May 2002 16:24:34:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Sune Fischer at 06 May 2002 16:07:23:
I've tried removing the PV collection scheme, but I didn't really see any speedup, but of course anything that can be done at the root is *free* ;)
It got me about 5% more nodes a second, but it also took me a considerable amount of time to get it right. Especially lower bounds hashentries with a move in it that were inherited from a previous search ruined things.
Are you sure that when you tried this you didn't break moveordering?
Richard.
Probably, but I was just considering the nps count, and I could notice any difference at all. I think maybe a more well tuned search will produce more pv moves so it becomes more important. At my stage, it isn't a problem and for the moment I just like having an accurate PV for debugging reasons :)
-S.
I still have both methods in my code, but activate only one of them with a compile-time flag. I've done the same with many other mechanisms as it is easier to debug a new mechanism if other things (pruning, nullmove etc) are turned off. And I'm still not 100% confident my pv-tracking from the hashtable is correct ...
Richard.

The Baron's Lair
Richard Pijl
 

Re: Bug in Frenzee

Postby Uri Blass » 06 May 2002, 15:24

Geschrieben von: / Posted by: Uri Blass at 06 May 2002 16:24:58:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Sune Fischer at 06 May 2002 16:01:29:
I found a bug in frenzee.
It happens in about 1/20 games, and it will cause a crash.
The error is in collecting the PV.
When extending the search the depth might temporarely go below 0, and if at that position there is a PV move, then pv[depth].move=themove will cause a crash :(
I do not understand how the depth can go below 0.
Extensions only increase the remaining depth.
Uri
My counter is inversed.
Depth means distance from root, more logical that way IMO :)
-S.
I do not see why is it more logical.
I have a variable with the name ply that gives the distance from the root in plies and another variable with the name depth that gives the remaining depth to search.
tscp is using these variables in the same way.
Uri
I do not see why yours is more logical than mine.
-S.
I did not say that my defintions are more logical but depth is always used in the meaning of distance from the root not only in tscp but also in bruce moreland pages.
Uri
Uri Blass
 

Re: Bug in Frenzee

Postby Sune Fischer » 06 May 2002, 15:31

Geschrieben von: / Posted by: Sune Fischer at 06 May 2002 16:31:55:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Uri Blass at 06 May 2002 16:24:58:
I found a bug in frenzee.
It happens in about 1/20 games, and it will cause a crash.
The error is in collecting the PV.
When extending the search the depth might temporarely go below 0, and if at that position there is a PV move, then pv[depth].move=themove will cause a crash :(
I do not understand how the depth can go below 0.
Extensions only increase the remaining depth.
Uri
My counter is inversed.
Depth means distance from root, more logical that way IMO :)
-S.
I do not see why is it more logical.
I have a variable with the name ply that gives the distance from the root in plies and another variable with the name depth that gives the remaining depth to search.
tscp is using these variables in the same way.
Uri
I do not see why yours is more logical than mine.
-S.
I did not say that my defintions are more logical but depth is always used in the meaning of distance from the root not only in tscp but also in bruce moreland pages.
Uri
That is how I use depth too, I believe you mean distance to end search?
But I don't see any reason to arguing over who's conventions is more logical, use whatever you find more natural, and I'll use what I find more natural, it's just a convention!
-S.
Sune Fischer
 

Re: Bug in Frenzee

Postby Richard Pijl » 06 May 2002, 15:33

Geschrieben von: / Posted by: Richard Pijl at 06 May 2002 16:33:58:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Uri Blass at 06 May 2002 16:24:58:
I found a bug in frenzee.
It happens in about 1/20 games, and it will cause a crash.
The error is in collecting the PV.
When extending the search the depth might temporarely go below 0, and if at that position there is a PV move, then pv[depth].move=themove will cause a crash :(
I do not understand how the depth can go below 0.
Extensions only increase the remaining depth.
Uri
My counter is inversed.
Depth means distance from root, more logical that way IMO :)
-S.
I do not see why is it more logical.
I have a variable with the name ply that gives the distance from the root in plies and another variable with the name depth that gives the remaining depth to search.
tscp is using these variables in the same way.
Uri
I do not see why yours is more logical than mine.
-S.
I did not say that my defintions are more logical but depth is always used in the meaning of distance from the root not only in tscp but also in bruce moreland pages.
Uri
You probably meant to say 'depth is always used in the meaning of remaining depth to search' ;-)
What Sune does here is probably keeping depth and extensions separate. That may be useful. I guess he calculates remaining searchdepth from depth+extensions in each node. TSCP's method doesn't give information about extensions given in previous plies (unless you keep it in a separate parameter).
I can imagine that keeping the extended plies in a separate counter can have its use in determining the amount the search is extended the next time ...
Well, this whole discussion smells like little-endian vs. big-endian to me ;-)
Richard.

The Baron's Lair
Richard Pijl
 

Re: Bug in Frenzee

Postby Peter Fendrich » 06 May 2002, 15:39

Geschrieben von: / Posted by: Peter Fendrich at 06 May 2002 16:39:46:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Uri Blass at 06 May 2002 16:24:58:
I found a bug in frenzee.
It happens in about 1/20 games, and it will cause a crash.
The error is in collecting the PV.
When extending the search the depth might temporarely go below 0, and if at that position there is a PV move, then pv[depth].move=themove will cause a crash :(
I do not understand how the depth can go below 0.
Extensions only increase the remaining depth.
Uri
My counter is inversed.
Depth means distance from root, more logical that way IMO :)
-S.
I do not see why is it more logical.
I have a variable with the name ply that gives the distance from the root in plies and another variable with the name depth that gives the remaining depth to search.
tscp is using these variables in the same way.
Uri
I do not see why yours is more logical than mine.
-S.
I did not say that my defintions are more logical but depth is always used in the meaning of distance from the root not only in tscp but also in bruce moreland pages.
Uri
I'm using 2 variables: depth and ply, where depth is the remaining depth and ply is just the ply counted from the root. Extensions are added to the depth but means no changes in the ply variable. I think you will need both when the program gets more compicated.
For example, in Terra each ply++ correspondes to deph += 64. When adding extensions I can add fractions of one ply to the depth variable.
Peter

Terra pages
Peter Fendrich
 

Re: Bug in Frenzee

Postby Sune Fischer » 06 May 2002, 15:40

Geschrieben von: / Posted by: Sune Fischer at 06 May 2002 16:40:49:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Richard Pijl at 06 May 2002 16:24:34:
I've tried removing the PV collection scheme, but I didn't really see any speedup, but of course anything that can be done at the root is *free* ;)
It got me about 5% more nodes a second, but it also took me a considerable amount of time to get it right. Especially lower bounds hashentries with a move in it that were inherited from a previous search ruined things.
Are you sure that when you tried this you didn't break moveordering?
Richard.
Probably, but I was just considering the nps count, and I could notice any difference at all. I think maybe a more well tuned search will produce more pv moves so it becomes more important. At my stage, it isn't a problem and for the moment I just like having an accurate PV for debugging reasons :)
-S.
I still have both methods in my code, but activate only one of them with a compile-time flag. I've done the same with many other mechanisms as it is easier to debug a new mechanism if other things (pruning, nullmove etc) are turned off. And I'm still not 100% confident my pv-tracking from the hashtable is correct ...
Richard.
I haven't tried it, but is it that hard?
You follow the hashmove from entry to entry, make the move and find the next entry until your probe fails?
If its a fail-low node there is no hashmove, and a fail-high node you can tell by the flag?
-S.
Sune Fischer
 

Re: Bug in Frenzee

Postby Uri Blass » 06 May 2002, 15:42

Geschrieben von: / Posted by: Uri Blass at 06 May 2002 16:42:37:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Richard Pijl at 06 May 2002 16:33:58:
I found a bug in frenzee.
It happens in about 1/20 games, and it will cause a crash.
The error is in collecting the PV.
When extending the search the depth might temporarely go below 0, and if at that position there is a PV move, then pv[depth].move=themove will cause a crash :(
I do not understand how the depth can go below 0.
Extensions only increase the remaining depth.
Uri
My counter is inversed.
Depth means distance from root, more logical that way IMO :)
-S.
I do not see why is it more logical.
I have a variable with the name ply that gives the distance from the root in plies and another variable with the name depth that gives the remaining depth to search.
tscp is using these variables in the same way.
Uri
I do not see why yours is more logical than mine.
-S.
I did not say that my defintions are more logical but depth is always used in the meaning of distance from the root not only in tscp but also in bruce moreland pages.
Uri
You probably meant to say 'depth is always used in the meaning of remaining depth to search' ;-)
What Sune does here is probably keeping depth and extensions separate. That may be useful. I guess he calculates remaining searchdepth from depth+extensions in each node. TSCP's method doesn't give information about extensions given in previous plies (unless you keep it in a separate parameter).
I can imagine that keeping the extended plies in a separate counter can have its use in determining the amount the search is extended the next time ...
Yes
Yes
I have an array that tells me the number of extensions in every ply.

Yes
I use that information in my search rules.
Uri
Uri Blass
 

Re: Bug in Frenzee

Postby Uri Blass » 06 May 2002, 15:47

Geschrieben von: / Posted by: Uri Blass at 06 May 2002 16:47:10:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Peter Fendrich at 06 May 2002 16:39:46:
I found a bug in frenzee.
It happens in about 1/20 games, and it will cause a crash.
The error is in collecting the PV.
When extending the search the depth might temporarely go below 0, and if at that position there is a PV move, then pv[depth].move=themove will cause a crash :(
I do not understand how the depth can go below 0.
Extensions only increase the remaining depth.
Uri
My counter is inversed.
Depth means distance from root, more logical that way IMO :)
-S.
I do not see why is it more logical.
I have a variable with the name ply that gives the distance from the root in plies and another variable with the name depth that gives the remaining depth to search.
tscp is using these variables in the same way.
Uri
I do not see why yours is more logical than mine.
-S.
I did not say that my defintions are more logical but depth is always used in the meaning of distance from the root not only in tscp but also in bruce moreland pages.
Uri
I'm using 2 variables: depth and ply, where depth is the remaining depth and ply is just the ply counted from the root. Extensions are added to the depth but means no changes in the ply variable. I think you will need both when the program gets more compicated.
For example, in Terra each ply++ correspondes to deph += 64. When adding extensions I can add fractions of one ply to the depth variable.
Peter
I use both and need both.

I can also add fraction of one ply to the depth varaible but I do it in a different method.
depth always mean the remaining depth to search when there is another integer that tells me the fraction of one ply to the depth varaible.
Uri
Uri Blass
 

Re: Bug in Frenzee

Postby Sune Fischer » 06 May 2002, 15:49

Geschrieben von: / Posted by: Sune Fischer at 06 May 2002 16:49:39:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Richard Pijl at 06 May 2002 16:33:58:
What Sune does here is probably keeping depth and extensions separate. That may be useful. I guess he calculates remaining searchdepth from depth+extensions in each node. TSCP's method doesn't give information about extensions given in previous plies (unless you keep it in a separate parameter).
I can imagine that keeping the extended plies in a separate counter can have its use in determining the amount the search is extended the next time ...
Well, this whole discussion smells like little-endian vs. big-endian to me ;-)
Richard.
Actually I just used one depth counter, a local variable describing the depth from root, it can go negative as I fiddle with the extensions simply by subtracting from it. It does explains a lot of the weird PVs I've seen lately.
I also have a ply counter but that is global and used to check for repetitions. I could extract the needed information from those two, but it may be simpler to add a third counter, I'm not sure, will have to think about that :)
-S.
Sune Fischer
 

Re: Bug in Frenzee

Postby Richard Pijl » 06 May 2002, 15:59

Geschrieben von: / Posted by: Richard Pijl at 06 May 2002 16:59:09:
Als Antwort auf: / As an answer to: Re: Bug in Frenzee geschrieben von: / posted by: Sune Fischer at 06 May 2002 16:40:49:
I've tried removing the PV collection scheme, but I didn't really see any speedup, but of course anything that can be done at the root is *free* ;)
It got me about 5% more nodes a second, but it also took me a considerable amount of time to get it right. Especially lower bounds hashentries with a move in it that were inherited from a previous search ruined things.
Are you sure that when you tried this you didn't break moveordering?
Richard.
Probably, but I was just considering the nps count, and I could notice any difference at all. I think maybe a more well tuned search will produce more pv moves so it becomes more important. At my stage, it isn't a problem and for the moment I just like having an accurate PV for debugging reasons :)
-S.
I still have both methods in my code, but activate only one of them with a compile-time flag. I've done the same with many other mechanisms as it is easier to debug a new mechanism if other things (pruning, nullmove etc) are turned off. And I'm still not 100% confident my pv-tracking from the hashtable is correct ...
Richard.
I haven't tried it, but is it that hard?
You follow the hashmove from entry to entry, make the move and find the next entry until your probe fails?
If its a fail-low node there is no hashmove, and a fail-high node you can tell by the flag?
-S.
Well, sometimes an entry is not inserted in the hashtable because the existing entry is more valuable (higher searchdepth, more nodes), for instance from a previous search, or closer to the rootnode. If a move will be part of a PV you need to force insertion, but you cannot prevent that it is overwritten later by a non-pv node that is considered more valuable at that time. When having a separate pv-table you can rely on the pv to be present, with generating the PV from the hashtable you cannot.
Richard.

The Baron's Lair
Richard Pijl
 

Re: Bug in Frenzee

Postby Miguel A. Ballicora » 06 May 2002, 19:21

Geschrieben von: / Posted by: Miguel A. Ballicora at 06 May 2002 20:21:09:
Als Antwort auf: / As an answer to: Bug in Frenzee geschrieben von: / posted by: Sune Fischer at 06 May 2002 15:26:30:
I found a bug in frenzee.
It happens in about 1/20 games, and it will cause a crash.
The error is in collecting the PV.
When extending the search the depth might temporarely go below 0, and if at that position there is a PV move, then pv[depth].move=themove will cause a crash :(
Usually this happens in winning positions (argh).
I could use a good suggestion on how to fix this.
Building the PV from the hash is a possibility, are there others?
Thanks,
-S.

Look at this post by Dieter:
http://f11.parsimony.net/forum16635/messages/18949.htm
In the same thread, I explained how I do it with some code:
http://f11.parsimony.net/forum16635/messages/19021.htm
I hope this help. You can also read the thread, at least I learned
a couple of things when we were discussing this issue with Dieter.
Bruce Moreland has a very nice explanation on his site.
Regards,
Miguel
Miguel A. Ballicora
 

Next

Return to Archive (Old Parsimony Forum)

Who is online

Users browsing this forum: No registered users and 14 guests