uci2wb.git
9 years agoAdd Linux manual page
H.G.Muller [Thu, 30 Oct 2014 11:46:19 +0000]
Add Linux manual page

9 years agoPrint feature sigint=0 sigterm=0
H.G.Muller [Thu, 30 Oct 2014 09:13:18 +0000]
Print feature sigint=0 sigterm=0

Better to not even let XBoard send the signals we are going to ignore,
as this would just waste system resources.

9 years agoDon't forget to quit engine when GUI dies unexpectedly
H.G.Muller [Wed, 29 Oct 2014 21:46:59 +0000]
Don't forget to quit engine when GUI dies unexpectedly

When we get an EOF signal from the GUI pipe, meaning that the GUI
died without sending a 'quit' command, we'd better shutdown the engine
before exiting ourself.

9 years agoMake UCI2WB resistent to SIGTERM in Linux
H.G.Muller [Wed, 29 Oct 2014 21:43:46 +0000]
Make UCI2WB resistent to SIGTERM in Linux

UCI2WB was already resistant to SIGINT, which XBoard sends with every
usermove, but must also ignore the SIGTERM that is sent with the quit
command in order to reliably relay this quit to the engine.

9 years agoBump version to 2.0
H.G.Muller [Tue, 28 Oct 2014 20:02:56 +0000]
Bump version to 2.0

9 years agoWork-around for move during ponder
H.G.Muller [Tue, 28 Oct 2014 19:45:23 +0000]
Work-around for move during ponder

When engines, in violation of UCI specs, moved during ponder without
waiting for 'stop' or 'ponderhit', UCI2WB would pass their move out
of turn to the GUI, and hang when the opponent would move, waiting
for an engine move that had already come. We now ignore such a
premature ending of the ponder search, like no ponder search was
made at all. And we give an error message in the engine output.

9 years agoFix UCCI draw offers
H.G.Muller [Tue, 28 Oct 2014 11:57:14 +0000]
Fix UCCI draw offers

The offer must not be sent with the 'go ponder' command, but with 'ponderhit'.

9 years agoUpdate README file
H.G.Muller [Tue, 28 Oct 2014 08:22:20 +0000]
Update README file

9 years agoSuppress isready for first ping
H.G.Muller [Tue, 28 Oct 2014 08:08:54 +0000]
Suppress isready for first ping

The first ping sent by the XBoard should not probe the engine with
the isready/readyok dialog, but be answered with 'pong' immediately,
as the 'uciok' already issued an 'isready'.

9 years agoRemove possible deadlock
H.G.Muller [Tue, 28 Oct 2014 07:44:34 +0000]
Remove possible deadlock

Add some flush() calls to make sure we are not waiting for a
response to something we still have buffered.

9 years agoImplement UCCI draw offers
H.G.Muller [Mon, 27 Oct 2014 23:21:20 +0000]
Implement UCCI draw offers

The XBoard "offer draw" command is recognized, and leads to sending of
a 'draw' keyword with the 'go'. The other way a 'draw' in 'bestmove'
will lead to sending of an "offer draw" command.

9 years agoImplement the UCCI usemillisec option
H.G.Muller [Mon, 27 Oct 2014 23:12:50 +0000]
Implement the UCCI usemillisec option

This option is set (and msec are used) when the engine announced it
with default value 'false'.

9 years agoImplement UCCI newgame option
H.G.Muller [Mon, 27 Oct 2014 23:09:52 +0000]
Implement UCCI newgame option

In UCCI 'newgame' is an engine-defined option, which should only be sent
when the engine has announced it.

9 years agoImplement UCCI
H.G.Muller [Mon, 27 Oct 2014 22:59:02 +0000]
Implement UCCI

The main framework of UCCI now works, and is activated by the option -x :
We send 'ucci' and expect 'ucciok', the alternative keywords for timing
are used (time and opptime, increment and oppincrement), and 'name'
and 'value' are suppressed when setting options. 'name' is also not
mandatory anymore in the received 'option' commands. The position-moves
command starts with the FEN for after the latest capture, and now
has the 'position' keyword that was missing in Cyclone UCI.

9 years agoPrint UCI keywords from variable, so they can be easily changed
H.G.Muller [Mon, 27 Oct 2014 22:43:11 +0000]
Print UCI keywords from variable, so they can be easily changed

The keyword wtime, btime, winc, binc, name, and value are all defined
as variable, to facilitate implementing UCCI, which uses different
words for these.

9 years agoCompactify timing code by figuring out who is black first
H.G.Muller [Mon, 27 Oct 2014 22:35:31 +0000]
Compactify timing code by figuring out who is black first

A new variable 'black' is set when the engine plays black, to know
if the XBoard 'time' setting should be transmitted as 'wtim' or 'btim'.

9 years agoPrint 'ponder' always immediately behind 'go'
H.G.Muller [Mon, 27 Oct 2014 22:32:11 +0000]
Print 'ponder' always immediately behind 'go'

Some engines do not like it if you print it otherwise.

9 years agoAdd infrastructure for keeping track of board position
H.G.Muller [Mon, 27 Oct 2014 22:23:00 +0000]
Add infrastructure for keeping track of board position

A Xiangqi board is added, with code to set it up from a FEN, convert it
to the board part of a FEN, and apply the moves from the move list to it,
keeping track of what was the last capture. The FEN for setting it up
is always taken from the "fen <FEN>" position command ('iniPos') of the
Cyclone dialect used in variant xiangqi.

9 years agoCreate infrastructure for accounting time in other units
H.G.Muller [Mon, 27 Oct 2014 22:07:39 +0000]
Create infrastructure for accounting time in other units

A variable 'unit', initialized to 1, indicates how many msec a unit is.

9 years agoFix extracting side-to-move from setboard command
H.G.Muller [Mon, 27 Oct 2014 22:46:39 +0000]
Fix extracting side-to-move from setboard command

When white was to move, the stm was just keeping its previous value,
which could very well have been BLACK.

11 years agoConnect WB cores command to UCI option Threads
H.G. Muller [Thu, 20 Dec 2012 14:00:57 +0000]
Connect WB cores command to UCI option Threads

11 years agoImplement Ponder option
H.G. Muller [Sun, 16 Dec 2012 08:42:12 +0000]
Implement Ponder option

UCI2WB now makes the possibility to ponder subject to the engine reporting
the Ponder option, and sets this option according to the WB  ponder state.

11 years agoAllow faking of options the engine fails to announce
H.G. Muller [Wed, 12 Dec 2012 16:52:21 +0000]
Allow faking of options the engine fails to announce

A file DefectiveEngineOptions.ini will be read as if it is engine output
before any real engine output. This can be used to fake UCI 'option' commands
that the engine fails to announce, so that they will appear in the GUI's
Engine Settings dialog, and can be changed by user or GUI.

11 years agoFix pause in ponder-off games
H.G. Muller [Sun, 9 Dec 2012 17:50:41 +0000]
Fix pause in ponder-off games

11 years agoFix ponder start
H.G. Muller [Wed, 5 Dec 2012 15:57:19 +0000]
Fix ponder start

There was an inconsistency in starting ponder searches, because they occur
with the opposite side-to-move, or thus exchange wtime and btime. This was
solved in the old version by changing stm only after starting the ponder
search in response to an engine move. But for starting through 'hard'
there is no turn change. So the start routine has to swap the times by
itself, and the turn change was moved to before it to compensate.

11 years agoRespond immediately to ponder on/off commands
H.G. Muller [Wed, 5 Dec 2012 11:05:59 +0000]
Respond immediately to ponder on/off commands

Rather than just setting the flag that causes a ponder search to start
after the engine moves, we start the search on receiving the 'hard' command.
When a ponder search is in progress, it is stopped on receiving 'easy'.
This requires saving a ponder move even with ponder off, (because it might
be switched on later), and more strict clearing of the move beyond the last
one, toprevent it can be accidentally used as ponder move (e.g. after undo).

11 years agoImplement pause / resume commands
H.G. Muller [Tue, 4 Dec 2012 22:37:53 +0000]
Implement pause / resume commands

11 years agoFix bug in converting Shogi moves
H.G. Muller [Wed, 9 May 2012 19:05:34 +0000]
Fix bug in converting Shogi moves

The patch that put the move conversion in separate routines broke UCI2WB
for Shogi, because it still tested for LF to recognize non-promotions,
while the move now was null-terminated.

12 years agoBump version number to 1.9
H.G. Muller [Thu, 19 Apr 2012 21:01:55 +0000]
Bump version number to 1.9

12 years agoUpdate README file
H.G. Muller [Thu, 19 Apr 2012 21:01:22 +0000]
Update README file

12 years agoRemove S-Chess gating-move translation
H.G. Muller [Thu, 19 Apr 2012 20:59:53 +0000]
Remove S-Chess gating-move translation

This is no longer needed, since the UCI S-Chess engine now uses the same
gating-move notation as WinBoard protocol.

12 years agoWarn user when all moves have been collected
H.G. Muller [Thu, 19 Apr 2012 20:43:11 +0000]
Warn user when all moves have been collected

A line 'OK to exclude' is printed disguised as Thinking-Output, to inform
the user that he can start using the exclude command.

12 years agoImplement WB exclude feature
H.G. Muller [Thu, 19 Apr 2012 19:18:28 +0000]
Implement WB exclude feature

UCI2WB collects moves sent by the engne in analysis mode from the currmove,
currmovenumber info commands. After the full set for the current position
has been completed, UCI2Wb becomes sensitive for WB include and exclude
commands, to switch the moves in the list on or off. If not all moves
are on, the 'go infinite' will be accompanied by 'searchmoves'. If all
moves are off, the current search is allowed to continue.

12 years agoBump version number to 1.8
H.G. Muller [Thu, 19 Apr 2012 20:51:26 +0000]
Bump version number to 1.8

12 years agoWait for uciok before handling GUI input
H.G. Muller [Tue, 17 Apr 2012 18:09:56 +0000]
Wait for uciok before handling GUI input

WinBoard does not apply a feature timeout when restarting an engine that
had reuse=0, but immediately starts sending commands. This caused the
memory command to be ignored, because it arrived when UCI2WB had not seen
the engine's Hash option yet. Now UCI2WB stalls processing GUI commands
after receiving 'protover' until it sees 'uciok' from the engine.

12 years agoMake translation of FEN with holdings also handle S-Chess
H.G. Muller [Tue, 17 Apr 2012 18:05:20 +0000]
Make translation of FEN with holdings also handle S-Chess

Like in Shogi FEN, UCI S-Chess engines have the holdings not immediately
behind the board, but before the move counters. Since Shogi FENs are
missing a few fields in this area (castling, e.p. and 50-move), some
recoding was necessary to make this work.

12 years agoPut move translation in separate routines
H.G. Muller [Tue, 17 Apr 2012 18:00:29 +0000]
Put move translation in separate routines

12 years agoTranslate S-Chess gating moves
H.G. Muller [Tue, 17 Apr 2012 05:44:50 +0000]
Translate S-Chess gating moves

The only existing UCI S-Chess engine requires the gating square to be
repeated after the gating piece suffix. Also gating-at-Rook castlings
have a different format: they mention the King move. UCI2WB now handles
these move translations.

12 years agoUpdate README file
H.G. Muller [Tue, 17 Apr 2012 06:56:39 +0000]
Update README file

Add description of the debug and -var options.

12 years agoMake supported variants run-time configurable
H.G. Muller [Tue, 17 Apr 2012 05:36:21 +0000]
Make supported variants run-time configurable

A new command-line argument "-var XXX" is accepted to set the variant
list reprted at startup to variants="XXX". It has to go between "debug"
and the engine name.

12 years agoUse 30msec margin in st->movetime translation
H.G. Muller [Tue, 17 Apr 2012 05:31:24 +0000]
Use 30msec margin in st->movetime translation

Because of the different definition of the time mentioned in the WB st
and UCI movetime (max time vs exact time), a margin is needed to not make
the engine forfeit on time.

num

12 years agoAlways pass info string with timing info
H.G. Muller [Sun, 12 Feb 2012 21:53:35 +0000]
Always pass info string with timing info

Even with nopost a sting starting with "info string times @" will be passed
to the GUI as debug output.

12 years agoFix some spurious output
H.G. Muller [Sun, 12 Feb 2012 21:47:44 +0000]
Fix some spurious output

Not all debug prints towards the GUI were controlled through the
"UCI2WB debug output" option. This is now repaired. The method for
matching an info string is made a bit more efficient, by only looking
at the beginning.

12 years agoBump version number to 1.6
H.G. Muller [Sat, 14 Jan 2012 13:05:12 +0000]
Bump version number to 1.6

Also update changelog in README file.

12 years agoFix engine names with spaces
H.G. Muller [Sat, 14 Jan 2012 12:53:08 +0000]
Fix engine names with spaces

Only the first word in the "id name" command was recognized by scanf.

12 years agoMake debug output optional
H.G. Muller [Sat, 14 Jan 2012 12:46:45 +0000]
Make debug output optional

The debug output sent by UCI2WB to the GUI is made subject to an option
"UCI2WB debug output", which by default is set to false. A command-line
argument "debug" can set it to true from the beginning, so that you will
also be able to see the option handshaking.

12 years agoEliminate polling in Windows
H.G. Muller [Sat, 14 Jan 2012 12:13:20 +0000]
Eliminate polling in Windows

Also use pipe-based synchronization here.

12 years agoImplement ping
H.G. Muller [Sat, 14 Jan 2012 11:14:57 +0000]
Implement ping

Use readyok / isready to really ping the engine before acknowledging the GUI.

12 years agoEliminate polling in Linux
H.G. Muller [Sat, 14 Jan 2012 10:56:13 +0000]
Eliminate polling in Linux

The sleep-spaced polling for readyok or bestmove has now been replaced
by pipe-based blocking of the waiting thread, waking it up by writing
a character into the pipe.

13 years agoCheck in Windows icon
H.G. Muller [Fri, 15 Oct 2010 09:16:45 +0000]
Check in Windows icon

13 years agoCheckin README
H.G. Muller [Fri, 15 Oct 2010 09:15:25 +0000]
Checkin README

13 years agoPort UCI2WB to Linux
H.G. Muller [Thu, 14 Oct 2010 19:58:39 +0000]
Port UCI2WB to Linux

If WIN32 is not defined, POSIX calls are used to create the engine
thread, pipes and engine process, and an own implemntation of
GetTickCount() is suppled.

13 years agoCheck in UCI2WB source
H.G. Muller [Thu, 14 Oct 2010 17:12:03 +0000]
Check in UCI2WB source