Open JimViebke opened 4 months ago
After further debugging, it looks like En Croissant is not playing the most recent PV move either. As an attempted workaround, I added an additional info
command with the intended move, but it still seems that En Croissant is playing a different move. From my engine's logs:
21:19:54.4559055 Sending UCI command: info depth 8 score cp -520 nps 2262618 nodes 5753839 hashfull 608 tbhits 841406 time 2543 pv e1g1 c6e5 f3e5 e7d6 e5d3 c8f5 d3e1 d8e7 c3d5
21:19:57.6100710 Sending UCI command: info pv b5c6
21:19:57.6108471 Sending UCI command: bestmove b5c6
In this case, En Croissant still applies e1g1
instead of b5c6
.
I had an engine that would only send the bestmove command, which En Croissant wouldn't recognize. I wrote a script that acts as a proxy between the UI and the engine, and when it sees a "bestmove" command it automatically adds "info pv {move}" beforehand. This actually worked in my case. If you're curious, I'll leave the script below, but it's written in TypeScript which is suboptimal.
import {createInterface} from "node:readline";
import {spawn} from "node:child_process";
// ADD PATH HERE
// Example is for Windows, but works on any OS
const PATH = "C:\\absolute\\path\\to\\engine.exe";
const proc = spawn(PATH, {
stdio: "pipe"
});
const ownRl = createInterface(process.stdin, process.stdout);
const childRl = createInterface(proc.stdout, proc.stdin);
ownRl.on("line", line=>{
proc.stdin.write(line + "\n");
});
childRl.on("line", line=>{
if(line.startsWith("bestmove"))
console.log(`info pv ${line.split(" ")[1]}`);
console.log(line);
});
However En Croissant expects an executable, and Node.js scripts are only interpreted. While it's possible to use batch or powershell or shortcuts or such to work around this, I simply used Bun to convert it into an executable, using the command below.
bun build index.ts --minify --compile
After this, I just added the emitted index.exe as an engine to En Croissant.
Describe the bug
When my engine sends the
bestmove ...
command, En Croissant seems to ignore the contents of the command and instead plays the move from the most recently sentinfo ... pv ...
command.Is this correct behavior?
The UCI protocol says of
bestmove
: "the engine has stopped searching and found the move best in this position." It also contains the following example:My understanding is that the engine is committing the move
g1f3
in the above example, regardless of whatinfo
commands have been sent.Excerpt from my engine's logs, reflecting what is sent to En Croissant:
Expected behavior: En Croissant applies
e1f1
for my engine (from line 3). Actual behavior: En Croissant appliese1g1
(from line 2), possibly because it was the start of the most recently sent PV, viainfo
.Reproduction
info <some info> pv <move_X> <move_Y> <...>
.bestmove <move_A>
.move_X
instead ofmove_A
.Platform and versions
En Croissant
Version: 0.10.0
Tauri version: 1.6.1
OS: Windows_NT x86_64 10.0.19045