New release: AdaChess v.3.9.0-dev

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

alessandro
Posts: 51
Joined: Tue Aug 12, 2014 11:21 am
Location: Lund
Full name: Alessandro Iavicoli

New release: AdaChess v.3.9.0-dev

Post by alessandro »

Hi eveyone!

After more than 3 years of silence, through the pandemic where I've worked almost nothing to the engine, I'm happy to announce a new release of AdaChess, stable and ready for testing before the "official" release. The engine is very stable but contains a couple of minor bugs that do not affect the program in a major way.

The engine (source code and windows executable) can be downloaded from here: https://www.adachess.com/download

The estimated rank is 2200-2400 Elo - I hope so, after so much work!

Note: if you experience some problem with the executable you have to compile the engine yourself, via the gnat compiler, with the release flag (contact me, in this case). This may happes due to my laptop architecture. Please inform me if this happes, thansk!
Please report me any kind of bug or strange behavior, so I can fix them :)


PS: good luck and enjoy!

Features implemented
This release contains many important news listed below.
  • The overall source code has been completely refactored and the file system updated to a more engineering version.
  • A new I/O routines substitute the old and simple one providing many useful internal features
  • The communication protocol has been rewritten to provide base for a future support for the UCI protocol (that is planned in the next release)
    The old multi-dimensional array of moves has been replaced to a more efficient single dimensional array, a move stack (like probably every other engine has)
  • Support the following notation: Winboard (e2e4, g7g8q, e1g1, ..), algebraic (Nf4, Bcxf5+, O-O, ..), long algebraic (Nf1-g3, Qe1xe7+, ...) and the ICCF (see: https://en.wikipedia.org/wiki/ICCF_numeric_notation). Specify the notation at startup via command line
  • Fixed a bug with notation on moves that gives double-check (was a single "+", now is "++")
  • A simple easter-egg has been added - find it by yourself! ;)
  • Statistical data has been added to the Divide command (see below)
  • Both perft and divide can output with any of the supported notation
  • The opening book code has been rewritten: the engine support the simple opening book format and can use any PGN as opening book. It can load multiple opening book. The current release comes with a pgn example, the games of Alechine. Note that the PGN parser is very slow, be carefoul in running AdaChess with huge PGN.
  • The evaluation function has been completely rewritten to be more efficient (it is still a work in progress, though). It implements a more advanced pawn structure evaluation and improved mobility, fixed king-safety and some small further improvement. It does not detect anymore draw by insufficient material (will be restored soon)
  • The time control, to control the chess clock, has been completely rewritten to support any rule of chess. It contains a minor bug that will be fixed for the next release
  • SEE: The static exchange evaluation has been rewritten. AdaChess implements now a more intelligent algorithm based on attacks/defends map
  • Null move observation improved, adding information for mate threath
  • Fixed the futility pruning
  • Added razoring and reverse futility pruning
  • Move generator for quiescence rewritten taking advantage of the engine smar move generator. The quiescence generates not only captures, but every move of tactical importance
  • Added the aspiration window algorithm to the "Think" functionality
  • Fix the ponder engine (still have some issue, nothing serious)
  • A simple, very simple, multi-pv algorithm has been introduced. Specify the amount the pv via command line
  • Algorithm to mirror position implemented
  • Many other small improvement and optimizations...

Example of command line instructions:
To start the engine with a specific opening book just run with (as example)

Code: Select all

adachess.exe --opening-book Alechine.pgn --opening-book book.pgn
single or multiple command line instruction can be specified.

To start the engine with a desired notation run (as example)

Code: Select all

adachess.exe --notation san
other notations are winboard | san | lan | iccf

To start the engine with a certain Mb for the hash table (for example)

Code: Select all

adachess.exe --hash 32
or via the memory command via winboard

To run the engine with multiple pv-search (for example)

Code: Select all

adachess.exe --multi-pv 2
it is however not really useful to run in multi-pv mode since it support very basically

Example of Divide command with algebraic notation from a generic position:

Code: Select all

AdaChess v.3.9.0-dev => divide 4
Move                 Nodes        Captures      En-Passant         Castles      Promotions          Checks    Discovery C.       Double C.      Checkmates
Kh1                  54982            4074               0               0               0             575               0               0              73
Kf1                  52277            3976               0               0               0            2176               0               0               0
f3                   51510            3989               0               0               0            1843               0               0              41
f4                   51627            4040               0               0               0            1812               0               0              29
g3                   52443            3967               0               0               0             897               0               0               0
g4                   54830            4239               0               0               0            1049               1               0               0
Rd8                  46059            5303               0               0               0             830               0               0              59
...
--
AdaChess - Smart Chess Engine - https://github.com/adachess/AdaChess

Image
User avatar
algerbrex
Posts: 596
Joined: Sun May 30, 2021 5:03 am
Location: United States
Full name: Christian Dean

Re: New release: AdaChess v.3.9.0-dev

Post by algerbrex »

Hi Alessandro, congratulations on the new release!

When I first started getting into chess programming, AdaChess always proved to be a very reliable sparring partner for Blunder, as well as a frustratingly formidable opponent :wink: So glad to see you're still working on it.
User avatar
Roland Chastain
Posts: 657
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Re: New release: AdaChess v.3.9.0-dev

Post by Roland Chastain »

Hello!

Is it possible to build the engine for Linux?

I installed gcc-gnat ("Ada 95 support for gcc") but I don't know how to use it.

Regards.

Roland
Qui trop embrasse mal étreint.
zamfofex
Posts: 26
Joined: Wed Feb 16, 2022 6:21 am
Full name: P. M. Zamboni

Re: New release: AdaChess v.3.9.0-dev

Post by zamfofex »

After installing the ‘gnat’ package (to obtain ‘gnatmake’), I was able to compile it using the following command (from within the ‘src’ subdirectory):

Code: Select all

gnatmake -Ilibs/{timers,string}_lib adachess.adb
(Using non‐POSIX Bash braces syntax.)

This should automatically invoke GCC to compile the sources and link them into an ‘adachess’ executable.
alessandro
Posts: 51
Joined: Tue Aug 12, 2014 11:21 am
Location: Lund
Full name: Alessandro Iavicoli

Re: New release: AdaChess v.3.9.0-dev

Post by alessandro »

Roland Chastain wrote: Sat Jul 23, 2022 5:55 am Hello!

Is it possible to build the engine for Linux?

I installed gcc-gnat ("Ada 95 support for gcc") but I don't know how to use it.

Regards.

Roland
It should be possible, I don't expect any issue on that.
You might prefer to use gprbuild to compile

Code: Select all

gprbuild adachess.gpr -XMode=release
as it behave like a makefile for other languages.

AdaChess use extensively the Ada2012 instructions, so you need a gcc-gnat compatible with it.

And that is one of (one of, but not the main one) the reason why I just released this version: soon the Ada2022 language specification will be published and I'm going to migrate the source to the new version ;)
--
AdaChess - Smart Chess Engine - https://github.com/adachess/AdaChess

Image
alessandro
Posts: 51
Joined: Tue Aug 12, 2014 11:21 am
Location: Lund
Full name: Alessandro Iavicoli

Re: New release: AdaChess v.3.9.0-dev

Post by alessandro »

algerbrex wrote: Sat Jul 23, 2022 1:25 am Hi Alessandro, congratulations on the new release!

When I first started getting into chess programming, AdaChess always proved to be a very reliable sparring partner for Blunder, as well as a frustratingly formidable opponent :wink: So glad to see you're still working on it.
Wow I'm really happy to hear that!
This release should be a bit stronger than the previous one. This should encourage you to work on Blunder and having a lot of fun with your engine! Good luck!
--
AdaChess - Smart Chess Engine - https://github.com/adachess/AdaChess

Image
User avatar
Roland Chastain
Posts: 657
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Re: New release: AdaChess v.3.9.0-dev

Post by Roland Chastain »

zamfofex wrote: Sat Jul 23, 2022 7:06 am After installing the ‘gnat’ package (to obtain ‘gnatmake’), I was able to compile it using the following command (from within the ‘src’ subdirectory):

Code: Select all

gnatmake -Ilibs/{timers,string}_lib adachess.adb
Yes, it works. Thanks!
alessandro wrote: Sat Jul 23, 2022 9:31 am You might prefer to use gprbuild to compile

Code: Select all

gprbuild adachess.gpr -XMode=release
as it behave like a makefile for other languages.
Thank you for the information.

Regards.

Roland
Qui trop embrasse mal étreint.
brocksav
Posts: 4
Joined: Mon Aug 01, 2022 2:13 pm
Full name: Brock Savage

Re: New release: AdaChess v.3.9.0-dev

Post by brocksav »

I don't know Ada, and will probably never learn it, but I just want to say that AdaChess is the best debugging aid I've found for people writing their own engine. Its perft and divide commands break everything down not only into nodes, but captures, checks, castles, eps, etc. The wiki has this for a handful of positions, but AdaChess lets you enter any position (in this new release, the command is "setboard" followed by a FEN), and it's the only open source engine I've found that does so. Stockfish is faster, unbelievably fast really, but AFAIK it only gives the nodes, not the whole breakdown.

Thanks very much for sharing this invaluable resource.
alessandro
Posts: 51
Joined: Tue Aug 12, 2014 11:21 am
Location: Lund
Full name: Alessandro Iavicoli

Re: New release: AdaChess v.3.9.0-dev

Post by alessandro »

brocksav wrote: Thu Aug 11, 2022 11:48 pm I don't know Ada, and will probably never learn it, but I just want to say that AdaChess is the best debugging aid I've found for people writing their own engine. Its perft and divide commands break everything down not only into nodes, but captures, checks, castles, eps, etc. The wiki has this for a handful of positions, but AdaChess lets you enter any position (in this new release, the command is "setboard" followed by a FEN), and it's the only open source engine I've found that does so. Stockfish is faster, unbelievably fast really, but AFAIK it only gives the nodes, not the whole breakdown.

Thanks very much for sharing this invaluable resource.
Hey Brock, thank you very much to demonstrate genuite interenst in AdaChess and in the work I'm doing with it. It is always nice to receive good feedback! A big hug!
--
AdaChess - Smart Chess Engine - https://github.com/adachess/AdaChess

Image
macsmol
Posts: 5
Joined: Sat Jun 15, 2024 4:43 pm
Full name: Maciej Smolczewski

Re: New release: AdaChess v.3.9.0-dev

Post by macsmol »

alessandro wrote: Fri Jul 22, 2022 9:15 pm
Example of Divide command with algebraic notation from a generic position:

Code: Select all

AdaChess v.3.9.0-dev => divide 4
Move                 Nodes        Captures      En-Passant         Castles      Promotions          Checks    Discovery C.       Double C.      Checkmates
Kh1                  54982            4074               0               0               0             575               0               0              73
Kf1                  52277            3976               0               0               0            2176               0               0               0
f3                   51510            3989               0               0               0            1843               0               0              41
f4                   51627            4040               0               0               0            1812               0               0              29
g3                   52443            3967               0               0               0             897               0               0               0
g4                   54830            4239               0               0               0            1049               1               0               0
Rd8                  46059            5303               0               0               0             830               0               0              59
...
Hi! Thank you for creating this! What a great discovery! I just I've just discovered a bug in my engine's (tactical) movegen. It is producing wrong count of captures from starting position. And AdaChess comes to save the day - I can start investigating the bug right away!

And by the way.. Maybe I can convince you to program another small feature? :)
My engine in quiescence search investigates not only captures but also promotions. So I'm looking some engine with perft-divide that counts every node that changes material (captures and promotions together).
And I can't crosscheck it with data produced by AdaChess because you have promotions and checks split up. And obviously summing up two columns from AdaChess output does not solve the problem because some promotions are captures as well and we don't want to count these twice.
So would you consider adding such column to your statistics? :wink: