tomitankChess 5.0 with NN

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

Moderators: hgm, Rebel, chrisw

supersharp77
Posts: 1242
Joined: Sat Jul 05, 2014 7:54 am
Location: Southwest USA

Re: TomitankChess tested vs McBrain 9.6 JS..

Post by supersharp77 »

tomitank wrote: Mon Jan 18, 2021 8:36 pm Hi all!

Here is the new version of world stongest JavaScript chess engine!

This is quite different from the SF solution.

- network is only 768x16x1. Smaller than I've seen before.

- it does not replace evaluation, it only compensates that. (*)

- trained only with 2.7M example.

- The network is not compatible with other engines (*) and it's integrated into the code. (hardcoded)

- I wrote the network from scratch. I don't use machine learning platform.

Estimated elo: near to 2900.

(((Since JavaScript is about 4-5x slower than C, it would be around 3100 or above in C. (With AVX).)))

JavaScript uses only one core. With 4 cores, in C it would be near to 3300.

I did not tune the search. It could probably be even stronger.

Its run in Browser or in Chess GUIs with node.js as well.

Url:
https://github.com/tomitank/tomitankChess

I welcome any feedback.

Have fun with tomitankChess!

-Tamás
As was mentioned before McBrain v9.6 JS IS The Worlds Strongest Javascript engine (There also is a SF 10 JS)...

[Event "banksia game"]
[Site "?"]
[Date "2021.01.21"]
[Round "?"]
[White "McB 9.6 64 JScript"]
[Black "Tomitank v4.0 JS Engine"]
[Result "1-0"]
[ECO "C01"]
[Annotator "Ross-SF Ipman SE3"]
[PlyCount "131"]
[EventDate "2021.??.??"]
[TimeControl "300+5"]

[pgn]1. e4 {+0.72/20 17.5 4447626} e6 {-0.34/11 15.4 251567} 2. d4 {
+0.48/19 10.6 2320349} d5 {-0.36/13 17.1 736759} 3. exd5 {
+0.37/21 12.6 3794724; C01: French, exchange variation} (3. e5 c5 {
More exciting is the main line e5 or even the quite interesting Nc3...} 4. c3
Nc6) 3... exd5 {-0.27/13 14.1 367888} 4. Nf3 {+0.46/19 10.3 3108133} Nf6 {
-0.23/13 13.8 446642} 5. h3 {+0.45/20 17.6 4840506} Bd6 {-0.11/12 13.5 396216}
6. c4 {+0.39/21 17.9 4550390 Quite aggressive...more normal is Bd3...} (6. Bd3
O-O 7. O-O Be6 8. Re1 Re8) 6... O-O {+0.00/12 13.6 583768} 7. c5 {
-0.04/23 24.3 6829672} Re8+ {-0.09/14 21.6 1006405} 8. Be2 {+0.07/21 2.6 740727
} Be7 {-0.01/14 12.5 398033} 9. O-O {+0.35/20 13.3 2830008} Ne4 {
-0.09/13 12.2 169405} (9... b6 10. b4 a5 11. cxb6 axb4) 10. Be3 {
+0.37/18 5.8 1214552} Nc6 {+0.06/12 11.9 360091} 11. Qb3 {+0.42/20 6.5 1703675}
Bf6 {-0.04/11 11.7 307444} 12. Nc3 {+0.25/21 9.8 2912466} Na5 {
+0.00/12 11.4 474030} 13. Qa4 {+0.38/21 12.9 3166755} (13. Qc2 Bf5 14. Bd3 Nc6)
13... Nc6 {+0.00/14 11.3 398607} 14. Rfe1 {+0.43/19 2.6 935924} Bf5 {
+0.01/11 11.0 174566} 15. Bb5 {+0.41/19 8.0 2499848} Qd7 {-0.02/13 10.8 404195}
16. Bf4 {+0.62/19 3.4 631560} Nxc3 {-0.14/13 10.9 470313} 17. bxc3 {
+0.97/20 4.9 1627867} Be4 {-0.17/13 10.4 448963} 18. Nd2 {+1.16/21 3.8 1709325}
Bf5 {-0.30/14 10.3 588346} 19. Bxc6 {+1.10/22 8.4 2679264} Qxc6 {
-0.36/13 10.1 360086} 20. Qxc6 {+0.91/23 11.0 2232638} bxc6 {
-0.40/14 10.1 419272} 21. g4 {+0.91/21 8.6 2860707} Bc2 {-0.38/13 9.8 490214}
22. Rac1 {+1.14/22 13.0 4042889} Bg6 {-0.55/14 9.7 567440} 23. Bxc7 {
+1.09/21 5.0 1300442} h6 {-0.45/13 9.5 397423} 24. f4 {+1.49/21 9.7 3419499}
Bd3 {-0.48/14 12.2 706028} 25. Nf3 {+1.51/21 5.5 2402226} Be4 {
-0.42/13 9.1 225168} 26. Kf2 {+1.56/19 4.2 1476789} Rac8 {-0.59/14 15.6 971009}
27. Bd6 {+1.79/21 5.6 2178790} a6 {-0.67/12 8.6 578321} 28. Re3 {
+1.94/19 6.6 2622924} Kh7 {-0.94/12 9.6 662024} 29. Kg3 {+2.36/22 5.6 2157962}
Re6 {-1.07/13 8.7 487969} 30. Nd2 {+2.34/25 14.5 5662745} Rce8 {
-1.18/14 8.2 457466} 31. Nxe4 {+2.60/26 34.9 12889312} Rxe4 {
-0.99/17 8.1 411206} 32. Rxe4 {+2.81/21 4.8 1094079} Rxe4 {-1.01/18 8.0 690248}
33. Kf3 {+3.01/23 6.2 2605542} Bh4 {-1.19/17 7.9 486155} 34. Rb1 {
+3.14/22 6.1 2745080 white looks to be just about won...} Re1 {
-1.22/17 7.8 579381} 35. Rb7 {+3.24/21 5.8 2583659} (35. Rb6 Rf1+ 36. Ke2 Re1+
37. Kd3) 35... Rc1 {-1.34/14 7.7 504391} 36. Rxf7 {+3.32/26 22.2 8617597} Rxc3+
{-1.50/15 12.0 837083} 37. Ke2 {+3.37/23 5.2 2370902} Bf6 {-1.65/16 7.3 564797}
38. Be5 {+3.43/25 7.9 3980924} Kg6 {-1.81/16 7.2 407233} 39. Rc7 {
+3.87/20 7.6 3539208} Rxh3 {-2.17/14 7.3 603950} 40. Rxc6 {+4.14/18 4.9 2282511
} Ra3 {-2.30/14 7.1 367105} 41. Rd6 {+4.70/19 5.2 1632223} Rxa2+ {
-2.48/14 7.1 585371} 42. Kd3 {+4.93/20 4.5 1732215} Ra3+ {-2.57/14 8.8 531492}
43. Kc2 {+5.52/23 24.8 11706214} Kf7 {-2.65/15 6.9 434751} 44. Rxd5 {
+6.27/21 9.5 3962118} Ra4 {-2.81/14 9.7 505694} 45. Kb3 {+6.62/20 6.9 2258633}
Ra1 {-2.80/14 7.9 656148} 46. c6 {+6.87/22 10.0 3693534} Bxe5 {
-2.81/14 6.6 431220} 47. fxe5 {+7.96/22 6.1 3501420} Rb1+ {-3.18/13 6.5 451789}
48. Kc2 {+8.21/21 4.5 2458788} Rb8 {-4.68/15 10.0 940258} 49. Rd7+ {
+10.54/20 4.1 2167114} Ke6 {-5.03/16 9.2 371724} 50. Rd6+ {
+12.80/22 27.2 11416543} Ke7 {-5.72/16 24.9 1943724} 51. d5 {
+15.67/20 9.9 4726783} Ke8 {-6.45/16 7.8 713911} 52. Rd7 {+17.71/17 3.6 1371343
} Rc8 {-9.45/15 6.0 753596} 53. Rxg7 {M+20/21 4.2 3566464} Kf8 {
-11.61/17 5.3 587232} 54. Rh7 {M+15/26 3.5 2851060} Kg8 {-13.10/17 5.3 467837}
55. Rd7 {M+14/29 3.8 3236072} Kf8 {-19.62/18 12.0 1401781} 56. c7 {
M+12/26 4.0 2034157} Ke8 {-22.30/16 5.4 456801} 57. Rh7 {M+11/28 4.7 3301958}
Kf8 {-24.14/16 5.1 374407} 58. d6 {M+10/29 4.3 3311072} Kg8 {
-25.53/16 5.0 470061} 59. Rd7 {M+9/31 5.5 3722536} Rf8 {-26.95/14 5.0 265187}
60. Rd8 {M+7/30 4.2 2084858} a5 {M-7/10 4.9 189595} 61. Rxf8+ {
M+6/36 3.9 2916281} Kxf8 {M-5/24 4.9 893350} 62. c8=Q+ {M+5/63 3.9 2806643} Kg7
{M-4/64 4.9 774038} 63. d7 {M+4/89 6.2 4133841} h5 {M-3/64 0.1 7302} 64. d8=Q {
M+3/127 0.8 555042} hxg4 {M-2/64 0.1 4231} 65. Qxg4+ {M+2/127 0.1 7136} Kf7 {
M-1/64 0.1 1250} 66. e6# {M+1/127 0.2 6863} 1-0
[/pgn]



Game #2

[Event "banksia game"]
[Site "?"]
[Date "2021.01.20"]
[Round "?"]
[White "Tomitank v4.0 JS Engine"]
[Black "McB 9.6 64 JScript"]
[Result "0-1"]
[ECO "C01"]
[Annotator "Ross-SF Ipman SE3"]
[PlyCount "126"]
[EventDate "2021.??.??"]
[TimeControl "300+5"]

[pgn]1. e4 {+0.41/12 14.9 334658} e6 {-0.11/20 18.6 5175612} 2. d4 {
+0.24/13 14.6 743192} d5 {-0.01/19 5.7 1088241} 3. exd5 {
+0.27/14 14.2 700524; C01: French, exchange variation} (3. e5 c5 4. c3) (3. Nc3
Bb4 {The extremely sharp winauer variation...!}) 3... exd5 {
+0.08/19 4.8 1527407} 4. Nf3 {+0.20/14 13.9 733717} Nf6 {+0.10/19 10.8 3097656}
5. Bd3 {+0.21/14 13.6 586117} Bd6 {+0.02/23 31.0 8240715} 6. Nc3 {
+0.27/14 13.4 761781} O-O {+0.09/19 2.4 871470} 7. O-O {+0.05/14 13.1 673938}
c6 {+0.22/22 15.6 6447702} 8. h3 {+0.24/13 12.7 810483} (8. Re1 Bg4 9. h3 Bh5)
8... Na6 {+0.37/21 3.6 1763408} 9. Bxa6 {+0.03/14 12.5 925229} bxa6 {
+0.15/22 8.5 4334601} 10. Bg5 {-0.02/14 12.3 642862} Bf5 {
+0.16/22 27.6 11193318} 11. Re1 {+0.48/13 12.0 772250} h6 {
-0.08/23 14.5 5587567} 12. Bh4 {+0.50/14 11.8 601334} g5 {
-0.01/22 6.9 3197390 g5 is a very aggressive play indeed...} 13. Bg3 {
+0.62/13 12.9 876653} Bxg3 {-0.16/22 7.7 4091153} 14. fxg3 {
+0.36/13 11.3 610298} Qd6 {-0.01/21 3.4 1615932} 15. Ne5 {+0.51/13 11.6 794026}
Rab8 {+0.06/22 18.4 10392441} 16. g4 {+0.28/13 10.9 719615} Bh7 {
+0.29/18 2.5 1023453} 17. Rb1 {+0.17/13 10.7 679022} c5 {+0.68/18 4.3 2381848}
18. Nf3 {+0.25/13 10.5 111050} Rb4 {+0.77/20 5.0 2687613} 19. a3 {
+0.31/14 10.3 724125} Rc4 {+0.82/22 6.0 2635983 quite unusual move....Rc4....}
20. Nd2 {+0.55/16 10.1 968061} Rxd4 {+0.38/26 29.6 13442422} 21. Ne2 {
+0.23/15 10.9 1003346} Qb6 {+0.58/25 3.1 1398212} 22. Nxd4 {+0.10/15 9.8 736831
} cxd4 {+0.62/25 3.8 2169342} 23. Kh2 {+0.13/15 9.6 653695} Qc7+ {
+0.82/21 4.1 1948869} 24. g3 {-0.29/15 9.4 875085} Bxc2 {+1.40/24 4.8 2568625}
25. Rc1 {-0.20/17 9.5 710636} d3 {+1.43/23 5.4 3360607} 26. Qf3 {
-0.61/16 12.0 1289959} Ne4 {+1.87/21 4.7 2852643} 27. Qg2 {-0.89/15 9.0 781863}
Qa5 {+1.82/23 9.3 4938371} 28. b4 {-0.69/17 8.8 798717} Qxa3 {
+2.07/23 5.0 1904233} 29. Nxe4 {-0.79/17 9.2 899166} dxe4 {+2.24/23 5.7 2857500
} 30. Qxe4 {-0.80/16 9.0 732214} Qb2 {+2.36/23 4.6 2973561} 31. Qg2 {
-1.01/17 12.6 1205281} Qxb4 {+2.37/26 13.8 6567204} 32. Rf1 {
-1.00/16 8.1 412087} a5 {+2.65/23 4.6 3031213} 33. Qd5 {-1.05/12 8.0 848641}
Qb2 {+2.96/23 5.6 3640912} (33... a4 34. Rf2 Qb3) 34. Kg1 {-1.33/14 8.0 841299}
a4 {+3.31/24 8.1 5331120} 35. Rce1 {-1.39/16 7.8 763019} Qb8 {
+3.56/23 5.6 2490135} 36. Kh2 {-1.84/17 12.3 1269386} Qd8 {+3.71/24 7.8 4040774
} 37. Qc5 {-2.00/18 15.8 1739859} d2 {+3.71/22 9.2 5357196} 38. Qxc2 {
-2.07/18 7.7 977465} dxe1=Q {+4.02/23 10.6 5273886} 39. Rxe1 {
-2.06/17 7.0 320356} a3 {+4.24/24 14.8 8673542} 40. Qc3 {-1.93/14 11.0 1284868}
Qd6 {+4.42/23 4.9 3442212} 41. Re2 {-2.14/15 6.8 624614} Rb8 {
+4.71/26 7.7 5803793} 42. Ra2 {-2.32/17 12.7 1464504} Qd1 {+5.65/24 8.9 4608358
} 43. Rf2 {-2.29/17 6.4 661983} (43. Qxa3 Rb1) 43... Qb3 {+6.37/23 5.5 3414880}
44. Qc7 {-2.51/16 8.0 675487} a5 {+6.83/24 6.9 5545617} 45. Qe5 {
-3.12/12 7.9 731199} a4 {+10.86/21 6.4 4868167} 46. h4 {-4.92/15 18.0 2152908}
gxh4 {+12.82/20 7.4 6992354} 47. Kh3 {-5.41/15 5.8 742333} hxg3 {
+18.08/18 8.1 7642712} 48. Re2 {-6.81/13 5.7 565697} a2 {
+53.54/17 11.9 10280281} 49. Qa1 {-8.92/14 7.7 746866} g2+ {
+53.70/20 4.8 3809958} 50. Kxg2 {-10.35/13 9.9 1012822} a3 {
+63.62/22 8.7 8833153} 51. Rxa2 {-12.25/14 9.1 1028923} Qxa2+ {
M+15/28 4.2 3551906} 52. Qxa2 {-16.19/16 5.4 1096770} Rb2+ {M+13/32 5.5 4890765
} 53. Qxb2 {-21.09/17 12.9 1740358} axb2 {M+11/37 4.9 5173670} 54. Kf3 {
-21.43/17 5.4 402405} b1=Q {M+10/39 5.0 6535977} 55. Ke3 {-22.47/17 5.0 1029611
} Qb4 {M+9/41 6.0 8511658} 56. Kf3 {-21.67/13 5.0 834234} Qe1 {
M+8/45 6.0 8868127} 57. Kf4 {-22.47/11 5.0 863857} Qe2 {M+7/54 5.5 8307558} 58.
Kg3 {M-9/15 5.0 350478} f6 {M+6/63 4.9 5778855} 59. Kh3 {M-5/22 5.0 906705} Qf2
{M+5/111 5.7 8437081} 60. g5 {M-4/5 0.1 189} hxg5 {M+4/127 1.0 807458} 61. Kg4
{-15.35/5 0.1 4062} Kf7 {M+3/127 0.2 84235} 62. Kh3 {M-2/64 2.6 452321} Kg6 {
M+2/127 0.1 6599} 63. Kg4 {M-1/5 0.0 14} Qg2# {M+1/127 0.1 3331} 0-1
[/pgn]

Watched the match from start to finish and not much of a "playing style" observed...mostly standard play...reminded me of Chess Genius quite a bit...ELO strength around 2600-2650..tops...also had a sneaking hunch that McBrain was actually playing against a Node JS Chess engine and not "Tomitank"...Cerulean JS was able to produce a chess engine (8,000 k in size) but the strength is only around 2100...Thats why around 1 1/2 to 2 years ago I asked you for a C+ exe compile..but as of yet nothing has been produced..at all..is Tomitank a engine with a node js wrapper or is it Node JS with a Tomitank wrapper? Now a NNUE may not help you much because how do you set the NNUE parameters with a engine that uses Node JS to run in the GUI? Plus the way it is currently set up Fritz or Chess OK won't be running this setup anytime soon..AR
tomitank
Posts: 276
Joined: Sat Mar 04, 2017 12:24 pm
Location: Hungary

Re: TomitankChess tested vs McBrain 9.6 JS..

Post by tomitank »

supersharp77 wrote: Thu Jan 21, 2021 10:33 am
As was mentioned before McBrain v9.6 JS IS The Worlds Strongest Javascript engine (There also is a SF 10 JS)...
What do I start with an .exe file in the browser? How can i modify? (If I want)

Where is the [.js] source code? I'ts pure JavaScript or converted from C++?

tomitankChess is pure JavaScript. Then I have to say that it is the strongest pure JavaScript chess engine in the world.
supersharp77 wrote: Thu Jan 21, 2021 10:33 am
Thats why around 1 1/2 to 2 years ago I asked you for a C+ exe compile..but as of yet nothing has been produced..at all..is Tomitank a engine with a node js wrapper or is it Node JS with a Tomitank wrapper?
tomitankChess run in webbrowser (In IE as well.) and with node.js as well. This run in my chess mobile application too and on my website as well.
supersharp77 wrote: Thu Jan 21, 2021 10:33 am
Now a NNUE may not help you much because how do you set the NNUE parameters with a engine that uses Node JS to run in the GUI? Plus the way it is currently set up Fritz or Chess OK won't be running this setup anytime soon..AR
It's possible. Currently you can change the hash size in Arena. The NNUE file would be readable in browser and with node.js as well. tomitankChess is designed for browsers. Node.js was included only for testers.

-Tamás
User avatar
Sylwy
Posts: 4465
Joined: Fri Apr 21, 2006 4:19 pm
Location: IASI - the historical capital of MOLDOVA
Full name: SilvianR

Re: TomitankChess tested vs McBrain 9.6 JS..

Post by Sylwy »

tomitank wrote: Thu Jan 21, 2021 5:30 pm
Where is the [.js] source code? I'ts pure JavaScript or converted from C++?

tomitankChess is pure JavaScript. Then I have to say that it is the strongest pure JavaScript chess engine in the world.


-Tamás
:lol:

McBrain 9.6 x64 was born in August 2018 like a modified Stockfish 9. Has a lot of compiles for various platforms . The author is the well known Michael Byrne (Kōhai, Hawkeye, McCain, Burnzie..........sounds familiar?).............I have never seen a McBrain 9.6 pure JS. Stockfish 9 is a C++ chess engine, of course.

Here is the whole "army" (and the source code, of course):

Image

More details:
https://github.com/MichaelB7/Stockfish/ ... s/tag/v9.6
tmokonen
Posts: 1296
Joined: Sun Mar 12, 2006 6:46 pm
Location: Kelowna
Full name: Tony Mokonen

Re: tomitankChess 5.0 with NN

Post by tmokonen »

McBrain JS has nothing to do with Javascript. It means that the EXE was compiled by John Stanback.
tomitank
Posts: 276
Joined: Sat Mar 04, 2017 12:24 pm
Location: Hungary

Re: tomitankChess 5.0 with NN

Post by tomitank »

tmokonen wrote: Fri Jan 22, 2021 12:21 am McBrain JS has nothing to do with Javascript. It means that the EXE was compiled by John Stanback.
@supersharp77:
So, what's the truth? :D
Tord
Posts: 31
Joined: Tue Feb 27, 2018 11:29 am

Re: tomitankChess 5.0 with NN

Post by Tord »

Hello Tamás,

This looks awesome. That level of strength with so few lines of code in JavaScript is impressive.

Unfortunately, I can't get it to work with node 15.7 under macOS. I tried running the engine with "node tomitankChess.js" and then typing "uci". It then prints what looks like normal UCI initialisation output:

Code: Select all

uci
id name tomitankChess 5.0
id author Tamas Kuzmics
option name Hash type spin default 32 min 1 max 256
uciok
However, it then immediately exits without printing any error message. Any idea what could be wrong?
op12no2
Posts: 489
Joined: Tue Feb 04, 2014 12:25 pm
Full name: Colin Jenkins

Re: tomitankChess 5.0 with NN

Post by op12no2 »

Tord wrote: Wed Jan 27, 2021 10:27 am However, it then immediately exits without printing any error message. Any idea what could be wrong?
Hi Tord, not sure how Tamás plugs into the node event loop but if it's similar to how I do it you need to add a call to process.stdin.resume() in recent node versions. e.g.

Code: Select all

if (lozzaHost == HOST_NODEJS) {

  lozza.uci.nodefs = require('fs');

  process.stdin.setEncoding('utf8');

  process.stdin.on('readable', function() {
    var chunk = process.stdin.read();
    process.stdin.resume(); // <-- add this line after the readable event
    if (chunk !== null) {
      onmessage({data: chunk});
    }
  });

  process.stdin.on('end', function() {
    process.exit();
  });
}
HTH.

PS: I'm not totally confident I understand why, but I had the same issue recently and that _seems_ to fix it... :)
tomitank
Posts: 276
Joined: Sat Mar 04, 2017 12:24 pm
Location: Hungary

Re: tomitankChess 5.0 with NN

Post by tomitank »

Tord wrote: Wed Jan 27, 2021 10:27 am Hello Tamás,

This looks awesome. That level of strength with so few lines of code in JavaScript is impressive.

Unfortunately, I can't get it to work with node 15.7 under macOS. I tried running the engine with "node tomitankChess.js" and then typing "uci". It then prints what looks like normal UCI initialisation output:

Code: Select all

uci
id name tomitankChess 5.0
id author Tamas Kuzmics
option name Hash type spin default 32 min 1 max 256
uciok
However, it then immediately exits without printing any error message. Any idea what could be wrong?
Hello Tord!

Thank you for the honor!

I fixed the bug. (Thank for Lozza author!)
https://github.com/tomitank/tomitankChe ... 6bfa7633bc

Please download the latest release again :)
(i'ts called still 5.0, because i only noticed the error without GUI. I don't want to send 1 more version to the rating lists.)

I look forward to your feedback!

(Another question: do you know anything about Fabien? He hasn't responded in a long time.)

-Tamás
Tord
Posts: 31
Joined: Tue Feb 27, 2018 11:29 am

Re: tomitankChess 5.0 with NN

Post by Tord »

Thank you Tamás, it works perfectly now!
tomitank
Posts: 276
Joined: Sat Mar 04, 2017 12:24 pm
Location: Hungary

Re: tomitankChess 5.0 with NN

Post by tomitank »

I increased the hash size to 512MB!
Please download the latest release again :)
it's called still 5.0, because I don't want to send 1 more version to the rating lists.
There is probably not much difference, but i would be happy when all tester use the updated version for remaing tests.