ScidVsPC/Mac

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: ScidVsPC/Mac

Post by JuLieN »

stevenaaus wrote:
JuLieN wrote:Indeed. Although why wouldn't you guys join forces and make a SCIDBoard? I have the feeling that both programs have quite some overlap and that you duplicate each others' efforts...
Now that is crazy talk :roll: :P

The tourney widget will now pack smaller. If > 10 engines selected, only the first 10 are changeable.

Code: Select all

# Only pack so many
if {$i < 10} { 
Pondering shouldn't be too hard. ....... Except i can't figure out the UCI protocol properly.

Code: Select all

Engine 1 says "bestmove MOVEA ponder MOVEB"
send MOVEA to Engine 2
Engine 2 plays MOVEB
send "ponderhit" to Engine 1
But then it grinds to a halt :x
I can't figure out how to continue there-after or when to issue "go ponder". Does this replace the "go" command, or do i have to issue a whole set of "go" AND "go ponder" for one move ? Ponderhit *is* used in the serious game feature , and i'll have to examine it closer i guess though it is implement with "position fen" here instead of "position startboard moves".
It's great you give it a try, Steven, thanks! :)

IIRC, the typical interface<>engines talk should look like ( with: 1: Engine 1, 2: Engine 2, I: Interface):

1>I: bestmove A ponder B
I>1: go ponder
I>2: (send move A and a go command)
2>I: bestmove B ponder C
I>2: go ponder
I>1: ponderhit
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
User avatar
hgm
Posts: 28505
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: ScidVsPC/Mac

Post by hgm »

The problem could be that you forget to send wtime, btime and movestogo info together with the "go ponder". All "ponderhit" does is retro-actively take away the "ponder" qualification from the currently running "go" command, so you have to make sure that that "go" is fully specified.
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: ScidVsPC/Mac

Post by JuLieN »

I was wondering how the engine would know how long it can keep searching when it receives a "ponderhit" notification, and Mark Uniacke gives the answer on Hiarcs Forum:
Mark Uniacke wrote:
Alain wrote:Hi,

I am trying to implement pondering in CEBoard when hosting UCI engines and I don't understand which dialog must take place :

let's say that I send to the engine

Code: Select all

position startpos moves e2e4
go movetime 1000
The engine answers after some time:

Code: Select all

bestmove g8f6 ponder b1c3
I understand that it does not start pondering immediately, even if I set the "Ponder" option to true, is it correct ?

Which message should I send to make the engine start pondering ?
is it these commands ?

Code: Select all

position startpos moves e2e4 g8f6
go ponder b1c3
And how can I stop the engine's reflection ? If I send "ponderhit" to the engines I have tested, none stops thinking....

Thanks in advance
Best regards,
Alain
Yes that is correct, no pondering is started until it is requested.

So you would give:
position startpos moves e2e4 g8f6 b1c3
go wtime 50000 btime 50000 ponder

then if ponder move (b1c3 in this case) is played by opponent you output
ponderhit

engine now switches to normal play mode and plays move when its ready.

If you did not specify a time when you told it to ponder that would explain why the engine did not move.
That should answer your question more accurately than I did. :)
Last edited by JuLieN on Sat Mar 10, 2012 8:12 am, edited 1 time in total.
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: ScidVsPC/Mac

Post by JuLieN »

hgm wrote:The problem could be that you forget to send wtime, btime and movestogo info together with the "go ponder". All "ponderhit" does is retro-actively take away the "ponder" qualification from the currently running "go" command, so you have to make sure that that "go" is fully specified.
Correct. :) We posted in the same time and funnily enough Mark's post on HF addressed exactly that question.
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
stevenaaus
Posts: 615
Joined: Wed Oct 13, 2010 9:44 am
Location: Australia

Re: ScidVsPC/Mac

Post by stevenaaus »

hgm wrote: All "ponderhit" does is retro-actively take away the "ponder" qualification from the currently running "go" command, so you have to make sure that that "go" is fully specified.
That helped a lot.

Making good progress, but after 5 moves or so i'm getting two bestmoves, which breaks things.
If EngineB doesn't make a predicted move.
Instead of ponderhit i have to send
> stop
and
> position startpos moves $moves
to Engine A.
So do i have to discard the next bestmove received from EngineA ?

Should it be
> go wtime 57711 btime 54666 winc 0 binc 0 ponder
> go ponder wtime 57711 btime 54666 winc 0 binc 0
> go ponder $move wtime 57711 btime 54666 winc 0 binc 0
User avatar
hgm
Posts: 28505
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: ScidVsPC/Mac

Post by hgm »

Indeed. A UCI engine will ALWAYS send "bestmove" to indicate it stopped searching. So "stop" is really "move now".

So you should keep track of how many "go" you have sent, and ignore "bestmove" untill there is only a single "go" pending, because that will be the "bestmove" corresponding to the last search you started.

Note that there are crummy engines, which cannot stand if you load a new position or start a search before they have sent "bestmove". These engines need the "syncstop" work-around of Polyglot, which makes it wait for "bestmove" after sending "stop" before continuing.
stevenaaus
Posts: 615
Joined: Wed Oct 13, 2010 9:44 am
Location: Australia

Re: ScidVsPC/Mac

Post by stevenaaus »

hgm wrote:Indeed. A UCI engine will ALWAYS send "bestmove" to indicate it stopped searching. So "stop" is really "move now".

So you should keep track of how many "go" you have sent, and ignore "bestmove" untill there is only a single "go" pending, because that will be the "bestmove" corresponding to the last search you started.

Note that there are crummy engines, which cannot stand if you load a new position or start a search before they have sent "bestmove". These engines need the "syncstop" work-around of Polyglot, which makes it wait for "bestmove" after sending "stop" before continuing.

Now it works :) but with an occasional game hang. So i'll commit this.

I tried doing a "wait after stop" (to discard a bestmove) before issuing new position/go - but it seemed to cause time issue.

But now, all i'm doing is discarding a single bestmove if stop is issued... but i guess i'll have to do a counter like you suggest.
Strelka 5 doesnt work, and Stockfish 2.1 loses on time in 10 sec+0 games.
Are short timed games (<= 10sec) normally done with or without ponder ?

And i notice engines send a ponder even if the option is disabled

Code: Select all

Scid  : setoption name Ponder value false
Scid  : isready
Engine: readyok
Scid  : position startpos
Scid  : go wtime 10200 btime 10200 winc 0 binc 0
....
Engine: bestmove e2e4 ponder e7e5

BTW - for xboard, all i'm doing is issuing "easy" and "hard" but i suppose there is more to it than this ?
stevenaaus
Posts: 615
Joined: Wed Oct 13, 2010 9:44 am
Location: Australia

Re: ScidVsPC/Mac

Post by stevenaaus »

Ahh - the problem with Strelka 5 is it is issuing bestmove for a ponder *before* i say stop. So a +/- counter should fix this.
Damm it - that makes things tricky, cos in this example it is actually a ponderhit, but because of the out of order commands, it gets nticed as a miss

Engine: bestmove g1f3 ponder f6d5
Scid : position startpos moves e2e4 d7d5 e4d5 g8f6 g1f3 f6d5
Scid : go ponder wtime 56421 btime 59750 winc 0 binc 0
Engine: info depth 2
Engine: info depth 3
Engine: info depth 4
Engine: info depth 5
Engine: info depth 6
Engine: info depth 7
Engine: info depth 8
Engine: info depth 9
Engine: info depth 10
Engine: info depth 10 score cp 106 time 1 nodes 0 nps 1985 pv (null)
Engine: info depth 11
Engine: info depth 11 score cp 101 time 1 nodes 0 nps 2391 pv (null)
Engine: info depth 12
Engine: info depth 12 score cp 111 time 11 nodes 0 nps 11394 pv (null)
Engine: info depth 13
Engine: info depth 13 score cp 117 time 333 nodes 0 nps 291869 pv (null)
Engine: info depth 14
Engine: info depth 14 score cp 120 time 810 nodes 0 nps 704650 pv (null)
Engine: info depth 14 score cp 120 time 851 nodes 0 nps 739667 pv (null)
Engine: bestmove d2d4 ponder e7e6
Scid : stop
Scid : position startpos moves e2e4 d7d5 e4d5 g8f6 g1f3 f6d5
Scid : go wtime 56421 btime 58806 winc 0 binc 0
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: ScidVsPC/Mac

Post by Michel »

Ahh - the problem with Strelka 5 is it is issuing bestmove for a ponder *before* i say stop. So a +/- counter should fix this.
Isn't that a protocol violation? An engine is not supposed to spontaneously send a move when it is pondering...
User avatar
hgm
Posts: 28505
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: ScidVsPC/Mac

Post by hgm »

Indeed. This is a (pretty bad) protocol violation, so don't bother about it.
stevenaaus wrote:BTW - for xboard, all i'm doing is issuing "easy" and "hard" but i suppose there is more to it than this ?
No, that is all. That you have to say 'hard' to make it ponder does not mean that it is hard to make it ponder, if you get what I mean. :lol: