After several months of becoming obsessed with chess programming, I'm glad to say that my engine Willow is up and running, and can play tournaments on BanksiaGUI (I'm not sure what's up with Arena, it keeps giving my engine the command "go infinite" rather than the proper "go wtime etc.") Thus it is finally ready for a beta release. It'd be appreciated if you could test it out, and notify me of any problems: https://github.com/Adam-Kulju/Willow/releases/tag/2.5
I estimate Willow's rating at about 2100 CCRL, perhaps a little bit higher. It's obviously not great but I'm still proud of it as it's my first programming project of this scale. Also, Willow's style of play is a very pleasant surprise. It's got a swashbuckling, enterprising style to it, is completely unafraid to sacrifice (especially pawns), and crushes weak materialistic engines with fireworks.
Here's a few games that I think show off Willow's style well. (The first three are from a bullet match against the 1750 engine Celestial, the last one is an old rapid game played by Willow against itself in self-testing. I don't have the output for that one as it was long before I added UCI support, I just saved the moves.
[pgn]
[Event "*"]
[Site "*"]
[Date "2023.03.06"]
[Time "10:15:44"]
[Round "*"]
[White "Celestial 1.0"]
[Black "Willow 2.5"]
[Result "0-1"]
[Termination "mate"]
[ECO "B53"]
[Opening "Sicilian, Chekhover variation"]
[TimeControl "60+1"]
[PlyCount "80"]
1.e4 c5 2.Nf3 d6
3.d4 cxd4 {-0.4/12 1845 431439} 4.Qxd4 {+0.3/6 2789 873832} Nc6 {-0.3/12 2117 449897; B53: Sicilian, Chekhover variation}
5.Qd3 {+0.2/6 2729 526733} Nf6 {+0.0/12 1961 416870} 6.Nc3 {+0.3/6 2672 1606376} e6 {-0.1/12 3976 855720}
7.Bg5 {+0.3/6 2611 1557901} h6 {-0.1/14 4041 872016} 8.Bh4 {+0.4/6 2561 875375} Be7 {-0.1/13 2424 530389}
9.O-O-O {+0.6/6 2509 1657169} Qb6 {+0.1/11 2939 628574} 10.Bg3 {+0.6/5 2461 403489} O-O {+0.0/12 2716 589059}
11.Be2 {+0.5/6 2411 2201352} e5 {+0.2/12 1670 318952} 12.a3 {+0.5/5 2367 456094} Bg4 {+0.2/14 3939 886973}
13.Rd2 {+0.5/6 2320 1599791} Bxf3 {+0.4/13 2071 458113} 14.Bxf3 {+0.4/6 2286 546215} Nd4 {+0.3/13 1663 330410}
15.Bd1 {+0.4/6 2236 1146456} Rac8 {+0.6/12 4224 835003} 16.f4 {+0.4/6 2193 2128326} Ne6 {+0.7/11 2922 552118}
17.fxe5 {+0.9/6 2153 692493} Rxc3 {+1.6/10 1567 326175} 18.bxc3 {+0.3/7 2108 1253015} d5 {+3.0/13 2466 466762}
19.c4 {-0.5/7 2073 1881262} dxc4 {+2.9/12 2146 486675} 20.Qf3 {-1.6/7 2034 1878508} Nxe4 {+6.2/12 1529 290025}
21.Bf2 {-1.8/6 2001 519356} Nxf2 {+7.2/11 1546 324634} 22.Rf1 {-4.4/6 1969 629894} Nd3+ {+11.1/15 1615 330009}
23.Rxd3 {-9.7/6 1941 1229192} c3 {+11.8/16 2539 507309} 24.Rxc3 {-10.0/7 1906 2015739} Bg5+ {+12.3/15 1801 419886}
25.Qf4 {-10.2/6 1873 425278} Bxf4+ {+12.5/14 1548 280570} 26.Rxf4 {-10.7/7 1848 1182365} Nxf4 {+12.6/15 2809 683623}
27.Rb3 {-11.1/7 1825 990366} Qd4 {+12.9/14 2296 585100} 28.a4 {-11.3/6 1792 901607} Qa1+ {+13.8/11 1462 367921}
29.Rb1 {-13.4/6 1789 908919} Nd3+ {+16.4/16 2110 517406} 30.Kd2 {-13.7/7 1740 1221066} Qxb1 {+16.8/15 1688 380149}
31.cxd3 {-14.0/7 1714 1261173} Qb2+ {+17.3/13 1974 523151} 32.Ke3 {-14.3/6 1687 1478162} Qxe5+ {+18.2/14 1614 381370}
33.Kf3 {-14.3/5 1664 359000} Re8 {+19.7/14 1868 421880} 34.Kg4 {-16.6/6 1643 1010515} Qxh2 {+23.0/16 2028 423930}
35.Kf3 {-18.2/7 1621 1406516} Qh5+ {+999.9/13 1642 490305} 36.g4 {-18.2/6 1602 1499587} Qh1+ {+999.9/17 1740 354090}
37.Kf2 {-19.2/6 1587 1521351} Qxd1 {+999.9/17 2654 540079} 38.g5 {M-3/6 1560 531223} Qxd3 {+1000.0/13 1422 272132}
39.gxh6 {M-2/6 1542 651012} Re2+ {+1000.0/14 1591 297618} 40.Kf1 {M-1/5 1530 889905} Qd1# {+1000.0/15 2481 482811}
0-1
[/pgn]
[pgn]
[Event "*"]
[Site "*"]
[Date "2023.03.06"]
[Time "10:16:24"]
[Round "*"]
[White "Celestial 1.0"]
[Black "Willow 2.5"]
[Result "0-1"]
[Termination "mate"]
[ECO "D80"]
[Opening "Gruenfeld defence"]
[TimeControl "60+1"]
[PlyCount "92"]
1.d4 Nf6 2.c4 g6
3.Nc3 d5 {-0.3/12 2173 504353} 4.e3 {+0.1/6 2785 780774; D80: Gruenfeld defence} Bg7 {-0.3/13 2377 520933}
5.cxd5 {+0.2/6 2730 1021868} Nxd5 {-0.4/13 3054 649299} 6.Qa4+ {+0.2/6 2672 1102440} Nc6 {-0.1/13 2508 548695}
7.Bb5 {+0.3/6 2612 723950} O-O {+0.2/13 2189 496251} 8.Bxc6 {+0.7/7 2568 3004734} bxc6 {+0.2/13 2112 475539}
9.Qxc6 {+1.1/7 2513 2522919} Be6 {+0.3/13 2630 622963} 10.Ne4 {+1.0/6 2456 807118} Nb4 {+0.7/13 2165 467209}
11.Qa4 {+0.8/6 2416 485871} Qd5 {+0.7/11 2102 452037} 12.Qxb4 {+0.8/6 2363 660946} Qxe4 {+0.6/13 1708 371981}
13.f3 {+0.9/6 2319 879787} Qh4+ {+0.6/13 1813 399148} 14.g3 {+1.1/6 2289 1732761} Qf6 {+0.5/13 2841 629436}
15.Qc5 {+0.8/6 2226 1631986} Rab8 {+0.4/12 5312 1150708} 16.Qxa7 {+1.6/6 2189 1757233} Bd5 {+0.6/12 1802 368330}
17.Qxc7 {+1.7/6 2156 883833} Rfc8 {+0.7/13 1710 403645} 18.Qf4 {+1.6/7 2110 2002688} Qxf4 {+0.3/15 3260 844004}
19.gxf4 {+1.5/7 2073 1345863} Rc2 {+0.3/12 2428 728144} 20.Kd1 {+1.7/6 2036 557968} Rbc8 {+0.5/12 1696 393621}
21.h4 {+1.3/7 2006 2423432} Rf2 {+0.6/13 1615 376500} 22.Ke1 {+1.6/6 1966 673893} Rcc2 {+0.7/13 1897 464010}
23.h5 {+2.0/7 1934 2252715} Bc4 {+0.5/13 2929 693839} 24.Nh3 {+1.9/7 1907 1639716} Rxf3 {+0.5/12 2289 551335}
25.hxg6 {+2.1/6 1877 575395} hxg6 {+0.5/14 2193 525269} 26.Kd1 {+1.9/7 1853 1647705} Re2 {+0.4/11 1922 436338}
27.b3 {+2.5/7 1816 1562391} Bd3 {+1.2/13 2047 507062} 28.Bd2 {+2.1/7 1797 1057241} Rg3 {+1.2/12 2619 553359}
29.Ng1 {+2.1/7 1762 1500607} Reg2 {+1.9/12 1985 501791} 30.Nh3 {+1.6/7 1737 911217} Bf5 {+1.9/14 1934 487749}
31.Nf2 {+0.4/7 1713 1314800} Rf3 {+2.0/14 2167 497172} 32.Be1 {+0.0/7 1688 943117} Rxe3 {+2.0/14 1711 397770}
33.Rc1 {-0.2/7 1668 1207133} Rf3 {+2.0/12 2295 446596} 34.Ke2 {-0.4/7 1646 1178778} Rxf4 {+2.1/13 1532 331540}
35.d5 {-0.4/6 1623 565879} Bd4 {+2.7/14 1583 370200} 36.Rc4 {-1.0/7 1602 1385705} Rfxf2+ {+2.7/13 2329 554509}
37.Bxf2 {-1.2/7 1587 1279752} Rxf2+ {+3.2/15 2015 469133} 38.Ke1 {-1.4/7 1566 1320209} Be3 {+3.2/16 1946 454824}
39.Ra4 {-1.4/7 1551 567187} Rb2 {+5.0/14 1566 350553} 40.Ra8+ {-1.3/6 1525 176354} Kg7 {+8.6/13 1857 337621}
41.Rah8 {-3.6/6 1518 476996} Bd3 {+999.9/20 1629 244168} 42.R8h7+ {M-5/7 1494 1280602} Kf6 {+999.9/19 1519 308263}
43.Rxf7+ {M-4/7 1480 1146384} Kxf7 {+999.9/19 1374 275237} 44.Rh7+ {M-3/7 1459 626254} Kf6 {+1000.0/16 1344 271282}
45.Rf7+ {M-2/7 1442 435808} Kxf7 {+1000.0/18 1992 388255} 46.a4 {M-1/7 1429 685507} Rb1# {+1000.0/16 1931 372511}
0-1
[/pgn]
[pgn][Event "*"]
[Site "*"]
[Date "2023.03.06"]
[Time "10:18:15"]
[Round "*"]
[White "Willow 2.5"]
[Black "Celestial 1.0"]
[Result "1-0"]
[Termination "mate"]
[ECO "C53"]
[Opening "Giuoco Piano"]
[TimeControl "60+1"]
[PlyCount "81"]
1.e4 e5 2.Nf3 Nc6
3.Bc4 Bc5 {-0.1/6 2788 1063148} 4.c3 {+0.6/13 2295 401340} Qf6 {+0.3/6 2728 1317326; C53: Giuoco Piano}
5.O-O {+0.9/11 1737 310735} d6 {+0.3/6 2672 2496696} 6.h3 {+0.8/10 3265 633897} Bd7 {+0.4/5 2612 598288}
7.b4 {+1.0/12 2915 543483} Bb6 {+0.4/6 2560 1194914} 8.d3 {+1.0/11 1963 362715} Be6 {+0.4/5 2509 492312}
9.Nbd2 {+1.0/12 2330 402151} Bd7 {+0.3/6 2460 1499175} 10.a4 {+1.3/12 1961 352800} a5 {+0.3/5 2409 596255}
11.b5 {+1.4/12 1864 352684} Nd8 {+0.2/6 2367 1440395} 12.Ba2 {+1.4/12 3317 645887} Qg6 {+0.3/5 2319 416225}
13.Nc4 {+1.0/13 3629 716245} Bxh3 {+0.6/6 2272 963771} 14.Nh4 {+1.0/14 2056 341968} Qf6 {+0.7/6 2229 425944}
15.Nxb6 {+1.0/14 2001 263212} cxb6 {+0.8/7 2191 1279369} 16.Qh5 {+0.8/14 5280 980405} g6 {+0.8/7 2147 1636676}
17.Qg5 {+0.9/11 2784 629381} Qxg5 {+0.7/8 2115 1947726} 18.Bxg5 {+0.6/13 1553 443435} Bg4 {+0.6/7 2077 846771}
19.Be3 {+0.9/14 2156 641615} Be2 {+0.8/7 2039 1571626} 20.Rfe1 {+1.1/15 3666 1080448} Bxd3 {+0.6/7 2004 795645}
21.Rad1 {+1.6/14 1880 511079} Bxe4 {+0.4/7 1973 1163877} 22.Rxd6 {+1.7/13 2865 744638} Ke7 {+0.3/6 1936 529458}
23.Rxb6 {+2.1/13 2142 481258} Kd7 {+0.1/6 1910 798825} 24.Bc5 {+2.4/13 1688 387775} Bc2 {-0.4/7 1875 2210967}
25.Rxe5 {+3.0/12 2030 453454} Bxa4 {-0.4/6 1848 747236} 26.Rd6+ {+4.6/13 1498 338877} Kc7 {-2.0/6 1820 1680746}
27.Red5 {+6.6/15 2285 513473} Ne7 {-3.0/7 1792 2138648} 28.Bb6+ {+6.5/11 1678 426871} Kb8 {-3.8/6 1763 520908}
29.Rxd8+ {+10.5/18 1581 434148} Rxd8 {-7.3/7 1739 1080288} 30.Rxd8+ {+10.4/15 2275 786147} Nc8 {-7.3/7 1712 1837056}
31.Bxf7 {+12.6/17 2059 590376} Ra6 {-9.4/7 1693 1082609} 32.bxa6 {+12.6/16 1505 434563} bxa6 {-10.1/7 1668 570131}
33.Bxa5 {+11.3/16 1475 454103} Bc6 {-10.4/7 1652 777335} 34.Be6 {+12.7/12 1470 447506} Bb7 {-12.1/7 1626 670425}
35.c4 {+14.2/15 1992 561738} g5 {-11.9/8 1604 2136845} 36.Nf5 {+30.9/14 2130 506466} Ka7 {-12.1/7 1582 738061}
37.Bxc8 {+999.9/14 1469 290935} Bxc8 {-12.9/7 1562 370540} 38.Rxc8 {+999.9/18 1996 408604} h5 {M-3/7 1545 441710}
39.c5 {+1000.0/18 3501 727079} Kb7 {M-2/8 1526 1542867} 40.Nd6+ {+1000.0/18 2917 556259} Ka7 {M-1/7 1511 1769515}
41.Bb6# {+1000.0/18 2617 540092} 1-0
[/pgn]
[pgn]
[Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "Willow 1.6"]
[Black "Willow 1.5"]
[Result "1-0"]
1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. Nf3 Nc6 6. e6 fxe6 7. Nc3 g6 8. d5 Ne5
9. Nxe5 dxe5 10. Be3 Bg7 11. Be2 O-O 12. Qb3 exd5 13. cxd5 Rf7 14. O-O Bf5 15.
Rad1 Rc8 16. h3 a5 17. a3 h6 18. g4 Bd7 19. Bd3 a4 20. Qc2 g5 21. Be2 Be8 22.
Bd3 Bd7 23. Rfe1 Rf3 24. Bf1 Be8 25. Bg2 Rf8 26. Be4 Nc4 27. Bc5 Nd6 28. Bg2 b6
29. Be3 b5 30. Bc5 Bf7 31. Re3 Qd7 32. Rde1 Nc4 33. R3e2 Rcd8 34. Be4 Qe8 35.
Bf5 Kh8 36. Be4 Nd6 37. Bd3 Qd7 38. Rxe5 Bxe5 39. Rxe5 Rfe8 40. Bh7 Kg7 41. Re6
Qc8 42. Qd3 Kf8 43. Rxh6 Kg7 44. Rg6+ Kxh7 45. Rxg5+ Kh8 46. Qg3 *
[/pgn]
Willow 2.5 (first release)
Moderator: Ras
-
Whiskers
- Posts: 246
- Joined: Tue Jan 31, 2023 4:34 pm
- Full name: Adam Kulju
-
Roland Chastain
- Posts: 692
- Joined: Sat Jun 08, 2013 10:07 am
- Location: France
- Full name: Roland Chastain
Re: Willow 2.5 (first release)
Hello!
Where can we find lbfgs.h please?
Is it this project?
Where can we find lbfgs.h please?
Is it this project?
Code: Select all
[roland@localhost Willow-2.5]$ LC_ALL=C gcc -o willow program.c
program.c:8:10: fatal error: lbfgs.h: No such file or directory
8 | #include <lbfgs.h>
| ^~~~~~~~~
compilation terminated.
[roland@localhost Willow-2.5]$ -
Whiskers
- Posts: 246
- Joined: Tue Jan 31, 2023 4:34 pm
- Full name: Adam Kulju
Re: Willow 2.5 (first release)
Oh wait what? I used that for my texel tuning program. I don’t know how it got into my main program. Will fix right now, thank you!Roland Chastain wrote: ↑Mon Mar 06, 2023 8:09 pm Hello!
Where can we find lbfgs.h please?
Is it this project?
Code: Select all
[roland@localhost Willow-2.5]$ LC_ALL=C gcc -o willow program.c program.c:8:10: fatal error: lbfgs.h: No such file or directory 8 | #include <lbfgs.h> | ^~~~~~~~~ compilation terminated. [roland@localhost Willow-2.5]$
go and star https://github.com/Adam-Kulju/Patricia!
-
Whiskers
- Posts: 246
- Joined: Tue Jan 31, 2023 4:34 pm
- Full name: Adam Kulju
Re: Willow 2.5 (first release)
The source code has been updated, it now has no "include <lbfgs.h> (https://github.com/Adam-Kulju/Willow/bl ... /program.c)Roland Chastain wrote: ↑Mon Mar 06, 2023 8:09 pm Hello!
Where can we find lbfgs.h please?
Is it this project?
Code: Select all
[roland@localhost Willow-2.5]$ LC_ALL=C gcc -o willow program.c program.c:8:10: fatal error: lbfgs.h: No such file or directory 8 | #include <lbfgs.h> | ^~~~~~~~~ compilation terminated. [roland@localhost Willow-2.5]$
And yes you are correct, it was that site. I don't need that library for the actual chess engine though.
go and star https://github.com/Adam-Kulju/Patricia!
-
Whiskers
- Posts: 246
- Joined: Tue Jan 31, 2023 4:34 pm
- Full name: Adam Kulju
Re: Willow 2.5 (first release)
And... now my laptop is screaming about viruses. It's my own executable!!! sigh
go and star https://github.com/Adam-Kulju/Patricia!
-
Whiskers
- Posts: 246
- Joined: Tue Jan 31, 2023 4:34 pm
- Full name: Adam Kulju
Re: Willow 2.5 (first release)
I think I got it to work now. This includes the newest source code and a new executable
https://github.com/Adam-Kulju/Willow/re ... tag/2.5.01
https://github.com/Adam-Kulju/Willow/re ... tag/2.5.01
go and star https://github.com/Adam-Kulju/Patricia!
-
Roland Chastain
- Posts: 692
- Joined: Sat Jun 08, 2013 10:07 am
- Location: France
- Full name: Roland Chastain
Re: Willow 2.5 (first release)
In case you would be interested in doing a multiplatform engine, here are the quick modifications that I made to compile your latest code under Linux:
I compiled it like this:
Code: Select all
#ifdef _WIN32
#include <Windows.h>
#include <io.h>
#else
#include <sys/ioctl.h>
#include <unistd.h>
#endif
#ifdef _WIN32
int pipe;
HANDLE hstdin;
#endif
int InputPending()
/* http://talkchess.com/forum3/viewtopic.php?p=943992#p943992 */
{ // checks for waiting input in pipe
#ifdef _WIN32
int init; HANDLE inp; DWORD cnt = 0;
if(!init) inp = GetStdHandle(STD_INPUT_HANDLE);
if (!PeekNamedPipe(inp, NULL, 0, NULL, &cnt, NULL)){exit(1);}
#else
int cnt;
if (ioctl(0, FIONREAD, &cnt)) return 1;
#endif
return cnt;
}
int init(){
#ifdef _WIN32
unsigned int dw;
hstdin = GetStdHandle(STD_INPUT_HANDLE);
pipe = !GetConsoleMode(hstdin, &dw);
if (!pipe) {
SetConsoleMode(hstdin,dw&~(ENABLE_MOUSE_INPUT|ENABLE_WINDOW_INPUT));
FlushConsoleInputBuffer(hstdin);
} else {
setvbuf(stdin,NULL,_IONBF,0);
setvbuf(stdout,NULL,_IONBF,0);
}
#endif
printf("Willow 2.5, by Adam Kulju\n");
return 0;
}Code: Select all
gcc -o willow program.c -lm-
Gabor Szots
- Posts: 1482
- Joined: Sat Jul 21, 2018 7:43 am
- Location: Budapest, Hungary
- Full name: Gabor Szots
Re: Willow 2.5 (first release)
It does not work for me:Whiskers wrote: ↑Tue Mar 07, 2023 1:55 am I think I got it to work now. This includes the newest source code and a new executable
https://github.com/Adam-Kulju/Willow/re ... tag/2.5.01
program.c: In function 'move_to_uci':
program.c16: error: expected '(' before 'isalpha'
1327 | if isalpha(uci[4]){temp[5] = toupper(uci[4]);}
| ^~~~~~~
| (
program.c: In function 'init':
program.c36: warning: passing argument 2 of 'GetConsoleMode' from incompatible pointer type [-Wincompatible-pointer-types]
1384 | pipe = !GetConsoleMode(hstdin, &dw);
| ^~~
| |
| unsigned int *
In file included from c:/msys64/mingw64/include/Windows.h:74,
from program.c:8:
c:/msys64/mingw64/include/wincon.h:234:74: note: expected 'LPDWORD' {aka 'long unsigned int *'} but argument is of type 'unsigned int *'
234 | WINBASEAPI WINBOOL WINAPI GetConsoleMode(HANDLE hConsoleHandle,LPDWORD lpMode);
| ~~~~~~~~^~~~~~
Gabor Szots
CCRL testing group
CCRL testing group
-
Guenther
- Posts: 4718
- Joined: Wed Oct 01, 2008 6:33 am
- Location: Regensburg, Germany
- Full name: Guenther Simon
Re: Willow 2.5 (first release)
My gcc version in msys2 also nitpicked about this yesterday, but inserting brackets to the condition made it.Gabor Szots wrote: ↑Tue Mar 07, 2023 9:12 amIt does not work for me:Whiskers wrote: ↑Tue Mar 07, 2023 1:55 am I think I got it to work now. This includes the newest source code and a new executable
https://github.com/Adam-Kulju/Willow/re ... tag/2.5.01
program.c: In function 'move_to_uci':
program.c:1327:16: error: expected '(' before 'isalpha'
1327 | if isalpha(uci[4]){temp[5] = toupper(uci[4]);}
| ^~~~~~~
| (
program.c: In function 'init':
program.c:1384:36: warning: passing argument 2 of 'GetConsoleMode' from incompatible pointer type [-Wincompatible-pointer-types]
1384 | pipe = !GetConsoleMode(hstdin, &dw);
| ^~~
| |
| unsigned int *
In file included from c:/msys64/mingw64/include/Windows.h:74,
from program.c:8:
c:/msys64/mingw64/include/wincon.h:234:74: note: expected 'LPDWORD' {aka 'long unsigned int *'} but argument is of type 'unsigned int *'
234 | WINBASEAPI WINBOOL WINAPI GetConsoleMode(HANDLE hConsoleHandle,LPDWORD lpMode);
| ~~~~~~~~^~~~~~
Code: Select all
if (isalpha(uci[4])){temp[5] = toupper(uci[4]);}-
Gabor Szots
- Posts: 1482
- Joined: Sat Jul 21, 2018 7:43 am
- Location: Budapest, Hungary
- Full name: Gabor Szots