Winboard 2 state diagram

Code, algorithms, languages, construction...
Post Reply
thevinenator
Posts: 68
Joined: Tue Jun 02, 2015 11:02 pm
Real Name: Vince

Winboard 2 state diagram

Post by thevinenator » Wed Aug 26, 2015 2:26 pm

Can someone provide a link to a web page or document that has a state diagram for the Winboard 2 protocol?

I tried a google search but all the hits seem to be dead pages.
"An Engine's strength flows from the Search. But beware, pruning, extensions, reductions; the dark side of the Search are they. Once you start down the dark path, it will dominate and consume you, as it has to so many developers before.” -- Yoda

Lasse Hansen
Posts: 6
Joined: Mon Aug 19, 2013 7:32 pm
Real Name: Lasse Hansen

Re: Winboard 2 state diagram

Post by Lasse Hansen » Wed Aug 26, 2015 8:13 pm

I dont know about state diagram but this link tells pretty much about the winboard protocol 2.

http://www.gnu.org/software/xboard/engine-intf.html

H.G.Muller
Posts: 190
Joined: Sun Jul 14, 2013 10:00 am
Real Name: H.G. Muller

Re: Winboard 2 state diagram

Post by H.G.Muller » Wed Oct 07, 2015 11:16 am

I never found a state diagram for WB protocol very helpful. This is because there basically is a combination of independent states (side to move, ponder on/off, side played by the engine) which would have to be multiplied to represent it as a single state machine.

The easiest way to understand the protocol is to define a variable engineSide that indicates what the engine is supposed to be doing:

(play) white, black, none or analyze

A second state variable is the side to move, which is part of the game state. (It can be white or black.)

Then an engine should be able to engage in three activities: search until it is time to move ('thinking'), search until you receive input ('pondering/analyzing'), or do nothing waiting for input. When engineSide equals side to move, the engine should think. When engineSide is analyze, the engine should analyze. When engineSide is the side not to move, and pondering is enabled, the engine should ponder. In all other cases the engine should just wait for input.

Code: Select all

engine- |  side to move
side    | white     black
--------+-------------------
none    |   -         -
white   | think     ponder*
black   | ponder*   think
analyse | analyse   analyse

*only if pondering enabled
Note that pondering is basically the same activity as analyzing: the engine searches indefinitely while monitoring input. Pondering, however, can be implemented by not searching the current position, but speculatively performing an opponent move, and searching the resulting position. In that case it is possible to transit directly from ponder to think mode, when the input you receive is that speculatively executed move ('ponder hit'). On any other move you would have to abort the ponder search, and take the speculatively executed move back. When analysing, or when you implemented pondering as analyzing the position with the opponnet to move, just to fill the hash table, you would have to abort the search on any input.

H.G.Muller
Posts: 190
Joined: Sun Jul 14, 2013 10:00 am
Real Name: H.G. Muller

Re: Winboard 2 state diagram

Post by H.G.Muller » Wed Oct 07, 2015 11:39 am

'go' causes a vertical transition from to 'think' in the same column, 'force' a vertical transition '-'. (Except that for reasons unclear to me the transition from analyze to '-' use the command 'exit' instead of 'force'.) Moves (either as input or done as a result of think) cause horizontal transitions. The obsolete commands 'white' and 'black' cause transitions to the 'ponder' state in the column they indicate, irrespective of the previous state. 'playother' causes a transition to the 'ponder' state in the other column.

Post Reply