by Anonymous » 09 Feb 2005, 09:22
Hi Stefan,
after Tord's answer, I looked myself in the source of Polyglot. It indeed seems not too difficult, but of course more effort than in Tord's answer. While I suggested on the phone to change polyglot, to fit CCT requirements, after rethinking, the bette place to change would be Winboard/Xboard GUIs. Not only UCI engines would benefit, but also any (new) WB engine. Why should any engine author code almost the same kibitz/whisper stuff. And possibly various options inside the engine, to stop kibitzing/whispering, etc. This belongs to the GUI, really.
My suggestions for the changes to Polyglot adapter.cpp outlined (I don't understand most of the Polyglot code - so be aware).
Add some defines at the top.
#define GOT_PV 1
#define GOT_TIME 2
#define GOT_NODES 4
#define GOT_PONDERMOVE 8
etc., for all the interesting things, that you want to kibitz.
Define some module static vars,
static char last_pv[LASTPVSIZE];
etc. For all the interesting stuff.
and
static unsigned int got_flags = 0;
In function parse_info, in the strcmp ladder, make a copy of all these things. Something like
} else if (strcmp(option,"pv") == 0) {
ASSERT(!my_string_empty(argument));
line_from_can(PV,argument,LineSize);
pv = true;
strncpy(last_pv, argument, LASTPVSIZE); // added for kib support
last_pv[LASTPVSIZE-1] = '\0'; // added
got_flags |= GOT_PV; // added
} else if (strcmp(option,"refutation") == 0) {
and for the other things you want to kibitz later. Than at the location Tord pointed out, construct and send the tellall string with these new static vars, just after sending the move and send it. Then clear got_flags. Stefan, if you want to do the changes, I have cygwin installed and can compile it.
Perhaps little less work and more general would be, to do some additional parsing of "info string". The parser could recognize things like "info string tellics kibitz some stuff" or "info string tellall other stuff" and pass it on to WB. I guess this would take Fabien not more than 5 minutes to implement.
Fabien, under which environement are you starting with Fruit at CCT7? How do you handle the kibitz requirements?
Regards,
Dieter