Moderator: Andres Valverde
I can sent you the xboard2uci.c of Polyglot 1.4.38x if you want. But it is twelve steppings behind your most recent one. Fortunately the patch is very localized.
Example
Suppose we play 2 moves in 2 seconds (repeated) (i.e. level 2 0:2 0) . The engine's intrinsic nps is 100000 but we set nps=1000.
To start the engine gets 2 second from the GUI (time=200). So it computes that it has 2/2=1 second for this move.
It searches 1000 nodes and returns after 0.01 second.
For the second move the engine gets now 1.99 seconds (time=199) from the GUI. So it now searches another 1990 nodes.
So in total it has searched 2990 nodes instead of 2000 as was the intention.
engine_send_queue(Engine,"go");
if (XB->time_limit) {
// fixed time per move
if(node_rate > 0)
engine_send_queue(Engine," nodes %.0f",XB->time_max*(double)node_rate);
else
engine_send_queue(Engine," movetime %.0f",XB->time_max*1000.0);
} else {
// time controls
if(node_rate > 0) {
double time;
move_nb = 40;
if (XB->mps != 0) move_nb = XB->mps - (Uci->board->move_nb % XB->mps);
time = XB->my_time / move_nb;
if(XB->inc != 0) time += XB->inc;
if(time > XB->my_time) time = XB->my_time;
engine_send_queue(Engine," nodes %.0f",time*node_rate);
} else {
if (colour_is_white(Uci->board->turn)) {
engine_send_queue(Engine," wtime %.0f btime %.0f",XB->my_time*1000.0,XB->opp_time*1000.0);
} else {
engine_send_queue(Engine," wtime %.0f btime %.0f",XB->opp_time*1000.0,XB->my_time*1000.0);
}
if (XB->inc != 0.0) engine_send_queue(Engine," winc %.0f binc %.0f",XB->inc*1000.0,XB->inc*1000.0);
if (XB->mps != 0) {
move_nb = XB->mps - (Uci->board->move_nb % XB->mps);
ASSERT(move_nb>=1&&move_nb<=XB->mps);
engine_send_queue(Engine," movestogo %d",move_nb);
}
}
}
if (XB->depth_limit) engine_send_queue(Engine," depth %d",XB->depth_max);
gui_send(GUI,"feature usermove=1");
gui_send(GUI,"feature nps=1");
if (XB->has_feature_memory){
// constants
static const bool UseDebug = FALSE;
static const bool DelayPong = FALSE;
int node_rate = -1;
} else if (match(string,"nps *")) {
// fake WB play-by-nodes mode
node_rate = atoi(Star[0]);
} else if (match(string,"playother")) {
XB->new_hack = TRUE;
XB->result = FALSE;
XB->depth_limit = FALSE;
node_rate = -1;
No, the engine should use the WB time command. I should just use the given nps factor to convert it to the number of nodes left on its "clock".
Can you please explain what's wrong with my example.... That would presumably make things clear for me.
Example
Suppose we play 2 moves in 2 seconds (repeated) (i.e. level 2 0:2 0) . The engine's nps is 100000 and we set nps=1000.
To start the engine gets 2 second from the GUI (time=200). So it computes that it has 2/2=1 second for this move.
It searches 1000 nodes and returns after 0.01 second.
For the second move the engine gets now 1.99 seconds (time=199) from the GUI. So it now searches another 1990 nodes.
So in total it has searched 2990 nodes instead of 2000 as was the intention.
The point is that the GUI also knows that it should pass virtual time to the engine, in stead of real time. If it reports having searched 999 nodes in its Thinking Output, and WB knows that it is playing at nps 1000, it decrements that engine's clock by 999/1000 = 1 sec. So on the next move it will send time 100, and not time 199.
Michel wrote:The nps command requires WB to have unlimited trust in the engine.... I would like to see a match between Crafty and Rybka at 80knps
I guess I should mention something about using the reported nodes for decrementing the clock. I guess I left that out because it is not really a protocol matter how the GUI implemets this, but it is important to stress that the engine shuould report the same number of nodes in its thinking output as on what it based its timing decisions.
matematiko wrote:Please ignore this post and continue on, I just want to let you guys know that is very fascinating seeing you talking, sharing ideas and suggestions in a language (even thou is in english) that is well above my understanding. Undoubtely, you guys had made the polyglot-winboard (in alphabetical order) partnership a better experience. Keep up the good team work.
Regards,
Return to Winboard and related Topics
Users browsing this forum: No registered users and 30 guests