Nalimov Reloaded — giving DTM a second life in Rust

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

Moderator: Ras

j_romang
Posts: 96
Joined: Mon May 16, 2011 2:52 am

Nalimov Reloaded — giving DTM a second life in Rust

Post by j_romang »

Hi all,

Some of you may remember the Gaia 4.1.0 announcement a few weeks ago. Werner Schüle spotted that Gaia couldn't mate with KQ vs K, Sylwy raised the tablebase question, and Frank Quisinsky put Gaia through its paces in his engine overview. That feedback was the push I needed to tackle endgame play properly.

I've written a clean-room, pure Rust implementation of Nalimov endgame tablebase probing and just published it:

GitHub: https://github.com/jromang/nalimov-rs
Crate: https://crates.io/crates/nalimov
Single file, zero dependencies, MIT licensed. It reads the original .nbw.emd / .nbb.emd compressed files and returns exact distance-to-mate (DTM) values for 3–6 piece endgames. Thread-safe with a built-in LRU block cache and a C API for easy integration into C/C++ engines.

I know Syzygy is the standard today — and deservedly so, Ronald de Man's work is a piece of art. But DTM has its charm: shortest path to mate, no ambiguity, great for analysis and endgame studies. I felt these tables deserved a modern, easily embeddable prober.

It still needs more testing — I've validated it against many positions but the more eyes on it the better. Bug reports and feedback are very welcome.

It will be integrated in the next version of GaiaChess. :D

For those who don't have Nalimov files anymore, I've uploaded the complete 3-4-5 piece set on Hugging Face. You can grab them with the hf CLI in one command:

hf download --repo-type dataset jromanghf/nalimov-tablebases --local-dir nalimov-tb
Dataset page: https://huggingface.co/datasets/jromang ... tablebases

Thanks to Werner Schüle, Sylwy, Frank Quisinsky and Graham Banks for the feedback that started this!

Cheers,
Jean-François
Frank Quisinsky
Posts: 7313
Joined: Wed Nov 18, 2009 7:16 pm
Location: Gutweiler, Germany
Full name: Frank Quisinsky

Re: Nalimov Reloaded — giving DTM a second life in Rust

Post by Frank Quisinsky »

Hi Jean-Francois,

if I remember on the old times ...
Programmers often noted that integrating the Nalimov databases would be a laborious task and would take time. Perhaps the reason, today most used syzygy bases? Do you think the same with the work you do here? I means, if other programmers will use your work?

It was the time first engines comes with SMP and Nalimov support. In Germany 5-pieces Nalimov databases was initially a commercial product, the German CSS computer chess newspaper selling it on 7 or 8 CDs for around 129 DM. A short time later free available in www. At this time also first flatrate with ISDN internet connection are available from German Telekom. Most go online with a modem, so the commercial Nalimov CDs was a good idea I think. Eugene Nalimov sent me his agreement to add Nalimov 4-pieces on my website. I have it all the time on my old site in download area.

The French Capture programmer gave the information ...
My engine is optimize with 5-piece Nalimov, please use Capture only with 5-piece Nalimov databases??! In one of my rating systems I am using 4-piece Nalimov for Capture and I had directly a problem with him. No, no Sylvain was also a very friendly and very proud French programmer.

With Gambit-Soft and Sylvain Renard I created a commercial product with Capture, was a wish from Sylvain and I like it to make it available. Commercial or not ... not important for me, the main thing is that it's available, even if it's not free. Capture was very strong in endgames and are able to find positional combinations.

Programmers of Spike and I believe Nirvanachess have also very own ideas with endgame databases after all I understand.

I am thinking, each own idea to do this or that one is good for computer chess.
A good proof that you are a programmer old school.

Means, idea is good but can be better ... I have my own ideas to do that in times endgame databases are for the most "Standard". You know, that many engines, used syzygy, can't play the shortest way to mate. In times today that all isn't nice, if you watching the games live.

I wish me Sylvian RENARD read your message and give a comment about it.
Sure if Sylvain are here and working on Capture ... Sylvain would like it to give here own comments about your work. But a long time I read nothing from him. So my message is a replacement as NON programmer :-)

Best
Frank
Frank Quisinsky
Posts: 7313
Joined: Wed Nov 18, 2009 7:16 pm
Location: Gutweiler, Germany
Full name: Frank Quisinsky

Re: Nalimov Reloaded — giving DTM a second life in Rust

Post by Frank Quisinsky »

Werner, Graham, Gabor, also Stefan Pohl ... different others ...
= old school testers, long years are working on test-projects.

I am more a persons can't work a long time on a project.
Too many ideas for new things as to work a long live on the same things, again and again.
That is boring for me.

The group of "old school" testers they're slowly dying out.
Today 50x more engines are available as people like to test it and create rating systems or interesting tournaments about it. I think electricity consumption or all the work with such a project today is for the most a "No go". So the programmers are programmers and testers, all in one. A bad situation in my opinion, we need clearly more testers in the scene to give all the proud programmers clearly more information.

To give a short information:
Engine X is available in a new version ...
For the most ... it seems ... to many work.

I am thinking often on the old times.
Each new engine version was an event und was celebrated.