My new engine - KhepriChess (Typescript/Javascript)

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

Moderator: Ras

KhepriChess
Posts: 93
Joined: Sun Aug 08, 2021 9:14 pm
Full name: Kurt Peters

My new engine - KhepriChess (Typescript/Javascript)

Post by KhepriChess »

Hello everyone! Slightly daunting to post on here...

Thanks to the massive help from Maksim Korzh and his Youtube series about creating a bitboard chess engine in C, I wrote an engine in Javascript (technically in Typescript, which transpiles to Javascript) following his tutorial series.

I think of particular note is that the engine uses the relatively new 'bigint' primitive in JS for native 64-bit integer support. So instead of having to break bitboards, hashes, etc. up into two separate 32-bit integers it just has the single 64-bit ones. It has it's own drawbacks (notably that it's slower than 32-bit operations) but my goal here was to try something new (and learn) and not to make a super-fast engine (otherwise I wouldn't have used JS :wink: ).

Now that it's stable, I hope to look into improving the evaluation with a few things like mobility and some basic king safety knowledge (I have a general list of things I want to look into here: https://github.com/kurt1288/KhepriChess ... provements)

And since I'm unsure, how can I go about having my engine added/tested as part of the CCRL to get a rating?

Github: https://github.com/kurt1288/KhepriChess
Browser play: https://kurt1288.github.io/KhepriChess/ ... hepri.html

Thanks everyone!
Puffin: Github
KhepriChess: Github
Carlos777
Posts: 1977
Joined: Sun Dec 13, 2009 6:09 pm

Re: My new engine - KhepriChess (Typescript/Javascript)

Post by Carlos777 »

KhepriChess wrote: Wed Aug 11, 2021 1:40 am Hello everyone! Slightly daunting to post on here...

Thanks to the massive help from Maksim Korzh and his Youtube series about creating a bitboard chess engine in C, I wrote an engine in Javascript (technically in Typescript, which transpiles to Javascript) following his tutorial series.

I think of particular note is that the engine uses the relatively new 'bigint' primitive in JS for native 64-bit integer support. So instead of having to break bitboards, hashes, etc. up into two separate 32-bit integers it just has the single 64-bit ones. It has it's own drawbacks (notably that it's slower than 32-bit operations) but my goal here was to try something new (and learn) and not to make a super-fast engine (otherwise I wouldn't have used JS :wink: ).

Now that it's stable, I hope to look into improving the evaluation with a few things like mobility and some basic king safety knowledge (I have a general list of things I want to look into here: https://github.com/kurt1288/KhepriChess ... provements)

And since I'm unsure, how can I go about having my engine added/tested as part of the CCRL to get a rating?

Github: https://github.com/kurt1288/KhepriChess
Browser play: https://kurt1288.github.io/KhepriChess/ ... hepri.html

Thanks everyone!
Hi,

I have other javascript engines (Lozza, Tomitank, P4wnChess, RapChess and Roller) installed on my PC, but yours does not work.

This is my command line on Winboard:

"KhepriChess" -fcp "node.exe C:\WinBoard-4.6.2\Engines\Kheprichess\kheprichess.js" -fd "C:\Program Files\nodejs" -fn "KhepriChess" -fNoOwnBookUCI -fUCI

Or is it maybe because my PC is very old (AMD Phenom II x6)?

I also tried Cute chess and does not work either.

Regards,
Carlos
KhepriChess
Posts: 93
Joined: Sun Aug 08, 2021 9:14 pm
Full name: Kurt Peters

Re: My new engine - KhepriChess (Typescript/Javascript)

Post by KhepriChess »

"KhepriChess" -fcp "node.exe C:\WinBoard-4.6.2\Engines\Kheprichess\kheprichess.js" -fd "C:\Program Files\nodejs" -fn "KhepriChess" -fNoOwnBookUCI -fUCI
It looks like you're using the non-node version. For use in UCI apps, you'll want to use the "kheprichessuci.js" file.

I know other JS engines have a single file, but because I use Typescript and Webpack (to transpile and bundle), it was difficult to conditionally import the node-specific library to read the GUI commands. Rather than trying to figure out how to get webpack to play nice with that, it was easier to have a separate UCI file.

Thanks for giving it a try!
Puffin: Github
KhepriChess: Github
amanjpro
Posts: 883
Joined: Sat Mar 13, 2021 1:47 am
Full name: Amanj Sherwany

Re: My new engine - KhepriChess (Typescript/Javascript)

Post by amanjpro »

Congrats for your first version. What's your estimate for the strength? If you want, you can register your engine to participate in ZaTour tournament (broadcasted live), given that:

The engine is rated below 2800 as per CCRL
The engine is opensource
The engine is original
It runs on Ubuntu


The link of the tournament use in my signature
KhepriChess
Posts: 93
Joined: Sun Aug 08, 2021 9:14 pm
Full name: Kurt Peters

Re: My new engine - KhepriChess (Typescript/Javascript)

Post by KhepriChess »

No, it hasn't gotten a CCRL rating yet (not sure how to go about getting my engine added for testing there). I'd estimate it around 1600-ish, but that's a pretty large guess.
Puffin: Github
KhepriChess: Github
amanjpro
Posts: 883
Joined: Sat Mar 13, 2021 1:47 am
Full name: Amanj Sherwany

Re: My new engine - KhepriChess (Typescript/Javascript)

Post by amanjpro »

You don't need to do much, if they notice your engine, chances are your engine will be tested

For better visibility, you probably can announce your engine here: http://talkchess.com/forum3/viewtopic.php?f=2&t=76209

Btw, you don't need a CCRL rating to participate in ZaTour, as long as we are certain it won't cross 2800
Carlos777
Posts: 1977
Joined: Sun Dec 13, 2009 6:09 pm

Re: My new engine - KhepriChess (Typescript/Javascript)

Post by Carlos777 »

KhepriChess wrote: Thu Aug 12, 2021 3:59 am
"KhepriChess" -fcp "node.exe C:\WinBoard-4.6.2\Engines\Kheprichess\kheprichess.js" -fd "C:\Program Files\nodejs" -fn "KhepriChess" -fNoOwnBookUCI -fUCI
It looks like you're using the non-node version. For use in UCI apps, you'll want to use the "kheprichessuci.js" file.

I know other JS engines have a single file, but because I use Typescript and Webpack (to transpile and bundle), it was difficult to conditionally import the node-specific library to read the GUI commands. Rather than trying to figure out how to get webpack to play nice with that, it was easier to have a separate UCI file.

Thanks for giving it a try!
I tried with the uci file first, but without success, then I used the other file without the -fUCI command, same thing. Maybe, it needs the last node version, I'll check it out.
User avatar
Gabor Szots
Posts: 1488
Joined: Sat Jul 21, 2018 7:43 am
Location: Budapest, Hungary
Full name: Gabor Szots

Re: My new engine - KhepriChess (Typescript/Javascript)

Post by Gabor Szots »

amanjpro wrote: Thu Aug 12, 2021 2:12 pm You don't need to do much, if they notice your engine, chances are your engine will be testedross 2800
They have noticed it.
Gabor Szots
CCRL testing group
User avatar
Gabor Szots
Posts: 1488
Joined: Sat Jul 21, 2018 7:43 am
Location: Budapest, Hungary
Full name: Gabor Szots

Re: My new engine - KhepriChess (Typescript/Javascript)

Post by Gabor Szots »

KhepriChess wrote: Wed Aug 11, 2021 1:40 am Hello everyone! Slightly daunting to post on here...

Thanks to the massive help from Maksim Korzh and his Youtube series about creating a bitboard chess engine in C, I wrote an engine in Javascript (technically in Typescript, which transpiles to Javascript) following his tutorial series.
A laic's question: Does it mean it is BBC translated to JavaScript or that it has BBC backbone with original evaluation and search?
Gabor Szots
CCRL testing group
User avatar
Gabor Szots
Posts: 1488
Joined: Sat Jul 21, 2018 7:43 am
Location: Budapest, Hungary
Full name: Gabor Szots

Re: My new engine - KhepriChess (Typescript/Javascript)

Post by Gabor Szots »

Kurt, will you please tell your country?

And a suggestion in case this is not the last version: somehow indicate in the filename which version it is. I could see it was 0.5.0 only after running it from the command line but e.g. under Arena it does not introduce itself.
Gabor Szots
CCRL testing group