lichess.org
Donate
Jja: Jin, Jîyan, Azadî

Can Ferman Gülmez

Introducing jja 0.4.0

Software DevelopmentChess botChess engineAnalysis
Advanced PolyGlot Book Making with PGN Files

In our previous blog post, we introduced you to jja, the ultimate chess file format Swiss Army knife. Now, we are excited to announce the release of jja 0.4.0 with a prime new feature: PolyGlot book making using PGN files.

PGN Book Making

Since version 0.4.0, jja can make PolyGlot books out of PGN files. This feature is similar to polyglot make-book but with several differences:

  1. jja may directly read compressed PGN files (e.g., .pgn.bz2, .pgn.gz, .pgn.lz4, .pgn.zst).
  2. jja can process PGN files bigger than your system's available memory by persisting statistics in a temporary RocksDB database.
  3. jja scales move weights by default to prevent potential overflows with huge PGN files. Use --no-scale to disable.
  4. jja can filter moves using Filter Expressions, allowing users to filter out unwanted games and create specialized opening books.

Filter Expressions

The filter expression string should contain filter conditions, which consist of a tag name, a comparison operator, and a value. The following operators are supported:

  • > (greater than)
  • >= (greater than or equal to)
  • < (less than)
  • <= (less than or equal to)
  • = (equal to)
  • != (not equal to)
  • =~ (regex match, case insensitive)
  • !~ (negated regex match, case insensitive)

Filter conditions can be combined using the following logical operators:

  • AND (logical AND)
  • OR (logical OR)

Example:
--filter="Event =~ World AND White =~ Carlsen AND ( Result = 1-0 OR ECO = B33 )"
Supported tags are Event, Site, Date, UTCDate, Round, Black, White, Result, BlackElo, WhiteElo, BlackRatingDiff, WhiteRatingDiff, BlackTitle, WhiteTitle, ECO, Opening, TimeControl, Termination, and ScidFlags.
In addition to these are four special variables, namely, Player, Elo, Title, and RatingDiff. These variables may be used to match the relevant header from either one of the sides. E.g the filter:
--filter="Player =~ Carlsen"
is functionally equivalent to
--filter="( White =~ Carlsen OR Black =~ Carlsen )"
For more information on filter expressions, consult the jja documentation.

Community Generated Books

We have generated five books for the community to try out:

  1. lichess-201301-202303-2800+.bin.zst
  2. lichess-201301-202303-3000+.bin.zst
  3. lichess-201301-202303-elo2400.bin.zst
  4. lichess-201301-202303-gm2600.bin.zst
  5. lichess-201301-202303-magnus.bin.zst

The books are released under the Creative Commons CC0 license. Use them for research, commercial purpose, publication, anything you like. You can download, modify and redistribute them, without asking for permission. For more information on the book generation procedure, please refer to our issue tracker.

Summary of Changes

In summary, the major changes in jja version 0.4.0 include:

  1. Support for creating PolyGlot books from PGN files, including compressed PGN files.
  2. Introduction of Filter Expressions for more refined book creation.
  3. Improved performance and memory management when handling large PGN files.
  4. Updates to several dependencies for better maintainability and functionality.
  5. Multithreading support for the match command.

Installing jja 0.4.0

In this section, we will provide a brief guide on how to install the new version of jja.

To compile jja from source, use the command cargo install jja. You will need to have the Rust Toolchain installed, as well as OpenSSL libraries for UNIX systems, and liburing on Linux. If you're on a Linux system older than version 5.1 or cannot install liburing, you can disable the feature by building jja with cargo install jja --no-default-features.

Alternatively, you can download the release builds of jja for 64-bit Linux and Windows systems from chesswob.org. These versions are signed by GnuPG, using key D076A377FB27DE70.

To install, follow these steps:

  1. Acquire the latest version of jja from chesswob.org.
  2. Verify the checksum and the GnuPG signature by running the commands provided in the readme file.
  3. Install the binary to your preferred location.

You can also download the latest git version builds from the SourceHut buildserver. There are three available flavors: windows, linux-glibc, and linux-musl. Browse to the latest build and download the artifact listed on the left. Note that these artifacts are kept for 90 days.

By following these installation instructions, you can get started with the latest version of jja and enjoy its new features and improvements.

Final Thoughts

With the release of jja 0.4.0, advanced chess players can now benefit from the new PolyGlot book-making feature using PGN files, as well as the improved performance and usability enhancements. We hope that these new capabilities will help you take your chess game to the next level.

Feel free to try out the five PolyGlot books we have generated for the community, available through the links provided earlier in this post. We look forward to hearing your feedback and continuing to enhance jja to better serve the needs of chess players around the world.

Happy chess playing! Gens una sumus!