JSUCI 1.0 - connect javascript chess engines to UCI

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
phenri
Posts: 284
Joined: Tue Aug 13, 2013 7:44 am

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by phenri » Fri Mar 28, 2014 4:32 pm

Ok, nevermind
go movetime 5000
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
go depth 2
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
go infinite
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
uci
id name p4wn, AKA 5k chess
id author Douglas Bagnall, ported to JSUCI by Edmund Moshammer
uciok
isready
readyok
position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
engine.js:31380: Uncaught TypeError: Cannot read property 'board' of undefined
go depth 3
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
Edit: I missed ucinewgame
Its fine now

Edmund
Posts: 668
Joined: Mon Dec 03, 2007 2:01 pm
Location: Barcelona, Spain
Contact:

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by Edmund » Fri Mar 28, 2014 4:38 pm

phenri wrote:Ok, nevermind
go movetime 5000
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
go depth 2
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
go infinite
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
uci
id name p4wn, AKA 5k chess
id author Douglas Bagnall, ported to JSUCI by Edmund Moshammer
uciok
isready
readyok
position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
engine.js:31380: Uncaught TypeError: Cannot read property 'board' of undefined
go depth 3
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
p4wn requires the

Code: Select all

ucinewgame
command before sending position and go commands

Adam Hair
Posts: 3201
Joined: Wed May 06, 2009 8:31 pm
Location: Fuquay-Varina, North Carolina

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by Adam Hair » Fri Mar 28, 2014 4:51 pm

Thanks, Edmund! I look forward to trying this tool out.

Edmund
Posts: 668
Joined: Mon Dec 03, 2007 2:01 pm
Location: Barcelona, Spain
Contact:

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by Edmund » Fri Mar 28, 2014 5:47 pm

phenri wrote:Edit: I missed ucinewgame
Its fine now
Brilliant, I am glad it is working as expected. Thanks for testing!

phenri
Posts: 284
Joined: Tue Aug 13, 2013 7:44 am

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by phenri » Fri Mar 28, 2014 6:43 pm

I just tried to launch stockfish.js and apparently it is not so universal as that.

op12no2
Posts: 349
Joined: Tue Feb 04, 2014 11:25 am
Location: Mumbles, Wales, UK.
Full name: Colin Jenkins
Contact:

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by op12no2 » Fri Mar 28, 2014 9:23 pm

Hi Edmund,

Fantastic. I've been playing around with a Javascript engine recently and being able to use a standard UI would be great. I actually started off with similar intentions to your interface but got seduced by the engine.

Lozza uses the JSON web worker interface to do an analysis of N ply with a timeout option.

http://op12no2.me/toys/lozza/lozza.js

Primitive test UI here that runs some perft tests then does a 10 play analysis of the home position and BK positions 1-4.

http://op12no2.me/toys/lozza/test.htm

I will definitely try your interface...

Edmund
Posts: 668
Joined: Mon Dec 03, 2007 2:01 pm
Location: Barcelona, Spain
Contact:

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by Edmund » Fri Mar 28, 2014 11:57 pm

phenri wrote:I just tried to launch stockfish.js and apparently it is not so universal as that.
Interesting. I invested some time trying to find out why it is not running, but without success. This autogenerated source is not very debug friendly. It might be that one of the node.js malloc functions gets blocked by V8, but I am not certain.

Edmund
Posts: 668
Joined: Mon Dec 03, 2007 2:01 pm
Location: Barcelona, Spain
Contact:

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by Edmund » Sat Mar 29, 2014 12:22 am

op12no2 wrote:Hi Edmund,

Fantastic. I've been playing around with a Javascript engine recently and being able to use a standard UI would be great. I actually started off with similar intentions to your interface but got seduced by the engine.

Lozza uses the JSON web worker interface to do an analysis of N ply with a timeout option.

http://op12no2.me/toys/lozza/lozza.js

Primitive test UI here that runs some perft tests then does a 10 play analysis of the home position and BK positions 1-4.

http://op12no2.me/toys/lozza/test.htm

I will definitely try your interface...
Hey Colin,
I just head a look at your source. It looks very well organized. Connecting it to uci should be straight forward. It is missing an algebraic move parser and would have to change the way of output, but the rest looks suited perfectly. Please let me know if you encounter any dificulties.
All the best
Edmund

op12no2
Posts: 349
Joined: Tue Feb 04, 2014 11:25 am
Location: Mumbles, Wales, UK.
Full name: Colin Jenkins
Contact:

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by op12no2 » Sat Mar 29, 2014 12:57 am

Edmund wrote: I just head a look at your source. It looks very well organized. Connecting it to uci should be straight forward. It is missing an algebraic move parser and would have to change the way of output, but the rest looks suited perfectly. Please let me know if you encounter any dificulties.
All the best
Edmund
Great, thanks for checking it out and the tips. I'll look up the UCI protocol - never done anything with it. Looking forward to getting this going in my Hiarcs UI.

op12no2
Posts: 349
Joined: Tue Feb 04, 2014 11:25 am
Location: Mumbles, Wales, UK.
Full name: Colin Jenkins
Contact:

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by op12no2 » Mon Mar 31, 2014 1:56 pm

Woo! I have Lozza working in Arena (well in principle anyway).

I was going to spawn a sub-worker with Lozza in it on UCI GO, so I could easily kill it on UCI STOP, but V8 doesn't seem to like a worker starting another one.

NB: Can't currently use Hiarcs UI because it says your exe is 'not a valid engine' - I'll post in the Hiarcs forum to find out what it required for 'validity'.

This is fab Edmund; thank you so much...

Post Reply