Cray Blitz source (Carey)

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Dann Corbit
Posts: 12545
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Cray Blitz source (Carey)

Post by Dann Corbit »

It is unspeakably cool that you got the cray blitz code to compile. It's sort of like seeing history reborn.
It was Fortran if I recall correctly. Are you using the Intel compiler or GCC or???
Is the source currently available?
Dann Corbit
Posts: 12545
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Cray Blitz source (Carey)

Post by Dann Corbit »

Carey wrote:Bob;

I'm thrilled at the progress you've made. I realize that most people in this forum don't care, but I really like the classics.... :D
{snip}
Carey
I would be no less excited at the release of Cray Blitz for the PC than open source Rybka 4.0.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Cray Blitz source (Carey)

Post by bob »

Dann Corbit wrote:It is unspeakably cool that you got the cray blitz code to compile. It's sort of like seeing history reborn.
It was Fortran if I recall correctly. Are you using the Intel compiler or GCC or???
Is the source currently available?
it was fortran, with some cray assembly to replace several of the fortran functions. I will include the cray assembly for interest, but it isn't really usable. The fortran compiles cleanly on the intel fortran compiler. I have not tried gnuf77 yet, but should do so...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

source available---------

Post by bob »

I put a file on the public ftp box in the "crayblitz" directory. The file is named "crayblitz.tar.gz". This includes all the fortran source, plus a sub-directory of all the (supposedly matching) cray assembly code, plus a file "book.source" and a c-shell script "buildbook".

If you have the intel fortran compiler, first type "make". This should run with no errors. Then type "buildbook" which will make the two book programs, then create the binary book files needed to run.

Then type "./blitz", enter your name, and answer the next to questions, and then type "help" For more information about commands, look at "options.f" Main.f has some notes about various changes made in 1990-1991 (I did not keep all changes as I have been doing in Crafty, unfortunately, but that's the way it is.)

I have played a couple of games to verify that it works. Pondering does not work and is disabled by default. I might try to fix that when I have time. Same for parallel search. All the old code is there, but it can't create threads unless you run it on a real Cray.

I can not vouch for the state of the program, since this was just a lucky "snapshot" that was taken and saved, and I have no idea of the state of things when it was made. Might have been in the middle of some changes, or it might have been in a reasonable state.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Cray Blitz source (Carey)

Post by bob »

Dann Corbit wrote:
Carey wrote:Bob;

I'm thrilled at the progress you've made. I realize that most people in this forum don't care, but I really like the classics.... :D
{snip}
Carey
I would be no less excited at the release of Cray Blitz for the PC than open source Rybka 4.0.
You might feel differently once you see it. It was once clean for a fortran program. But harry kept ripping things apart so that he could replace small pieces of key stuff with assembly, and the code got messier and messier. you will see what I mean when you look at things like mover/umover and wonder 'why in the hell is this broken into different subroutines in such an oddball way?'
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Cray Blitz source (Carey)

Post by bob »

Carey wrote:
Steelman wrote:So what was not Cal was Fortan? I assumed in would be written in c.
Because of the Cray?
Bob hasn't answered yet, so I figured I"d give it a try...

Yes, Blitz & CrayBlitz were Fortran.

Blitz was started back in the 70's. Not sure when, but probably early 70s. It was in Fortran. At the time, if you wanted efficiency and portability, you went with Fortran. There weren't any other choices.

(Bob says he's been doing computer chess for 40 years. So that would put the start in 68, right after MacHack VI. I don't know if Blitz came from 68 or was a later program. By 76 he was up to Blitz 4 and 77 was Blitz 5. So assuming one number per year, Blitz was started in 72 and would not have been his first chess program. But it was influenced by MacHack VI because originally it was a selective search program.)

The Cray was basically built for Fortran. For a while that and CAL was all they offered.

Eventually they added C (not sure when) but that was after Blitz became CrayBlitz. Because of C's flexibility and lack of rules, I imagine there were a number of restrictions and limitations if you wanted something vectorized.

Bob could have done a rewrite, of course, but there wasn't much point in doing so. You'd still have to switch to assembler for the key stuff.

As CrayBlitz grew, he probably wasn't in the mood to rewrite it into C even if it had been beneficial.


According to Welsh's second book, Harry Nelson compared CrayBlitz (right after it was put onto the Cray-1) and Chess 4.5 He discovered CrayBlitz was a lot slower. An execution profiler showed CrayBlitz was spending 25% of its time in just one 20 line subroutine. He rewrote that one routine in CAL and the whole program speeded up by 19%.

The Cray was really not well suited for chess, but Bob & Harry Nelson managed to force it and were creative enough they actually made it work efficiently.


After the source gets released, you can look at it yourself... Doing things in Vectors is a little odd if you are used to normal processors like we use.

There's no way you could get CrayBlitz running efficiently on a regular computer. There is a lot of CRAY in CrayBlitz.


I haven't gotten the source yet, and it may take a day or two after I get it before I post it (I may try running it through f2c, so I can provide a portable C version everybody can use), but I'll be sure and let people know when its ready.

Carey
If you do that (f2c) send me the result. I can probably come a _lot_ closer to making pondering and parallel search work there than I can with the FORTRAN limitations and differences across platforms.

For the early versions (#1 played its first move in 1968 by the way) the "renumbering" only happened on major changes. 1-5 were very selective. version 6 was patterned after chess 4.x with a full-width search and such.

Later Harry went ape-sh** with versions and every last change, even one line, got a new version number with him. It was good for record-keeping, but led to a _lot_ of versions. We started numbering them cray blitz AAD where AA was a 2 digit version number that was incremented when something "interesting" was done (any change that affected a hundred lines or more or something similar). the "D" was a single letter that was incremented on any change of any kind, so that we always had all older versions at hand.

According to my paper file, we got as far as 59p by the end of 1994 when we stopped working on it. The version here is 49h. Looks like 49j played in the ACM that year for reference, but none of those more recent versions exist.

version 52 started the singular extension versions and I'd love to have that back just to study as it was complicated and I might be convinced to try that again if I had the old code to look at, but barring yet another miracle, that won't happen...
User avatar
Zach Wegner
Posts: 1922
Joined: Thu Mar 09, 2006 12:51 am
Location: Earth

Re: source available---------

Post by Zach Wegner »

Awesome! I'm definitely going to look at this later. I hope my total ignorance of FORTRAN will not prevent me from enjoying this gem. I hope someone is interested in making an xboard version. I might want to if (very big if here) I have the time...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: source available---------

Post by bob »

Zach Wegner wrote:Awesome! I'm definitely going to look at this later. I hope my total ignorance of FORTRAN will not prevent me from enjoying this gem. I hope someone is interested in making an xboard version. I might want to if (very big if here) I have the time...
The last year had an xboard compatible version, but that is not in this one unfortunately. It would not be hard to get it to work. It has the same setboard command to set up a position as in Crafty. Move input/output is SAN. It won't quite know what to do with "new" but if you use the -xreuse option so that it gets restarted after each game, it might come close to working. I'll check it out when I have time...

Don't expect too much out of it however. Remember that this version is some 17 years old, so things have changed a lot in that length of time. I'd certainly use "nm=2" since we now know that works well. There are other things I don't even remember being in there, such as the ability to write eval terms to a file, and restore them, sort of like the personality stuff in Crafty. Was surprising to look at something I haven't touched in 17 years to see how much I have forgotten. :)
Carey
Posts: 313
Joined: Wed Mar 08, 2006 8:18 pm

Re: Cray Blitz source (Carey)

Post by Carey »

Dann Corbit wrote:
Carey wrote:Bob;

I'm thrilled at the progress you've made. I realize that most people in this forum don't care, but I really like the classics.... :D
{snip}
Carey
I would be no less excited at the release of Cray Blitz for the PC than open source Rybka 4.0.
It is pretty cool.

I remember a couple years ago when Bob Fed-Ex'ed me the printed listings for Blitz & CrayBlitz.

I spent hours just looking through the listings.

It was almost like Christmas.

Of course, doing the OCR attempt was considerably less fun.... :( Word of advice... never try to OCR Fortran!!
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Cray Blitz source (Carey)

Post by bob »

Gerd Isenberg wrote:
bob wrote:
Gerd Isenberg wrote:Bob, is your 1983 Master's Thesis available online as scanned ps or pdf?

Hyatt, R. 1983. Cray Blitz - A Computer Chess Playing Program. Master's Thesis, University of Southern Mississippi.
No, but I could probably have it scanned. I have an original, but it doesn't say much about parallel issues since the parallel stuff we were doing back then was pretty primitive...
If you may scan and upload it on some place if you have some time left...
It would be nice to have a scanned pdf for historical reasons.
I will try to get both that and my dissertation scanned. My dissertation was written using "interleaf" and before I knew it, the electronic version was unusable due to changes to interleaf over the years. Be nice to have that back in a text form as well...