Page 1 of 11

setjmp() - another one

Posted: Wed Aug 27, 2008 10:56 am
by chrisw
Bob argued that the existence in the Rybka code of setjmp() was "interesting" because this also existed in Fruit and nowhere else.

Uri pointed out that Tom Kerrigan's public program TSCP also used setjmp() and that some other programs were likely/possibly developed, legally, off TSCP as basis.

I'm an engine programmer and always had user interface programmers working in support, so I got very lazy and understand very little about DOS, windows, C support functions and so on. setjmp() knowledge is no way a speciality of mine.

However, casting my mind back many years, I'm fairly sure that the Ren Wu Chess program which was also worked on by Ren at Oxford Softworks used setjmp() to unwind the search on a timeout. CSTal, by contrast, did a proper search unwind.

There are two ways to exit Search() on a timeout or user intervention. The 'correct' way, I suppose, is to unwind the Search back to the start using unmove simultaneously unstacking the variables.
The brutal and simple way is simply to jump straight out, reseting the stack pointer. I guess this is setjmp().

I'l be very surprised if numbers of programs, especially those designed years ago without SMP in mind, didn't use the brutal setjmp() technique to break the search.

Bottom line: setjmp() is not unique and its use doesn't imply anything, certainly it cannot imply copied code.

Re: setjmp() - another one

Posted: Wed Aug 27, 2008 11:08 am
by tiger
chrisw wrote:Bob argued that the existence in the Rybka code of setjmp() was "interesting" because this also existed in Fruit and nowhere else.

Uri pointed out that Tom Kerrigan's public program TSCP also used setjmp() and that some other programs were likely/possibly developed, legally, off TSCP as basis.

I'm an engine programmer and always had user interface programmers working in support, so I got very lazy and understand very little about DOS, windows, C support functions and so on. setjmp() knowledge is no way a speciality of mine.

However, casting my mind back many years, I'm fairly sure that the Ren Wu Chess program which was also worked on by Ren at Oxford Softworks used setjmp() to unwind the search on a timeout. CSTal, by contrast, did a proper search unwind.

There are two ways to exit Search() on a timeout or user intervention. The 'correct' way, I suppose, is to unwind the Search back to the start using unmove simultaneously unstacking the variables.
The brutal and simple way is simply to jump straight out, reseting the stack pointer. I guess this is setjmp().

I'l be very surprised if numbers of programs, especially those designed years ago without SMP in mind, didn't use the brutal setjmp() technique to break the search.

Bottom line: setjmp() is not unique and its use doesn't imply anything, certainly it cannot imply copied code.


It can if it is used in the context of a routine that has not only setjmp but also a number of other identical/equivalent code.

Here we have an example of source code comparison (thanks to Norman) in which you could say that the use of strtok is not unique to Fruit 2.1 or Rybka 1.0. However the way they are used shows troubling similarities:

http://pagesperso-orange.fr/ct_chess/Fr ... rt_go.html



// Christophe

Re: setjmp() - another one

Posted: Wed Aug 27, 2008 11:12 am
by Gerd Isenberg
chrisw wrote:Bob argued that the existence in the Rybka code of setjmp() was "interesting" because this also existed in Fruit and nowhere else.

Uri pointed out that Tom Kerrigan's public program TSCP also used setjmp() and that some other programs were likely/possibly developed, legally, off TSCP as basis.

I'm an engine programmer and always had user interface programmers working in support, so I got very lazy and understand very little about DOS, windows, C support functions and so on. setjmp() knowledge is no way a speciality of mine.

However, casting my mind back many years, I'm fairly sure that the Ren Wu Chess program which was also worked on by Ren at Oxford Softworks used setjmp() to unwind the search on a timeout. CSTal, by contrast, did a proper search unwind.

There are two ways to exit Search() on a timeout or user intervention. The 'correct' way, I suppose, is to unwind the Search back to the start using unmove simultaneously unstacking the variables.
The brutal and simple way is simply to jump straight out, reseting the stack pointer. I guess this is setjmp().

I'l be very surprised if numbers of programs, especially those designed years ago without SMP in mind, didn't use the brutal setjmp() technique to break the search.

Bottom line: setjmp() is not unique and its use doesn't imply anything, certainly it cannot imply copied code.
More common in C++ (Ansi C?) is to unwind the stack by try..catch..throw, as demonstrated here.
I agree that using setjmp alone proves nothing.

Re: setjmp() - another one

Posted: Wed Aug 27, 2008 11:20 am
by Guetti
chrisw wrote:Bob argued that the existence in the Rybka code of setjmp() was "interesting" because this also existed in Fruit and nowhere else.

Uri pointed out that Tom Kerrigan's public program TSCP also used setjmp() and that some other programs were likely/possibly developed, legally, off TSCP as basis.

I'm an engine programmer and always had user interface programmers working in support, so I got very lazy and understand very little about DOS, windows, C support functions and so on. setjmp() knowledge is no way a speciality of mine.

However, casting my mind back many years, I'm fairly sure that the Ren Wu Chess program which was also worked on by Ren at Oxford Softworks used setjmp() to unwind the search on a timeout. CSTal, by contrast, did a proper search unwind.

There are two ways to exit Search() on a timeout or user intervention. The 'correct' way, I suppose, is to unwind the Search back to the start using unmove simultaneously unstacking the variables.
The brutal and simple way is simply to jump straight out, reseting the stack pointer. I guess this is setjmp().

I'l be very surprised if numbers of programs, especially those designed years ago without SMP in mind, didn't use the brutal setjmp() technique to break the search.

Bottom line: setjmp() is not unique and its use doesn't imply anything, certainly it cannot imply copied code.
Leaving the setjmp() relevant or not argument aside for a moment, come on, you state that you believe that an engine used setjmp()? Isn't that a bit vague? You demand always hard facts and source and pretty aligned code from Zach and Christoph, so were are the facts of Ren Wu chess?
Would you believe Zach if he would write he believes that the eval of Rybka is identical to Fruit without further comment?
You always want to see facts, so please before you do a conclusion, gives us some facts.

When I look at the (far from complete) list of chess engines released in recent years at http://wbec-ridderkerk.nl/html/enginesindex.htm, I wonder how many of these engines use setjmp()? 10 of 200? More?
I think it is still a good indication, not a prove.

Re: setjmp() - another one

Posted: Wed Aug 27, 2008 11:38 am
by chrisw
Guetti wrote:
chrisw wrote:Bob argued that the existence in the Rybka code of setjmp() was "interesting" because this also existed in Fruit and nowhere else.

Uri pointed out that Tom Kerrigan's public program TSCP also used setjmp() and that some other programs were likely/possibly developed, legally, off TSCP as basis.

I'm an engine programmer and always had user interface programmers working in support, so I got very lazy and understand very little about DOS, windows, C support functions and so on. setjmp() knowledge is no way a speciality of mine.

However, casting my mind back many years, I'm fairly sure that the Ren Wu Chess program which was also worked on by Ren at Oxford Softworks used setjmp() to unwind the search on a timeout. CSTal, by contrast, did a proper search unwind.

There are two ways to exit Search() on a timeout or user intervention. The 'correct' way, I suppose, is to unwind the Search back to the start using unmove simultaneously unstacking the variables.
The brutal and simple way is simply to jump straight out, reseting the stack pointer. I guess this is setjmp().

I'l be very surprised if numbers of programs, especially those designed years ago without SMP in mind, didn't use the brutal setjmp() technique to break the search.

Bottom line: setjmp() is not unique and its use doesn't imply anything, certainly it cannot imply copied code.
Leaving the setjmp() relevant or not argument aside for a moment, come on, you state that you believe that an engine used setjmp()? Isn't that a bit vague? You demand always hard facts and source and pretty aligned code from Zach and Christoph, so were are the facts of Ren Wu chess?
Would you believe Zach if he would write he believes that the eval of Rybka is identical to Fruit without further comment?
You always want to see facts, so please before you do a conclusion, gives us some facts.

When I look at the (far from complete) list of chess engines released in recent years at http://wbec-ridderkerk.nl/html/enginesindex.htm, I wonder how many of these engines use setjmp()? 10 of 200? More?
I think it is still a good indication, not a prove.
Be fair. I sold my company in 2000 and handed over all code. I probably last looked at that engine in some bug hunt capacity maybe ten years ago. All I'm reporting is my memory that it used a jumpout technique to break the search because I can remember being a bit shocked at the time at the brutality of it.

If you want to suggest my perfectly honest attempt at adding useful information to get to a final result is "making it up through bias", then kindly don't bother to expect any more response from me to you.

Re: setjmp() - another one

Posted: Wed Aug 27, 2008 11:44 am
by Uri Blass
Guetti wrote:
chrisw wrote:Bob argued that the existence in the Rybka code of setjmp() was "interesting" because this also existed in Fruit and nowhere else.

Uri pointed out that Tom Kerrigan's public program TSCP also used setjmp() and that some other programs were likely/possibly developed, legally, off TSCP as basis.

I'm an engine programmer and always had user interface programmers working in support, so I got very lazy and understand very little about DOS, windows, C support functions and so on. setjmp() knowledge is no way a speciality of mine.

However, casting my mind back many years, I'm fairly sure that the Ren Wu Chess program which was also worked on by Ren at Oxford Softworks used setjmp() to unwind the search on a timeout. CSTal, by contrast, did a proper search unwind.

There are two ways to exit Search() on a timeout or user intervention. The 'correct' way, I suppose, is to unwind the Search back to the start using unmove simultaneously unstacking the variables.
The brutal and simple way is simply to jump straight out, reseting the stack pointer. I guess this is setjmp().

I'l be very surprised if numbers of programs, especially those designed years ago without SMP in mind, didn't use the brutal setjmp() technique to break the search.

Bottom line: setjmp() is not unique and its use doesn't imply anything, certainly it cannot imply copied code.
Leaving the setjmp() relevant or not argument aside for a moment, come on, you state that you believe that an engine used setjmp()? Isn't that a bit vague? You demand always hard facts and source and pretty aligned code from Zach and Christoph, so were are the facts of Ren Wu chess?
Would you believe Zach if he would write he believes that the eval of Rybka is identical to Fruit without further comment?
You always want to see facts, so please before you do a conclusion, gives us some facts.

When I look at the (far from complete) list of chess engines released in recent years at http://wbec-ridderkerk.nl/html/enginesindex.htm, I wonder how many of these engines use setjmp()? 10 of 200? More?
I think it is still a good indication, not a prove.
I do not know but movei used setjmp() at the beginning like tscp
and I simply learned from the code of tscp.

I got rid of setjmp later because I read people said it is not good
so it is not clear how many engines use setjmp.
old movei use it
new movei does not use it and you can download both old movei and new movei from wbec site.

Uri

Re: setjmp() - another one

Posted: Wed Aug 27, 2008 11:45 am
by chrisw
tiger wrote:
chrisw wrote:Bob argued that the existence in the Rybka code of setjmp() was "interesting" because this also existed in Fruit and nowhere else.

Uri pointed out that Tom Kerrigan's public program TSCP also used setjmp() and that some other programs were likely/possibly developed, legally, off TSCP as basis.

I'm an engine programmer and always had user interface programmers working in support, so I got very lazy and understand very little about DOS, windows, C support functions and so on. setjmp() knowledge is no way a speciality of mine.

However, casting my mind back many years, I'm fairly sure that the Ren Wu Chess program which was also worked on by Ren at Oxford Softworks used setjmp() to unwind the search on a timeout. CSTal, by contrast, did a proper search unwind.

There are two ways to exit Search() on a timeout or user intervention. The 'correct' way, I suppose, is to unwind the Search back to the start using unmove simultaneously unstacking the variables.
The brutal and simple way is simply to jump straight out, reseting the stack pointer. I guess this is setjmp().

I'l be very surprised if numbers of programs, especially those designed years ago without SMP in mind, didn't use the brutal setjmp() technique to break the search.

Bottom line: setjmp() is not unique and its use doesn't imply anything, certainly it cannot imply copied code.


It can if it is used in the context of a routine that has not only setjmp but also a number of other identical/equivalent code.

Here we have an example of source code comparison (thanks to Norman) in which you could say that the use of strtok is not unique to Fruit 2.1 or Rybka 1.0. However the way they are used shows troubling similarities:

http://pagesperso-orange.fr/ct_chess/Fr ... rt_go.html

// Christophe
You're probably not going to like this Christophe, but I take no interest at all in the UCI parsing side of the programs.

a) I don't understand that stuff, always having used support programmers to do that kind of work. strtok() - what does that do? I have no idea, it's not engine code.

b) for me, Rybka is only going to be a Fruit derivative if there is engine code correspondence. What they each do and how they do it with parameters passed from the interface is of no concern at all.

Anyway, I asked Zach if he'll produce your best case of engine code correspondence for both sides to consider ......


setjmp() to break search .....
Fruit, Rybka, an old OS chess program, early Movei, TSCP, hardly a scientific but unlikely to be an exhaustive list.

Re: setjmp() - another one

Posted: Wed Aug 27, 2008 12:04 pm
by tiger
chrisw wrote:
tiger wrote:
chrisw wrote:Bob argued that the existence in the Rybka code of setjmp() was "interesting" because this also existed in Fruit and nowhere else.

Uri pointed out that Tom Kerrigan's public program TSCP also used setjmp() and that some other programs were likely/possibly developed, legally, off TSCP as basis.

I'm an engine programmer and always had user interface programmers working in support, so I got very lazy and understand very little about DOS, windows, C support functions and so on. setjmp() knowledge is no way a speciality of mine.

However, casting my mind back many years, I'm fairly sure that the Ren Wu Chess program which was also worked on by Ren at Oxford Softworks used setjmp() to unwind the search on a timeout. CSTal, by contrast, did a proper search unwind.

There are two ways to exit Search() on a timeout or user intervention. The 'correct' way, I suppose, is to unwind the Search back to the start using unmove simultaneously unstacking the variables.
The brutal and simple way is simply to jump straight out, reseting the stack pointer. I guess this is setjmp().

I'l be very surprised if numbers of programs, especially those designed years ago without SMP in mind, didn't use the brutal setjmp() technique to break the search.

Bottom line: setjmp() is not unique and its use doesn't imply anything, certainly it cannot imply copied code.


It can if it is used in the context of a routine that has not only setjmp but also a number of other identical/equivalent code.

Here we have an example of source code comparison (thanks to Norman) in which you could say that the use of strtok is not unique to Fruit 2.1 or Rybka 1.0. However the way they are used shows troubling similarities:

http://pagesperso-orange.fr/ct_chess/Fr ... rt_go.html

// Christophe
You're probably not going to like this Christophe, but I take no interest at all in the UCI parsing side of the programs.

a) I don't understand that stuff, always having used support programmers to do that kind of work. strtok() - what does that do? I have no idea, it's not engine code.

b) for me, Rybka is only going to be a Fruit derivative if there is engine code correspondence. What they each do and how they do it with parameters passed from the interface is of no concern at all.

Anyway, I asked Zach if he'll produce your best case of engine code correspondence for both sides to consider ......


setjmp() to break search .....
Fruit, Rybka, an old OS chess program, early Movei, TSCP, hardly a scientific but unlikely to be an exhaustive list.


I'm sorry to hear that you can't understand parts of the C code that has been shown. It's going to be hard for you to follow what will come next, but maybe you can take advice from someone who has some expertise.

I'm interested in GPL infringement and I can already see some in the code that has been posted.

Remember: the GPL does not say that it's fair game to copy some parts and not others. The GPL says that you are not welcome to use any part of this code for a non-GPL program.



// Christophe

Re: setjmp() - another one

Posted: Wed Aug 27, 2008 12:07 pm
by Tony
Uri Blass wrote:
Guetti wrote:
chrisw wrote:Bob argued that the existence in the Rybka code of setjmp() was "interesting" because this also existed in Fruit and nowhere else.

Uri pointed out that Tom Kerrigan's public program TSCP also used setjmp() and that some other programs were likely/possibly developed, legally, off TSCP as basis.

I'm an engine programmer and always had user interface programmers working in support, so I got very lazy and understand very little about DOS, windows, C support functions and so on. setjmp() knowledge is no way a speciality of mine.

However, casting my mind back many years, I'm fairly sure that the Ren Wu Chess program which was also worked on by Ren at Oxford Softworks used setjmp() to unwind the search on a timeout. CSTal, by contrast, did a proper search unwind.

There are two ways to exit Search() on a timeout or user intervention. The 'correct' way, I suppose, is to unwind the Search back to the start using unmove simultaneously unstacking the variables.
The brutal and simple way is simply to jump straight out, reseting the stack pointer. I guess this is setjmp().

I'l be very surprised if numbers of programs, especially those designed years ago without SMP in mind, didn't use the brutal setjmp() technique to break the search.

Bottom line: setjmp() is not unique and its use doesn't imply anything, certainly it cannot imply copied code.
Leaving the setjmp() relevant or not argument aside for a moment, come on, you state that you believe that an engine used setjmp()? Isn't that a bit vague? You demand always hard facts and source and pretty aligned code from Zach and Christoph, so were are the facts of Ren Wu chess?
Would you believe Zach if he would write he believes that the eval of Rybka is identical to Fruit without further comment?
You always want to see facts, so please before you do a conclusion, gives us some facts.

When I look at the (far from complete) list of chess engines released in recent years at http://wbec-ridderkerk.nl/html/enginesindex.htm, I wonder how many of these engines use setjmp()? 10 of 200? More?
I think it is still a good indication, not a prove.
I do not know but movei used setjmp() at the beginning like tscp
and I simply learned from the code of tscp.

I got rid of setjmp later because I read people said it is not good
so it is not clear how many engines use setjmp.
old movei use it
new movei does not use it and you can download both old movei and new movei from wbec site.

Uri
Let me get this clear.

You did not look up what setjmp() does. You saw it in TSCP, looked how it was used, and then used it the same way in Movei.

Now Uri, tell me.

Do you call that copying of ideas of copying code ?

Tony

Re: setjmp() - another one

Posted: Wed Aug 27, 2008 12:33 pm
by chrisw
tiger wrote:
chrisw wrote:
tiger wrote:
chrisw wrote:Bob argued that the existence in the Rybka code of setjmp() was "interesting" because this also existed in Fruit and nowhere else.

Uri pointed out that Tom Kerrigan's public program TSCP also used setjmp() and that some other programs were likely/possibly developed, legally, off TSCP as basis.

I'm an engine programmer and always had user interface programmers working in support, so I got very lazy and understand very little about DOS, windows, C support functions and so on. setjmp() knowledge is no way a speciality of mine.

However, casting my mind back many years, I'm fairly sure that the Ren Wu Chess program which was also worked on by Ren at Oxford Softworks used setjmp() to unwind the search on a timeout. CSTal, by contrast, did a proper search unwind.

There are two ways to exit Search() on a timeout or user intervention. The 'correct' way, I suppose, is to unwind the Search back to the start using unmove simultaneously unstacking the variables.
The brutal and simple way is simply to jump straight out, reseting the stack pointer. I guess this is setjmp().

I'l be very surprised if numbers of programs, especially those designed years ago without SMP in mind, didn't use the brutal setjmp() technique to break the search.

Bottom line: setjmp() is not unique and its use doesn't imply anything, certainly it cannot imply copied code.


It can if it is used in the context of a routine that has not only setjmp but also a number of other identical/equivalent code.

Here we have an example of source code comparison (thanks to Norman) in which you could say that the use of strtok is not unique to Fruit 2.1 or Rybka 1.0. However the way they are used shows troubling similarities:

http://pagesperso-orange.fr/ct_chess/Fr ... rt_go.html

// Christophe
You're probably not going to like this Christophe, but I take no interest at all in the UCI parsing side of the programs.

a) I don't understand that stuff, always having used support programmers to do that kind of work. strtok() - what does that do? I have no idea, it's not engine code.

b) for me, Rybka is only going to be a Fruit derivative if there is engine code correspondence. What they each do and how they do it with parameters passed from the interface is of no concern at all.

Anyway, I asked Zach if he'll produce your best case of engine code correspondence for both sides to consider ......


setjmp() to break search .....
Fruit, Rybka, an old OS chess program, early Movei, TSCP, hardly a scientific but unlikely to be an exhaustive list.


I'm sorry to hear that you can't understand parts of the C code that has been shown. It's going to be hard for you to follow what will come next, but maybe you can take advice from someone who has some expertise.

I'm interested in GPL infringement and I can already see some in the code that has been posted.

Remember: the GPL does not say that it's fair game to copy some parts and not others. The GPL says that you are not welcome to use any part of this code for a non-GPL program.

// Christophe
I'm interested in the comment "Rybka is a derivative of Fruit", which, to me at least, implies that Vas didn't program substantial chunks of engine.

I'm interested in comments like "should be banned for life from icga tournaments"

The UCI side is quite irrevelent to that. A GPL 'infringement' of the UCI is of no interest at all to the icga tournament coming up and quite probably of no great interest to the mass of comp chess people, who want to know one thing and one thing only. Is the engine a copy containing chunks of other people's work? Are there examples of cut 'n paste in the engine code?

All this talk of UCI GPL infringement is just prissy prissy stuff. If there is any, in reality, it could just be whizzed out by support engineers tomorrow, if it hasn't already been, if it ever existed. Get real and find some engine correspondence if there is any.