|
Home > Archive > GNU chess > August 2006 > gnuchess/xboard protocol
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
gnuchess/xboard protocol
|
|
| Ethan A Burns 2006-08-02, 7:08 pm |
| Hello,
I have questions about gnuchess (5.07) and the xboard protocol.
I found a document on the xboard protocol at the following url:
http://www.tim-mann.org/xboard/engine-intf.html
Looking at this page and comparing with output from ``gnuchess --xboard''
doesn't match up.
Does anyone have input for this? Is this document out dated now?
Also, (on linux) I have a program that opens up a couple pipes (for input and
output) and dup2's them to a ``gnuchess --xboard'' process's stdin and stdout.
Upon reading from the output end of the gnuchess's stdout pipe (reading the
stdout from gnuchess) my program blocks.
If just running ``gnuchess --xboard'' from the console, I notice that it starts
up by outputting:
Chess
Adjusting HashSize to 1024 slots
I would suspect that my initial read would see this output...
I also find, however, that if I send a move (b2b3 for example), that a
subsequent read will get the initial string:
Chess
Adjusting HashSize to 1024 slots
followed by the appropriate output for my move.
Testing around a bit, sending and reading (reading in a seperate thread), I
found that gnuchess only seems to send output to my pipe AFTER receiving a
move from my program.
When running gnuchess with out the --xboard option, my pipe is written to
immediatly as I would suspect, without waiting for a move to be sent to
gnuchess.
Is this the desired behavior, or is there a chance that I am setting up my
pipes/dup2s wrong?
Thanks,
--Ethan Burns
| |
| Ethan A Burns 2006-08-02, 7:08 pm |
| >Ethan A Burns wrote:
quote:
>
>The document is current.
>
>Deviations are bugs, or in some cases just missing features.
According to xboard protocol spec, section 9 Commands from the engine to xboard:
move MOVE
Your engine is making the move MOVE. Do not echo moves from xboard with
this command; send only new moves made by the engine.
However, when I enter a move into gnuchess --xboard the reply doesn't look like
that at all:
eaburns@bender ~ $ gnuchess --xboard
Chess
Adjusting HashSize to 1024 slots
b2b3
1. b2b3
1. ... d7d5
My move is: d7d5
the ``My move is: <MOVE>'' string is no where mentioned in the xboard protocol.
Is this then a bug in gnuchess?
quote:
>
>
>It is easier to look at the source for this, as you'll see where output
>is done to the stdout, in xboard mode, the pipe is explicitly flushed
>(the code should have been refactored to stuff this into a subroutine).
>
>It isn't flushed for the hash output, so I think this is a clear bug
>(Indeed I'll have to check if it should be output at all).
This output is not mentioned in the xboard protocol, so I believe it would be
a bug.
quote:
>
>I think the reason it doesn't cause any issues for most of the programs
>that work with it because of how they do the communication. Most do a
>"ping", and check for "pong", and so eat all this dross in the output
>that shouldn't be there at start-up.
Could you explain this a little bit more please? My understanding would be:
My program sends a ping, and reads in input untill I see a pong, just ignoring
everything inbetween? Is this correct?
quote:
>
>I will tidy this up for the next release, but suggest the "ping"/"pong"
>check is probably worth doing in general and as a workaround if you have
>to cope with earlier GNU Chess versions.
>
>Can I ask what your program does?
I am working on a 3D chess UI using opengl/glut.
Thanks for your responce,
--Ethan
| |
| Ethan A Burns 2006-08-02, 7:08 pm |
| Simon,
It would appear that gnuchess 4.0 does not support ping/pong. I would like
my engine to work with both 4 and 5. Is there any other tricks that I may
not know?
--Ethan
quote:
>Ethan A Burns wrote:
>ike
>ol.
>
>There are several places where Xboard and GNU Chess work together
>because they grew up together and bypass the protocol. This should have
>been fixed when GNU Chess 5 was written, but it wasn't.
>
>ng
>
>My perl scripts send "ping" and wait for "pong" at start up (ignoring
>anything before, as there are a load of options that get set at start
>up), and then before it reads any engine output it sends "ping", as a
>way of knowing the engine output is complete when it receives "pong".
>But probably wisest to work from Tim's documentation and keep telling me
>what is wrong (please!).
>
>Tim is clever, rigorous, and everything you want in an IT guy, and the
>GNU Chess 5 code base is easy to fix where these things are lacking,
>incorrect, or plain wrong.
>
>
>Sounds like something much needed.
>
>Brutal Chess by any chance? As that came to my attention recently.
| |
| Simon Waters (GNU) 2006-08-02, 7:08 pm |
| Ethan A Burns wrote:
quote:
>
> It would appear that gnuchess 4.0 does not support ping/pong. I would like
> my engine to work with both 4 and 5. Is there any other tricks that I may
> not know?
We gave up supporting GNU Chess 4 before I even became a co-maintainer.
Afraid you are definitely on your own with that one.
| |
| Hans Eric Sandström 2006-08-02, 7:08 pm |
| Hey,
The xboard protocol originates from the interfaces of the really old BSD=20
chess program that preceedes gnu chess.
But the source code for gnuchess 3 or 4 is still out there so you only ha=
ve=20
to look there for it. The stuff is in the file nondsp.c
/Hans Eric Sandstr=F6m
----- Original Message -----=20
From: "Simon Waters (GNU)" <simon-gnu@technocool.net>
To: "Ethan A Burns" <eaburns@euler.unh.edu>
Cc: <info-gnu-chess@gnu.org>
Sent: Friday, May 19, 2006 10:04 AM
Subject: Re: gnuchess/xboard protocol
quote:
> Ethan A Burns wrote:
=20[vbcol=seagreen]
I=20[vbcol=seagreen]
>
> We gave up supporting GNU Chess 4 before I even became a co-maintainer.
>
> Afraid you are definitely on your own with that one.
>
>
>
>
>
>
>
> _______________________________________________
> Info-gnu-chess mailing list
> Info-gnu-chess@gnu.org
> http://lists.gnu.org/mailman/listinfo/info-gnu-chess
>=20
| |
| ClassicChess 2006-08-02, 7:08 pm |
| Hans Eric Sandstr=F6m wrote:
quote:
> Hey,
>
> The xboard protocol originates from the interfaces of the really old BSD
> chess program that preceedes gnu chess.
Really?
Any idea where I can take a look at that? I like old chess programs.
I was under the impression that the xboard protocol was at least
partially derived from the interface used by John Stanback's public
domain 1987 program. An expanded version later became GNU Chess 2.x
I have never seen a copy of GNU Chess 0.x or 1.x, so I don't know what
it looked like. (As near as I can tell, copies no longer exist. Even
Mr. Cracraft no longer has a copy.)
| |
| Ethan A Burns 2006-08-02, 7:08 pm |
| sorry to spam but I forgot the sourceforge url:
https://sourceforge.net/projects/glutboard
[vbcol=seagreen]
>If anyone was curious, I have finally made a sourceforge page for my project.
>I am now going to take a small break from it, however, it is playable with
>gnuchess. It does castling, capturing, and basic moves but not pawn promotion
>,
>or en passant.
>
>--Ethan
>
>
| |
| Ethan A Burns 2006-08-02, 7:08 pm |
| If anyone was curious, I have finally made a sourceforge page for my project.
I am now going to take a small break from it, however, it is playable with
gnuchess. It does castling, capturing, and basic moves but not pawn promotion,
or en passant.
--Ethan
quote:
>Ethan A Burns wrote:
>
>The document is current.
>
>Deviations are bugs, or in some cases just missing features.
>
>
>
>It is easier to look at the source for this, as you'll see where output
>is done to the stdout, in xboard mode, the pipe is explicitly flushed
>(the code should have been refactored to stuff this into a subroutine).
>
>It isn't flushed for the hash output, so I think this is a clear bug
>(Indeed I'll have to check if it should be output at all).
>
>I think the reason it doesn't cause any issues for most of the programs
>that work with it because of how they do the communication. Most do a
>"ping", and check for "pong", and so eat all this dross in the output
>that shouldn't be there at start-up.
>
>I will tidy this up for the next release, but suggest the "ping"/"pong"
>check is probably worth doing in general and as a workaround if you have
>to cope with earlier GNU Chess versions.
>
>Can I ask what your program does?
|
| |
|
|