On Crafty...

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: On Crafty...

Post by bob »

Milos wrote:
bob wrote:Are you a programmer type? Do you know what you are doing? Because just looking at the loop initialization/termination code would show you that what is in Crafty is _not_ in Knuth's code.


for (movep = tree->last[ply - 1]; movep < tree->last[ply] - 1; movep++, sortv++)

Hmm. I am using pointers. Knuth uses a simple integer subscript. I even increment two values in the loop, while Knuth uses just one variable for the loop counter. Yeah, those are _identical_.
You are intentionally comparing this one, but not the other one from root.c. Coincidence? No I don't think so.
I picked the "main one". You _did_ quote _both_ as being "verbatim copies" after all. So do we take the first one? Fine by me. here's the code from 19.0:

Code: Select all


  do {
    done=1;
    for (i=0;i<lastm-rmoves-1;i++) {
      if (sort_value[i] < sort_value[i+1]) {
        temp=sort_value[i];
        sort_value[i]=sort_value[i+1];
        sort_value[i+1]=temp;
        temp=rmoves[i];
        rmoves[i]=rmoves[i+1];
        rmoves[i+1]=temp;
        done=0;
      }
    }
  } while(!done);
[/quote]


Classic bubble sort.  I see _nothing_ verbatim there.  I am sorting _two_ values, not just one.  I have a value, and a move.  I am sorting the moves, but I am using the value as the sort key.  So I move both around.  Is Knuth doing that?  Of course not.  Code is different.  I have not said "this is not a bubble sort, it is something original I wrote."  I have said that "this is a bubble-sort that is my original code, it was not copied from _anywhere_."  And that statement stands, and you have not contradicted it in the least.

Now that is 2 out of the 4 sorts you find in Crafty.  Do we go through the other two as well.  Again.  _nothing_ has been copied.  

[quote]
Btw. there is no concept of "pointer" in assembler code. There are just different types of addressing. Strange that you don't know that. [/quote]

There is a lot that you don't know.  Did you know that the old Xerox sigma 6, 7 and 9 computers had pointers?  if the high order bit of something used as an address was set, then that indicated that the value was "indirect" and had to be dereferenced.  And it was recursive.  Lot you don't know.

In assembly language, most of us consider this a pointer:

mov   eax, [ebx]

where this is a simple value:

mov eax, ebx.

Yes, it is also called "register indirect".  It's a pointer.  The register doesn't contain the value, it contains the address of the value.  That's a pointer.


[quote]


[quote]Sorry.  But there are a couple of well-known bugs in Crafty 19.0.  They are present in Rybka 1.6.1.  There is no doubt that code was copied, as there is no possible reason those two bugs would have been written by another programmer, for reasons long since explained...  Try again.[/quote]
Having no reason for bugs is not enough to prove verbatim copying, at least not according to your definition. And btw. in Crafty 19.0 you use pointers, there are no pointers in disassembled Rybka 1.6.1. So again no verbatim coping. Again you fall in you own trap.

[/quote]

I don't even want to guess what you are talking about.  But it is certainly technically irrelevant and incorrect, so there's no point in trying to figure it out.


[quote]


[quote]Why don't you _try_ it rather than guessing?  You might figure out that I did.  The code is shorter.  It is less "branchy".  And again, for 2 or 3 values, it is almost impossible to beat it...[/quote]
And you know that by what, your hunch?
All that probability analysis Knuth gives is nothing compared to your hunch, right? :lol: [/quote]

Not a "hunch".  It is more correctly called "experimental testing."  Feel free to rip the insertion sort out of next.c and copy it into quiesce.c.  It will plug in perfectly.  See what happens.  No guesswork.  No wondering.  Just run a 2 billion node search with each and see which one is faster.  Then you don't need a hunch.  I certainly didn't need one.


[quote]

[quote]Then I guess you are not going to ever retract that "verbatim copy" nonsense for starters?  Didn't think so...[/quote]
You are the one who resorts to changing definitions on the way how it suits him. For Crafty/Rybka, Fruit/Rybka, Houdini/Robbo, etc. you have one definition, and for Knuth/Crafty you have another. Sorry, but that's not acceptable.[/quote]

I'm not changing _anything_.  In our analysis of Rybka, we showed several complete functions from Rybka.  Compared directly to the same functions in Crafty.  The code was _identical_.   You compile your "knuth code" and compare the compiler output to my sort and see how "identical they are."  Then you can join the argument intelligently.

[quote]

[quote]I believe I asked you do do that first.  So far you have not...[/quote] 
You have actually never showed any code comparison by yourself on this forum. At least not in last two years. It was always someone else you was doing it. And you as usual just rely on your authority for ppl to believe you. Sorry, not this time.[/quote]

First things first.  Still waiting on your "verbatim copy from Knuth to Crafty."  Am also still waiting on your "lots of PD code in Crafty."  Lest you try to forget, intentionally:

[quote="Milos"]
(since there is obviously quite a bit of PD code in Crafty)[/quote]

So far, you have shown zero.  Which is what you typically show, technically.  Let's get this cleaned up, then we can move on to either rybka 1.6.1/crafty if you want, or crafty/ippolit/robolito...

Right now, you are batting zero.  I don't think it will change...
Chan Rasjid
Posts: 588
Joined: Thu Mar 09, 2006 4:47 pm
Location: Singapore

Re: On Crafty...

Post by Chan Rasjid »

Milos wrote: ...
From Crafty 23.4, root.c 135-148 and quiesce.c 162-176:

Code: Select all

  do &#123;
    done = 1;
    for &#40;i = 0; i < lastm - rmoves - 1; i++) &#123;
      if &#40;sort_value&#91;i&#93; < sort_value&#91;i + 1&#93;) &#123;
        temp = sort_value&#91;i&#93;;
        sort_value&#91;i&#93; = sort_value&#91;i + 1&#93;;
        sort_value&#91;i + 1&#93; = temp;
        temp = rmoves&#91;i&#93;;
        rmoves&#91;i&#93; = rmoves&#91;i + 1&#93;;
        rmoves&#91;i + 1&#93; = temp;
        done = 0;
      &#125;
    &#125;
  &#125; while (!done&#41;;

Code: Select all

    do &#123;
      done = 1;
      sortv = tree->sort_value;
      for &#40;movep = tree->last&#91;ply - 1&#93;; movep < tree->last&#91;ply&#93; - 1;
          movep++, sortv++)
        if (*sortv < *&#40;sortv + 1&#41;) &#123;
          temp = *sortv;
          *sortv = *&#40;sortv + 1&#41;;
          *&#40;sortv + 1&#41; = temp;
          temp = *movep;
          *movep = *&#40;movep + 1&#41;;
          *&#40;movep + 1&#41; = temp;
          done = 0;
        &#125;
    &#125; while (!done&#41;;
...
Now regarding Knuth, in his The Art of Computer Programming - Volume 3 - Sorting and Searching, 2nd ed. page 107 there is a code which is in his pseudo machine language.

Wikipedia on bubble sort:

Code: Select all

  do
    swapped = false
    for each i in 1 to length&#40;A&#41; - 1 inclusive do&#58;
      if A&#91;i-1&#93; > A&#91;i&#93; then
        swap&#40; A&#91;i-1&#93;, A&#91;i&#93; )
        swapped = true
      end if
    end for
  while swapped
Looks familiar doesn't it??? :)
...
It seems all your quote of codes does vindicate that Bob has copyright to his bubble sort code (provided it is not copied verbatim from other sources) and any verbatim copying infringes on his copyright. But exact assembly bubble sort algorithm does not necessarily imply any 'verbatim' copying.

Knuth has copyright only to his pseudo codes as text only - copying the text verbatim could mean infringement of copyright (very minor). Almost certainly, it CANNOT be compiled by any known compiler to produce any assembly or machine codes. There is no comparison here.

Wiki did not use any verbatim copy of Bob's bubble sort code - so there is no basis to sue wiki .

Rasjid
Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: On Crafty...

Post by Milos »

bob wrote:Classic bubble sort. I see _nothing_ verbatim there. I am sorting _two_ values, not just one. I have a value, and a move. I am sorting the moves, but I am using the value as the sort key. So I move both around. Is Knuth doing that? Of course not. Code is different. I have not said "this is not a bubble sort, it is something original I wrote." I have said that "this is a bubble-sort that is my original code, it was not copied from _anywhere_." And that statement stands, and you have not contradicted it in the least.
Nope, you are sorting only one value sort_value. You have only one comparison. You are however swapping 2 values, but that's just irrelevant. You seams not to understand the difference between sorting (comparing) and swapping. Maybe you didn't copied the code, maybe Vas also didn't copy the code. However, concerning presented evidence and your reasoning (definition of verbatim copying) none of it is provable. So it's again forcing ppl to believe just because you are some kind of authority. Sorry, not good enough.
Now that is 2 out of the 4 sorts you find in Crafty. Do we go through the other two as well. Again. _nothing_ has been copied.
So you say. Vas says the same. Judging by the authority (since there is nothing else left, since none did verbatim copying by your own definition) by the success of the program he should be believed first since all of his programs are far more successful than any of yours.
There is a lot that you don't know. Did you know that the old Xerox sigma 6, 7 and 9 computers had pointers? if the high order bit of something used as an address was set, then that indicated that the value was "indirect" and had to be dereferenced. And it was recursive. Lot you don't know.
Thanks for the lesson in prehistoric computer "design". If I needed one, I would go to technology museum. So how is that relevant to anything in the discussion?
In assembly language, most of us consider this a pointer:

mov eax, [ebx]

where this is a simple value:

mov eax, ebx.

Yes, it is also called "register indirect". It's a pointer. The register doesn't contain the value, it contains the address of the value. That's a pointer.
Most of you is you and ppl you blindly follow your authority. For others there is a referent literature. And this one says differently.
You are well known for trying to dispute the common facts and definitions in AI/CS field and introduce your own. However, that doesn't make you any more special, just more weird.
I don't even want to guess what you are talking about. But it is certainly technically irrelevant and incorrect, so there's no point in trying to figure it out.
You have no other argument but to call on your authority. Sorry, but that one does not really exist in the real world outside of this forum and even here is not unanimous.

Not a "hunch". It is more correctly called "experimental testing." Feel free to rip the insertion sort out of next.c and copy it into quiesce.c. It will plug in perfectly. See what happens. No guesswork. No wondering. Just run a 2 billion node search with each and see which one is faster. Then you don't need a hunch. I certainly didn't need one.
You cannot measure reliably (with sufficiently small error margin) this kind of difference by measuring time. So simply speaking, I don't know what you've tested and how you've tested it, but that's simply BS.
On the other hand there is quite accurate math in Knuth's book that says you have no clue what you are talking about.
I'm not changing _anything_. In our analysis of Rybka, we showed several complete functions from Rybka. Compared directly to the same functions in Crafty. The code was _identical_. You compile your "knuth code" and compare the compiler output to my sort and see how "identical they are." Then you can join the argument intelligently.
The code might have been identical by one of your custom handy definitions of identical but not by your own definition of verbatim. Since you are frequently using verbatim with respect to Rybka/Fruit/Crafty issue you are simply slandering.
First things first. Still waiting on your "verbatim copy from Knuth to Crafty." Am also still waiting on your "lots of PD code in Crafty." Lest you try to forget, intentionally:
You are the one who first started claiming Robbo contains code from Crafty. I simply say that's BS and you are slandering because your ego is hurt.
That's evident to anyone who has sufficient emotional intelligence.
And since you haven't provided any evidence the point is moot. The truth is, there is zero copyrightable Crafty code in Robbo. End of story.
Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: On Crafty...

Post by Milos »

Chan Rasjid wrote:It seems all your quote of codes does vindicate that Bob has copyright to his bubble sort code (provided it is not copied verbatim from other sources) and any verbatim copying infringes on his copyright. But exact assembly bubble sort algorithm does not necessarily imply any 'verbatim' copying.

Knuth has copyright only to his pseudo codes as text only - copying the text verbatim could mean infringement of copyright (very minor). Almost certainly, it CANNOT be compiled by any known compiler to produce any assembly or machine codes. There is no comparison here.

Wiki did not use any verbatim copy of Bob's bubble sort code - so there is no basis to sue wiki .
Following your conclusions, there is no verbatim copy of Fruit or Crafty code in Rybka so there is no basis for any complaint against Vas. Similar thing is valid for Rybka/Ippo or Ippo/Houdini issue.
So why is all the fuss then?
Chan Rasjid
Posts: 588
Joined: Thu Mar 09, 2006 4:47 pm
Location: Singapore

Re: On Crafty...

Post by Chan Rasjid »

Milos wrote: ...
Since you are frequently using verbatim with respect to Rybka/Fruit/Crafty issue you are simply slandering.
...
Verbatim could be said of Rybka only when there are exact binary matches with other binaries. Is this not how they run the show? Did not the ICGA team found "large swath" of codes in Rybka that match exactly the assembly codes produced by compiling Crafty/Fruit. ONLY IF there are such exact assembly matches can it be said "Rybka has Crafty/Fruit codes in it...".

Rasjid
Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: On Crafty...

Post by Milos »

Chan Rasjid wrote:Verbatim could be said of Rybka only when there are exact binary matches with other binaries. Is this not how they run the show? Did not the ICGA team found "large swath" of codes in Rybka that match exactly the assembly codes produced by compiling Crafty/Fruit. ONLY IF there are such exact assembly matches can it be said "Rybka has Crafty/Fruit codes in it...".
Having exact binary match is impossible. You would need to have exactly the same source code (not just the function you are comparing but all the surrounding code), exactly the same version of compiler (with exactly the same libraries) and exactly the same compiler switches. If you really believe they (ICGA) managed to reproduce all of that, than there is only one word left to describe you - naive.

More precisely, verbatim copy test would be for example take N bytes (and you put some reasonable minimum on N, like 1000) of binary A, take N bytes of binary B and calculate CRC on both. If CRC doesn't match they are not verbatim copies, plain and simple.
Chan Rasjid
Posts: 588
Joined: Thu Mar 09, 2006 4:47 pm
Location: Singapore

Re: On Crafty...

Post by Chan Rasjid »

Milos wrote:
Chan Rasjid wrote:Verbatim could be said of Rybka only when there are exact binary matches with other binaries. Is this not how they run the show? Did not the ICGA team found "large swath" of codes in Rybka that match exactly the assembly codes produced by compiling Crafty/Fruit. ONLY IF there are such exact assembly matches can it be said "Rybka has Crafty/Fruit codes in it...".
Having exact binary match is impossible. You would need to have exactly the same source code (not just the function you are comparing but all the surrounding code), exactly the same version of compiler (with exactly the same libraries) and exactly the same compiler switches. If you really believe they (ICGA) managed to reproduce all of that, than there is only one word left to describe you - naive.
I have to accept your authority on this unless some other authority refutes it.

So then it means this investigation of Rybka-Crafty/Fruit is only through functional equivalence of "large swath" of assembly codes. Still such large swath of code equivalence is suspicious - if the blocks are too "large" for comfort.

So we have to let a panel of expert to pronounce. This is how the real world works.

But ...remember how the professional rating agencies rated Lehman Brother's...

Rasjid.
User avatar
Zach Wegner
Posts: 1922
Joined: Thu Mar 09, 2006 12:51 am
Location: Earth

Re: On Crafty...

Post by Zach Wegner »

Dann Corbit wrote:It can be safely said that Crafty's code is beyond reproach.
All contributed code is clearly documented.
I don't think that's really true. As an easy example, the Random32() function STILL doesn't have attribution, even though it's been brought up a zillion times before...
Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: On Crafty...

Post by Dann Corbit »

bob wrote:
Milos wrote:
bob wrote:So which is it? You originally said "verbatim." which has a specific meaning. Now you say "functionally equivalent" which means the two "ideas" are the same, They are certainly not "semantically equivalent." I have already explained why.
Nope, I originally said copyright. Agian you are changing subject and topic as it suits you. For claiming your own copyright it's not enough to just change variable names and you know it. You are just playing dumb.
So I just imagined this direct quote from the first post in this specific thread:
Milos wrote: Interesting, I thought the very same implementation of bubble sort you copied verbatim from Knuth...

That "verbatim" is my imagination???
It would have been quite a trick, since Crafty would have to have a MIX interpreter since Knuth writes all of his algorithms in MIX.
Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: On Crafty...

Post by Dann Corbit »

Zach Wegner wrote:
Dann Corbit wrote:It can be safely said that Crafty's code is beyond reproach.
All contributed code is clearly documented.
I don't think that's really true. As an easy example, the Random32() function STILL doesn't have attribution, even though it's been brought up a zillion times before...
I have long been of the opinion that writing any computer program should be exactly the same as writing a reference book. By this I mean that every external piece of information should have a citation complete with original author, etc.

I remember my excitement when I heard about "literate programming" since I supposed that my intended approach might be what was described, but it turns out not to be the case, and WEB is a pain in the posterior {*}.

Let me amend my claim concerning Crafty:
Of the hundreds of chess programs for which I have read the source code, Crafty, by leaps and bounds, is the most careful and complete as far as proper citations for original material is concerned.

I am not surprised that the goal has fallen short of perfections and I would also be very keen to see a program which was better documented as far as historical sources and modification history.

{*} IMO-YMMV