Need a little help from a Pascal guru (Chess05 Frey/Atkin)

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Need a little help from a Pascal guru (Chess05 Frey/Atki

Post by sje »

The program source has non-local goto statements, and that's a show-stopper in Free Pascal. I don't use GNU Pascal, so it may behave differently.

I strongly suspect a problem with the old style I/O calls, all of which were designed for a non-interactive environment. Perhaps the program is stalled waiting for input or it got an end-of-file and doesn't know what to do.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Need a little help from a Pascal guru (Chess05 Frey/Atki

Post by Sven »

Jim Ablett wrote:I've actually compiled the program as got it running on Windows using the Gnu Pascal Compiler.
I can make one move and get one move back from the engine then it just seem to get stuck in an endless loop.
I cannot input any more moves and have to do a Ctrl+Break to get out of it.
This is really frustrating - so near yet so far.

Here's the src & semi-working windows exe > http://dl.dropbox.com/u/5047625/chess05%20iso%20src.zip
Several lines are tagged with a comment "[sam]" which I assume not to be your changes, right? I see that most of the changes are related to a variable named "jumpin", which is also involved in the main loop and in the command line parser, so there might be some correlation to the problem you have described. I did not dig deeper into it, it is my first suspicion.

I tried also to run the executable on WinXP 32bit (old Intel P4, I must admit) but it crashes immediately:

Code: Select all

      7 [main] ? 2720 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
Exception: STATUS_ACCESS_VIOLATION at eip=7C921529
eax=00400000 ebx=00000000 ecx=610E889C edx=0022FFE0 esi=01CCCEE9 edi=00400000
ebp=0022EECC esp=0022EEA4 program=, pid 0, thread main
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
Stack trace:
Frame     Function  Args
0022EECC  7C921529  (00400000, 00000000, 0022EEE8, 7C809F9F)
0022EEDC  7C92162C  (00400000, 0022EF18, 6109A582, 00400000)
0022EEE8  7C809F9F  (00400000, 00000001, 0022EFF0, 6104F4A6)
0022EF18  6109A582  (00400000, 0022FFE0, 7C91E920, 7C927C58)
0022EFD8  61004A78  (0022EFF0, 0022F03C, 0022EFF0, 002310A4)
0022FF88  6100594F  (00000000, 00000000, 00000000, 00000000)
End of stack trace
which is clearly a different problem. Or have you provided a 64 bit version only?

Sven
User avatar
Jim Ablett
Posts: 1383
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Need a little help from a Pascal guru (Chess05 Frey/Atki

Post by Jim Ablett »

Sven Schüle wrote:
Jim Ablett wrote:I've actually compiled the program as got it running on Windows using the Gnu Pascal Compiler.
I can make one move and get one move back from the engine then it just seem to get stuck in an endless loop.
I cannot input any more moves and have to do a Ctrl+Break to get out of it.
This is really frustrating - so near yet so far.

Here's the src & semi-working windows exe > http://dl.dropbox.com/u/5047625/chess05%20iso%20src.zip
Several lines are tagged with a comment "[sam]" which I assume not to be your changes, right? I see that most of the changes are related to a variable named "jumpin", which is also involved in the main loop and in the command line parser, so there might be some correlation to the problem you have described. I did not dig deeper into it, it is my first suspicion.

I tried also to run the executable on WinXP 32bit (old Intel P4, I must admit) but it crashes immediately:

Code: Select all

      7 [main] ? 2720 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
Exception: STATUS_ACCESS_VIOLATION at eip=7C921529
eax=00400000 ebx=00000000 ecx=610E889C edx=0022FFE0 esi=01CCCEE9 edi=00400000
ebp=0022EECC esp=0022EEA4 program=, pid 0, thread main
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
Stack trace:
Frame     Function  Args
0022EECC  7C921529  (00400000, 00000000, 0022EEE8, 7C809F9F)
0022EEDC  7C92162C  (00400000, 0022EF18, 6109A582, 00400000)
0022EEE8  7C809F9F  (00400000, 00000001, 0022EFF0, 6104F4A6)
0022EF18  6109A582  (00400000, 0022FFE0, 7C91E920, 7C927C58)
0022EFD8  61004A78  (0022EFF0, 0022F03C, 0022EFF0, 002310A4)
0022FF88  6100594F  (00000000, 00000000, 00000000, 00000000)
End of stack trace
which is clearly a different problem. Or have you provided a 64 bit version only?

Sven
Hi Sven,

Sorry forgot to mention it's compiles with cygwin version of gpc so it'll need cygwin1.dll. I've update the package now in case you want to re-download.

Jim.
User avatar
Jim Ablett
Posts: 1383
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Need a little help from a Pascal guru (Chess05 Frey/Atki

Post by Jim Ablett »

sje wrote:The program source has non-local goto statements, and that's a show-stopper in Free Pascal. I don't use GNU Pascal, so it may behave differently.

I strongly suspect a problem with the old style I/O calls, all of which were designed for a non-interactive environment. Perhaps the program is stalled waiting for input or it got an end-of-file and doesn't know what to do.
Thanks Steven,

an I/O problem is what I suspected myself. Still it would be interesting if someone could get it working properly.

Jim.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Need a little help from a Pascal guru (Chess05 Frey/Atki

Post by Sven »

sje wrote:The program source has non-local goto statements, and that's a show-stopper in Free Pascal. I don't use GNU Pascal, so it may behave differently.
According to "ByteChess.txt" inside the package, GNU Pascal can handle those non-local goto statements. I also found no mentioning of that as a known problem at the GNU pascal site.

Sven
Carey
Posts: 313
Joined: Wed Mar 08, 2006 8:18 pm

Re: Need a little help from a Pascal guru (Chess05 Frey/Atki

Post by Carey »

Jim Ablett wrote:I've actually compiled the program as got it running on Windows using the Gnu Pascal Compiler.
I can make one move and get one move back from the engine then it just seem to get stuck in an endless loop.
I cannot input any more moves and have to do a Ctrl+Break to get out of it.
This is really frustrating - so near yet so far.

Here's the src & semi-working windows exe > http://dl.dropbox.com/u/5047625/chess05%20iso%20src.zip


thanks,
Jim.
Jim

I'm the idiot who typed that sucker in and got it to work. I did play several complete games and it seemed to work tolerably well.

I don't know where you got your copy, but you might not have gotten the final version.

Even on my now defunct website, I had a minor correction text file about a typo in the castling constants that I never got around to applying to the source itself.


I'll email you the 'final' source zip file as well as the last error I found.

When I compiled it, I probably did it for DOS, but I have no idea what version of the compilers I used.

Carey
User avatar
Jim Ablett
Posts: 1383
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Need a little help from a Pascal guru (Chess05 Frey/Atki

Post by Jim Ablett »

Carey wrote:
Jim Ablett wrote:I've actually compiled the program as got it running on Windows using the Gnu Pascal Compiler.
I can make one move and get one move back from the engine then it just seem to get stuck in an endless loop.
I cannot input any more moves and have to do a Ctrl+Break to get out of it.
This is really frustrating - so near yet so far.

Here's the src & semi-working windows exe > http://dl.dropbox.com/u/5047625/chess05%20iso%20src.zip


thanks,
Jim.
Jim

I'm the idiot who typed that sucker in and got it to work. I did play several complete games and it seemed to work tolerably well.

I don't know where you got your copy, but you might not have gotten the final version.

Even on my now defunct website, I had a minor correction text file about a typo in the castling constants that I never got around to applying to the source itself.


I'll email you the 'final' source zip file as well as the last error I found.

When I compiled it, I probably did it for DOS, but I have no idea what version of the compilers I used.

Carey
Here is new working windows executable compiled using Carey's updated src > http://dl.dropbox.com/u/5047625/chess05-ja.zip

All credit is due to Carey who has done a lot of work on bugfixing the src and now you should be able to compile a working binary with
Turbo Pascal & Free Pascal (untested) as well as Gnu Pascal which I used.

I made a few cosmetic changes to the console output and tweaked the internals a bit so it plays a stronger game with longer thinking time.

Many thanks for your help Carey,

Jim.
User avatar
Jim Ablett
Posts: 1383
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Need a little help from a Pascal guru (Chess05 Frey/Atki

Post by Jim Ablett »

Please re-download.
Found buffer overflow in eval.
(my fault - increased search depth too much),

http://dl.dropbox.com/u/5047625/chess05-ja.zip

best,
Jim.
User avatar
nanochess
Posts: 64
Joined: Thu Feb 19, 2009 5:34 pm
Location: Mexico, Mexico

Re: Need a little help from a Pascal guru (Chess05 Frey/Atki

Post by nanochess »

I'm fact I have the source of Chess 0.5 from "The Byte Book of Pascal", the listings are faded, I've typed it one time :shock: and managed to get it compiled, I don't remember what I did with it, but it was so slow and not as strong as I thought :? .
Any idea of ELO rating with your modifications?
All good things are difficult to achieve.
Toledo Nanochess book http://www.amazon.com/Toledo-Nanochess- ... 1304864375
Carey
Posts: 313
Joined: Wed Mar 08, 2006 8:18 pm

Re: Need a little help from a Pascal guru (Chess05 Frey/Atki

Post by Carey »

Jim Ablett wrote:Please re-download.
Found buffer overflow in eval.
(my fault - increased search depth too much),

http://dl.dropbox.com/u/5047625/chess05-ja.zip

best,
Jim.
Laugh... Way to go, Jim.

I guess you forgot this thing was designed back in the days when people would be running it on interpreted UCSD Pascal and 8080's...

(grin)