At the moment I'm quite far with regard to implementing the CECP-protocol for Rustic. Only a few things remain. I've implemented thinking output (and reacting to the "." command), and this works fine; but it seems I can't get the extended version to work.
The specs:
http://hgm.nubati.net/CECP.html
https://www.gnu.org/software/xboard/engine-intf.html
Code: Select all
DEPTH SCORE TIME NODES PV
DEPTH SCORE TIME NODES SELECTIVEDEPTH SPEED TABLEBASEHITS<Tab>PV
I now have this:
Code: Select all
fn search_summary(s: SearchSummary) {
println!(
"{} {} {} {} {}",
s.depth,
s.cp,
(s.time as f64 / 10.0).round(),
s.nodes,
s.pv_as_string()
);
}
Code: Select all
$ ./target/release/rustic.exe -c xboard
Rustic Alpha 1 by Marcel Vanthoor (xboard mode, 1 thread)
analyze
1 70 0 7 e2e4
2 0 0 114 d2d4 d7d5
3 60 0 1005 d2d4 d7d5 e2e3
4 0 0 15893 d2d4 d7d5 c1g5 c8g4
5 20 5 169855 d2d4 d7d5 c1f4 c8g4 f4e5
6 5 34 1458763 d2d4 d7d5 e2e3 c8d7 c2c4 e7e6 c4d5 e6d5
7 20 287 11665664 d2d4 d7d5 c1d2 c8f5 e2e3 e7e6 f1e2
Code: Select all
fn search_summary(s: SearchSummary) {
println!(
"{} {} {} {} {} {} {}\t{}",
s.depth,
s.cp,
(s.time as f64 / 10.0).round(),
s.nodes,
s.seldepth,
s.nps,
s.tbhits,
s.pv_as_string()
);
}
Therefore I tried it under XBoard, and it also doesn't work. It still shows the PV (where Arena doesn't), but it keeps stating "not shown: tbhits, selective depth, speed".
Am I overlooking something or misunderstanding this?
(PS: "pv_as_string" converts the moves in the PV-vector to a string. I have checked that this string does not contain leading or trailing spaces. The function trims the string left and right after constructing it.)
Code: Select all
impl SearchSummary {
pub fn pv_as_string(&self) -> String {
let mut pv = String::from("");
for next_move in self.pv.iter() {
let m = format!(" {}", next_move.as_string());
pv.push_str(&m[..]);
}
pv.trim().to_string()
}
}
The specs at the Nubati site state that the response to the "." command should start with "stat01". The specs at the GNU side state "stat01:" (with extra colon). Both Winboard and Arena implement the version with the colon (I looked it up in the Winboard code, and without the colon, Arena doesn't parse the response.)