Wb engines and adapter

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Wb engines and adapter

Postby Werner Schüle » 14 Feb 2009, 14:45

I have following question:
Does this adapter reset the engine after each move (see listing) ?
Does this command reset a wb engine: C> position startpos moves h2h3 e7e5 e2e4 b8c6 b1c3
(is this command similar to a new command?)

When I make the same moves inside Arena with this wb engine I cannot see such a startpos command in the F4 Window.

best
Werner

0.000: ** Adapter: Wb2Uci 1.3B6
0.000: C> uci
0.000: C< id name Thinker54AInert-SP64-UCI
0.000: C< id author Lance Perkins, Kerwin Medina
0.000: C< option name Program type string default "ThinkerWB.exe" hashsize=9
0.000: C< option name InitString type string default <empty>
0.000: C< option name Hash type spin default 2 min 0 max 256
0.000: C< option name HashCommand type string default <empty>
0.000: C< option name HashOnCommandline type check default false
0.000: C< option name InitTime type spin default 2 min 0 max 30
0.000: C< option name Delay type spin default 0 min 0 max 1000
0.000: C< option name Edit type combo default setboard var setboard var edit var cb-edit
0.000: C< option name Ponder type check default false
0.000: C< option name OwnBook type check default false
0.000: C< option name ShowThinkingMove type check default false
0.000: C< option name Analyze type check default true
0.000: C< option name UseUndo type check default true
0.000: C< option name WhiteScore type check default false
0.000: C< option name Logfile type check default true
0.000: C< option name Priority type combo default Normal var Normal var BelowNormal var Low
0.000: C< option name RunIdle type check default false
0.000: C< option name Computer type check default false
0.000: C< option name SimulateHint type check default false
0.000: C< option name LevelExtend type combo default Progressive var Progressive var Strict var Failsafe
0.000: C< option name Protocol type spin default 2 min 1 max 2
0.000: C< option name Noise type spin default 0 min -1 max 99
0.000: C< option name Help type button
0.000: C< uciok
0.062: C> setoption name Hash value 256
0.062: C> isready
0.062: S- Starting server: "ThinkerWB.exe" hashsize=9
0.062: S< xboard
protover 2
0.156: S> Thinker: 5.4A (NAM 035, 1500, for 64-bit architecture) Copyright (c) Kerwin Medina
0.156: S> Thinker: uie pid sco lme ueh uml
0.156: S> Thinker: Freeware. No warranties whatsoever.
0.359: S> feature setboard=1
0.359: S< accepted setboard
0.359: S> feature done=1
0.359: S< accepted done
2.062: S< new
level 0 5 0
2.062: S< post
2.062: S< hard
easy
2.062: C< readyok
21.953: C> position startpos moves h2h3
21.953: C> go movestogo 40 btime 900000 wtime 900000
21.953: C< info depth 1 score 1
21.953: S< force
21.953: S< new
21.953: S< post
21.953: S< hard
easy
21.953: S< force
21.953: S< level 40 15 0
21.953: S< h2h3
21.953: S< time 90000
21.953: S< otim 90000
21.953: S< black
21.953: S< go
46.750: S> move e7e5
46.750: C< bestmove e7e5
46.750: S> 17 -16 2015 20275870 e7e5 b1c3 d7d5
54.797: C> position startpos moves h2h3 e7e5 e2e4
54.797: C> go movestogo 39 btime 875000 wtime 900000
54.797: C< info depth 1 score 1
54.797: S< time 87500
54.797: S< otim 90000
54.797: S< e2e4
73.328: S> move b8c6
73.328: C< bestmove b8c6
73.328: S> 17 -8 1048 10795970 b8c6 g1f3 g8f6
79.172: C> position startpos moves h2h3 e7e5 e2e4 b8c6 b1c3
79.172: C> go movestogo 38 btime 856000 wtime 892000
79.172: C< info depth 1 score 1
79.172: S< time 85600
79.172: S< otim 89200
79.172: S< b1c3
106.203: S> move f8c5
106.203: C< bestmove f8c5
106.219: S> 17 -28 1478 14809261 f8c5 g1f3 g8f6
626.094: C> quit
626.094: S< quit
Werner Schüle
 
Posts: 832
Joined: 28 Jun 2006, 21:39

Re: Wb engines and adapter

Postby H.G.Muller » 16 Feb 2009, 18:36

Werner Schüle wrote:I have following question:
Does this adapter reset the engine after each move (see listing) ?
Does this command reset a wb engine: C> position startpos moves h2h3 e7e5 e2e4 b8c6 b1c3
(is this command similar to a new command?)

When I make the same moves inside Arena with this wb engine I cannot see such a startpos command in the F4 Window.


This command is not send to the WB engine. In the listing you quoted C> means ' coming from Client' (to adapter). The Client is the GUI, the engine is the Server. So the adapter translates the command into the 3 lines

time 85600
otim 89200
b1c3

(S< in front of it means ' sent to Server')

This does not reset the WB engine; it only sends it the times left on both clocks, and the move played.

So it is the UCI GUI that restets the engine before every move, but engines are allowed to be smart, and recognize that the first N-1 moves are what they already have played, an just continue from there.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Wb engines and adapter

Postby Werner Schüle » 16 Feb 2009, 19:14

Thanks,
so I hope Thinker engine is smart :)

Werner
Werner Schüle
 
Posts: 832
Joined: 28 Jun 2006, 21:39

Re: Wb engines and adapter

Postby Teemu Pudas » 16 Feb 2009, 19:16

H.G.Muller wrote:So it is the UCI GUI that restets the engine before every move,
No, it doesn't do that. The engine knows all the searches are in the same game because the GUI hasn't sent ucinewgame.
Werner Schüle wrote:so I hope Thinker engine is smart :)
Hope isn't needed: the adapter is smart. :D
Teemu Pudas
 
Posts: 124
Joined: 16 Apr 2007, 14:03

Re: Wb engines and adapter

Postby H.G.Muller » 17 Feb 2009, 11:27

So what is supposed to happen if the GUI sends a different move sequence, (say because the user took back a few moves, and played others)? Or should that cont as a new game?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Wb engines and adapter

Postby Teemu Pudas » 19 Feb 2009, 20:33

H.G.Muller wrote:So what is supposed to happen if the GUI sends a different move sequence, (say because the user took back a few moves, and played others)? Or should that cont as a new game?

Still the same game.

Why would the engine care whether the new position is from the same game in analysis, though? Hash aging?
Teemu Pudas
 
Posts: 124
Joined: 16 Apr 2007, 14:03

Re: Wb engines and adapter

Postby H.G.Muller » 20 Feb 2009, 11:30

I can not imagine that either. Taking moves back within the same game would also upset the hash aging. Of all my engines only Fairy-Max clears the hash table, and only when it switches to a new variant. (This proved quite essential. :wink: ) I guess this is really buggy when setting up a position, as I don't make an effort calculating the new hash key (which normally is only upated differentially, starting from an fixed arbitrary value for the opening position).

But if the given move sequence can be an entirely different one, because of moves taken back in combination with a GUI book, and still count as "the same game", I wonder if one can say that the engine need not be reset.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Wb engines and adapter

Postby Werner Schüle » 20 Feb 2009, 19:30

Here is a sample logfile under winboard (winboard.debug):

22750 >first : time 60000
22750 >first : otim 60000
22750 >first : e2e4
36812 <first : move e7e5
36953 <first : 16 -16 1164 12690125 e7e5 b1c3 g8f6
Interrupting first
39125 >first : time 58589
39125 >first : otim 59771
39125 >first : h2h3
64859 <first : move g8f6
65000 <first : 17 6 2170 23186668 g8f6 b1c3 b8c6
Interrupting first
88937 >first : time 56015
88937 >first : otim 57364
88937 >first : d2d3
106797 <first : move f8e7
106906 <first : 16 27 1087 12140892 f8e7 b1c3 b8c6
GameEnds(0, (null), 2)
Interrupting first
141968 >first : force
141968 >first : quit

it looks quite different!

Werner
Werner Schüle
 
Posts: 832
Joined: 28 Jun 2006, 21:39

Re: Wb engines and adapter

Postby H.G.Muller » 22 Feb 2009, 09:31

When you delete all C< and C> lines from your first log file, you will see that they actually look very much alike.

The point is that your first log file is actually two interleaved logs: one (the C> and C< lines) logging the UCI communication between GUI and adapter, the other (S> and S< lines) logging the WB-protocol communication between adapter an engine.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Wb engines and adapter

Postby Werner Schüle » 22 Feb 2009, 09:54

Thank you very much!

Now I understand it :D

best

Werner
Werner Schüle
 
Posts: 832
Joined: 28 Jun 2006, 21:39


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 4 guests