jja: convert CTG books to PolyGlot format (and more!)

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
alpltl
Posts: 57
Joined: Tue Mar 14, 2023 3:04 pm
Location: Berlin
Full name: Ali Polatel

Re: jja: convert CTG books to PolyGlot format (and more!)

Post by alpltl »

Thank you for sharing the information about the 'openbook' program by Graham O'Neil. It looks very interesting, and I will definitely check it out. In particular, it might help me identify some of the Arena header data that I haven't been able to make sense of yet.

Regarding the potential issues with large opening books, I took special care during the PGN-making process in jja to ensure that it can handle them effectively. jja's PGN-making feature has been designed to work well with large opening books, so I hope that you won't encounter any issues in this regard.

As for a win64 interface, I'm happy to inform you that I release a signed version of a win64 build on https://chesswob.org/jja. Moreover, for every git push, there's an autogenerated windows64 build available at https://builds.sr.ht/~alip/jja/commits/main/windows.yml. To access it, simply enter the latest build and download the "jja.exe" artifact on the left. Please note that these artifacts are kept for 90 days.

I hope this information is helpful, and please feel free to reach out if you have any further questions or suggestions.
Caissa-AI, Caissa-Test, and Caissa-X on LiChess
ChessWoB: Chess without Boundaries
jja: Jin, Jîyan, Azadî!
Follow @alip on Mastodon!
chesskobra
Posts: 347
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: jja: convert CTG books to PolyGlot format (and more!)

Post by chesskobra »

alpltl wrote: Sun Apr 16, 2023 12:26 pm
1. It's mentioned in the blog post. See here: https://www.chesswob.org/jja/books/
2. Not yet, although I plan to do this at some point, I opened an issue in our issue tracker so you can follow progress easily: https://todo.sr.ht/~alip/jja/8
Thank you. Just to add a little context, I have created several books using polyglot as follows. I used a database of games after 1981, where both players are rated 2400+. Then I created many books with -mingame 64/128/.../1024 option to polyglot, to obtain smaller and smaller books. But then I really wish to know what these lines are that have been played 1000+ times. The idea is if one wants to study openings, one could start with these main lines and then gradually broaden. Also, there are many bin books available on the internet, and scid itself includes 4, but it is often unclear what has gone into these books.
User avatar
alpltl
Posts: 57
Joined: Tue Mar 14, 2023 3:04 pm
Location: Berlin
Full name: Ali Polatel

Re: jja: convert CTG books to PolyGlot format (and more!)

Post by alpltl »

chesskobra wrote: Mon Apr 17, 2023 1:08 pm Thank you. Just to add a little context, I have created several books using polyglot as follows. I used a database of games after 1981, where both players are rated 2400+. Then I created many books with -mingame 64/128/.../1024 option to polyglot, to obtain smaller and smaller books. But then I really wish to know what these lines are that have been played 1000+ times. The idea is if one wants to study openings, one could start with these main lines and then gradually broaden. Also, there are many bin books available on the internet, and scid itself includes 4, but it is often unclear what has gone into these books.
You're welcome. The fact that we have some similar functionality already in jja, this should be easy to implement. I'll update when it's done.
Try

Code: Select all

jja find --tree=<max-ply>
to get a tree of lines in the book. E.g:

Code: Select all

alip@rosarote:~/src/jja|main⚡ ⇒  jja find -p"e4 e5 Nf3 Nc6 Bb5" -t5 ~/org/books/bin/Perfect2021.bin
r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R b KQkq -
├── a6
│   └── Ba4
│       ├── Nf6
│       │   ├── O-O
│       │   │   ├── Be7
│       │   │   ├── b5
│       │   │   └── Nxe4
│       │   └── d3
│       │       └── d6
│       └── Be7
│           ├── O-O
│           └── c3
│               └── Nf6
└── Nf6
    ├── O-O
    │   └── Nxe4
    │       ├── d4
    │       │   └── Nd6
    │       └── Re1
    │           └── Nd6
    └── d3
        └── Bc5
            ├── c3
            │   └── O-O
            ├── Bxc6
            │   └── dxc6
            └── Nbd2
                ├── O-O
                └── Nd4
Caissa-AI, Caissa-Test, and Caissa-X on LiChess
ChessWoB: Chess without Boundaries
jja: Jin, Jîyan, Azadî!
Follow @alip on Mastodon!
chesskobra
Posts: 347
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: jja: convert CTG books to PolyGlot format (and more!)

Post by chesskobra »

This is very nice. I will soon try this on the books I have created.
chesskobra
Posts: 347
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: jja: convert CTG books to PolyGlot format (and more!)

Post by chesskobra »

A couple of questions:

How to uninstall? I ask because if a new version comes out, we would like to update. I am already able to run the bin file (on linux). Does sudo install simply copy it somewhere or does something more?

Is it possible to print a table view instead of a tree view for the command that you showed above? I don't know about others but something like the tables in Nunn's Chess Openings is much more compact and easier to read for me. But the above command is already very useful.
User avatar
alpltl
Posts: 57
Joined: Tue Mar 14, 2023 3:04 pm
Location: Berlin
Full name: Ali Polatel

Re: jja: convert CTG books to PolyGlot format (and more!)

Post by alpltl »

chesskobra wrote: Wed Apr 19, 2023 11:40 am How to uninstall? I ask because if a new version comes out, we would like to update. I am already able to run the bin file (on linux). Does sudo install simply copy it somewhere or does something more?
Just remove the jja binary and you're done. install command does not do anything behind your back.
chesskobra wrote: Wed Apr 19, 2023 11:40 am Is it possible to print a table view instead of a tree view for the command that you showed above? I don't know about others but something like the tables in Nunn's Chess Openings is much more compact and easier to read for me. But the above command is already very useful.
I am glad you found the tree option useful. I agree that a table would've been easier to read but it is also much more complicated to implement. I've opened an issue about this, but I am not making any promises: https://todo.sr.ht/~alip/jja/9.
Caissa-AI, Caissa-Test, and Caissa-X on LiChess
ChessWoB: Chess without Boundaries
jja: Jin, Jîyan, Azadî!
Follow @alip on Mastodon!
chesskobra
Posts: 347
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: jja: convert CTG books to PolyGlot format (and more!)

Post by chesskobra »

alpltl wrote: Wed Apr 19, 2023 5:45 pm
I am glad you found the tree option useful. I agree that a table would've been easier to read but it is also much more complicated to implement. I've opened an issue about this, but I am not making any promises: https://todo.sr.ht/~alip/jja/9.
I didn't imagine that it would be more complicated to print it as table. I think MCO shows variations as columns and NCO shows them as rows. Maybe printing in NCO style is easier.
User avatar
alpltl
Posts: 57
Joined: Tue Mar 14, 2023 3:04 pm
Location: Berlin
Full name: Ali Polatel

Re: jja: convert CTG books to PolyGlot format (and more!)

Post by alpltl »

chesskobra wrote: Fri Apr 21, 2023 7:07 pm I didn't imagine that it would be more complicated to print it as table. I think MCO shows variations as columns and NCO shows them as rows. Maybe printing in NCO style is easier.
As of fe8944f

Code: Select all

-l <max-ply>
or

Code: Select all

--lines=<max-ply>
may be used as an argument to

Code: Select all

jja find
to display variations as a table of opening lines in a format similar to MCO and NCO. This works with all the supported opening book formats (abk, bin, ctg, and obk):

Code: Select all

alip@rosarote:~/org/books|main⚡ ⇒  jja find -l4 -p"e4 e5 Nf3 Nc6 Bb5" bin/Perfect2021.bin
+---------------------------------------------------------------+
| r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R b KQkq - |
+===============================================================+
| 1. ... a6 2. Ba4 Nf6 3. O-O                                   |
+---------------------------------------------------------------+
| 1. ... a6 2. Ba4 Nf6 3. d3                                    |
+---------------------------------------------------------------+
| 1. ... a6 2. Ba4 Be7 3. O-O                                   |
+---------------------------------------------------------------+
| 1. ... a6 2. Ba4 Be7 3. c3                                    |
+---------------------------------------------------------------+
| 1. ... Nf6 2. O-O Nxe4 3. d4                                  |
+---------------------------------------------------------------+
| 1. ... Nf6 2. O-O Nxe4 3. Re1                                 |
+---------------------------------------------------------------+
| 1. ... Nf6 2. d3 Bc5 3. c3                                    |
+---------------------------------------------------------------+
| 1. ... Nf6 2. d3 Bc5 3. Bxc6                                  |
+---------------------------------------------------------------+
| 1. ... Nf6 2. d3 Bc5 3. Nbd2                                  |
+---------------------------------------------------------------+
See more details on the issue tracker, here. Please test this and let me know if this works out for your needs. I'm looking forward to your feedback. Note, this change is not in a released version yet so to test it you need a git build. Browse to the respective operating system build, windows, linux-glibc, or linux-musl, and download the artifact on the left. With this functionality implemented, it's now relatively easy to write an opening book to PGN converter so I'll do that as well before releasing a new version.
Caissa-AI, Caissa-Test, and Caissa-X on LiChess
ChessWoB: Chess without Boundaries
jja: Jin, Jîyan, Azadî!
Follow @alip on Mastodon!
chesskobra
Posts: 347
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: jja: convert CTG books to PolyGlot format (and more!)

Post by chesskobra »

Thanks a lot. I have downloaded and tested the command that you gave above. I will test more on the weekend. This is wonderful.
Engine
Posts: 12
Joined: Fri Mar 24, 2023 9:09 pm
Full name: Oleg Olegovich

Re: jja: convert CTG books to PolyGlot format (and more!)

Post by Engine »

Why doesn't this work for me on Windows, what do you open it with?