There is a bug in uci.js, it does not send uciok. I will try to setup it up again in winboard, it already worked in cutechess GUI.Guenther wrote: ↑Thu Dec 24, 2020 1:07 pmIn WB now w/o Polyglot - Wukong10JS-64 is just a renamed nodehgm wrote: ↑Thu Dec 24, 2020 12:41 pmYou should let WinBoard worry about the quoting, and you should not put any command-line arguments in the text entry meant for the executable. The latter should go into the 'command-line parameters' entry. The .exe entry is only for the executable; if there are any spaces in there, WinBoard will assume it is an executable name with spaces in it. Writing quotes in there yourself will just confuse WinBoard; when you use the 'browse' button to point out the .exe it wouldn't provide any quotes either.
So the .exe field should just contain
C:/Program Files/blabla/nodes.exe
and the command-line parameter should be
uci.js
This should result in a line in the engine list
"nodes.exe uci.js" -fd "C:/Program Files/blabla"
If you don't want the engine to run in the nodes.exe folder (e.g. because it cannot find its book files from there), you should explicitly provide the directory (there also is a browse button for that), and WinBoard will use that as -fd argument, and refrain from spliiting off the path from the engine command. In that case it should produce a line in the engine list like
'"C:/Program Files/blabla/nodes.exe" uci.js' -fd "whatever"
The debug is not very helpful - it doesn't work, neither in CuteChess nor from cmd with Polyglot (for logging) nor with WB so far
(seems a problem with node - crashing/not responsive)
EDIT:Code: Select all
recognized 'normal' (-1) as variant normal recognized 'normal' (-1) as variant normal shuffleOpenings = 0 Version: WinBoard 4.9.1 + Wukong10JS-64 Reset(1, 0) from gameMode 0 recognized 'normal' (-1) as variant normal GameEnds(0, (null), 2) shuffleOpenings = 0 StartChildProcess (dir="") UCI2WB Wukong10JS-64 uci.js C:\Engines\UCIJS\Wukong_10JS-64 nice engine proc to 10 1200 >first : xboard protover 2 1230 <first : Wukong10JS-64: No error Terminating process 4176, result=0 GameEnds(29, xboard exit, 2)
BTW can we change the title of the original header to Wukong JS instead of general JS engines ?
Other JS engines never had these problems and the current title will confuse other users
Setup a javascript engine in a GUI
Moderator: Ras
-
- Posts: 4845
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
Re: Setup a javascript engine in a GUI
-
- Posts: 4845
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
Re: Setup a javascript engine in a GUI
Tried it again and still it did not work.hgm wrote: ↑Thu Dec 24, 2020 12:41 pmYou should let WinBoard worry about the quoting, and you should not put any command-line arguments in the text entry meant for the executable. The latter should go into the 'command-line parameters' entry. The .exe entry is only for the executable; if there are any spaces in there, WinBoard will assume it is an executable name with spaces in it. Writing quotes in there yourself will just confuse WinBoard; when you use the 'browse' button to point out the .exe it wouldn't provide any quotes either.
So the .exe field should just contain
C:/Program Files/blabla/nodes.exe
and the command-line parameter should be
uci.js
This should result in a line in the engine list
"nodes.exe uci.js" -fd "C:/Program Files/blabla"
If you don't want the engine to run in the nodes.exe folder (e.g. because it cannot find its book files from there), you should explicitly provide the directory (there also is a browse button for that), and WinBoard will use that as -fd argument, and refrain from spliiting off the path from the engine command. In that case it should produce a line in the engine list like
'"C:/Program Files/blabla/nodes.exe" uci.js' -fd "whatever"
Setup

Error message

Debug
Code: Select all
StartChildProcess (dir=".") UCI2WB debug -nice 10 -kill 1 -c ""C:\Program Files\nodejs\node.exe" uci.js" "F:\Tmp"
nice engine proc to 10
73060 >first : xboard
protover 2
73064 <first : C:\Program: No error
Terminating process 10780, result=0
GameEnds(30, xboard exit, 2)
uci.js used has a fixed for not sending uciok which can be found here.
-
- Posts: 1344
- Joined: Sun Mar 12, 2006 6:46 pm
- Location: Kelowna
- Full name: Tony Mokonen
-
- Posts: 28322
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Setup a javascript engine in a GUI
OK, I see what te problem is. Because the engine is UCI, and the adapter command is defined with quotes around the engine name, there is a duplicate set of double quoting: around the engine pathname (node.exe) as well as around the this name + the argument. When Windows interprets the resulting command for launching the adapter (UCI2WB ""executable" argument") it of course parses this differently, not like they are nested.
I guess WinBoard should quote space-containing executable names with single quotes when the engine is UCI, to prepare for the total engine command being enclosed in another set of double quotes when it gets passed to the adapter. But then the adapter would see as its 'engine' argument the string
'executable' argument
and I am not sure if passing that to the Windows CreateProcess function would understand single quotes. So I guess I would have to add some code in UCI2WB to replace single quotes by double quotes before launching the engine.
-
- Posts: 775
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Re: Setup a javascript engine in a GUI
uciok has been added in a recent version.Ferdy wrote: ↑Fri Dec 25, 2020 4:28 amThere is a bug in uci.js, the engine does not send uciok as last message after receiving uci command.tmokonen wrote: ↑Thu Dec 24, 2020 8:56 am In the CuteChess GUI, I put the program name, with full path, and command line parameters all together in the Command: section of the Configure Engine screen. You might need quotes around the program path or javascript file path if there are spaces. It's the same format as you would use from a command prompt. For example:
C:\Games\NoSpaces\NoQuotesRequired\node.exe C:\jsengines\coolengine.js
"C:\path with spaces\node.exe" C:\jsengines\wukong.js
C:\Games\NoSpaces\NoQuotesRequired\node.exe "C:\jsengines\This time I have spaces.js"
Fixing it and the following would work.
![]()
can you run it via nodejs in command line?
let me know if now it works.
Didactic chess engines:
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
-
- Posts: 775
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Re: Setup a javascript engine in a GUI
For the future: feel free to open issues on github so the author knows about it) I saw one on uciok - not sure if it's yours. If I knew it's so critical I would fix it faster. I've noticed current thread only today - it would happen earlier if you ping me in release thread.
Didactic chess engines:
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
-
- Posts: 4845
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
Re: Setup a javascript engine in a GUI
Yes it was me.maksimKorzh wrote: ↑Sat Dec 26, 2020 8:50 am For the future: feel free to open issues on github so the author knows about it) I saw one on uciok - not sure if it's yours.
-
- Posts: 4845
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
Re: Setup a javascript engine in a GUI
It worked.maksimKorzh wrote: ↑Sat Dec 26, 2020 8:43 amuciok has been added in a recent version.Ferdy wrote: ↑Fri Dec 25, 2020 4:28 amThere is a bug in uci.js, the engine does not send uciok as last message after receiving uci command.tmokonen wrote: ↑Thu Dec 24, 2020 8:56 am In the CuteChess GUI, I put the program name, with full path, and command line parameters all together in the Command: section of the Configure Engine screen. You might need quotes around the program path or javascript file path if there are spaces. It's the same format as you would use from a command prompt. For example:
C:\Games\NoSpaces\NoQuotesRequired\node.exe C:\jsengines\coolengine.js
"C:\path with spaces\node.exe" C:\jsengines\wukong.js
C:\Games\NoSpaces\NoQuotesRequired\node.exe "C:\jsengines\This time I have spaces.js"
Fixing it and the following would work.
![]()
can you run it via nodejs in command line?
let me know if now it works.
-
- Posts: 775
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Re: Setup a javascript engine in a GUI
Thanks for giving nice hint on timing on github issues.Ferdy wrote: ↑Sat Dec 26, 2020 9:17 amYes it was me.maksimKorzh wrote: ↑Sat Dec 26, 2020 8:50 am For the future: feel free to open issues on github so the author knows about it) I saw one on uciok - not sure if it's yours.
Will fix soon.
I just need to fight some search bugs for now.
Didactic chess engines:
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ