Sysygy Shatranj?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Sysygy Shatranj?

Post by hgm »

Would it be trivial to adapt the Syzygy EGT generator for Shatranj? Or would it be easier to just write a dedicated generator for that? I am only interested in the WDL statistics of a few specific 6-men end-games (KRFE-KR and KFF-KFE). I don't need the tables itself, so I don't care about compression. And because it is a one-time effort I don't really care whether it takes a minute or a night to do the calculation, so a simple and dumb algorithm would be good enough. Memory use might be a problem, though, as I don't have a 64-bit compiler on Windows, and the Linux VM probably will not allow me using the 8GB of memory that I have on my largest machine. But shuttling info between two bitmap representation for the wtm and btm (which require 1GB each if I use 8-fold symmetry) would probably be dable in 4GB.
syzygy
Posts: 5563
Joined: Tue Feb 28, 2012 11:56 pm

Re: Sysygy Shatranj?

Post by syzygy »

hgm wrote: Mon Nov 04, 2019 11:15 am Would it be trivial to adapt the Syzygy EGT generator for Shatranj? Or would it be easier to just write a dedicated generator for that? I am only interested in the WDL statistics of a few specific 6-men end-games (KRFE-KR and KFF-KFE). I don't need the tables itself, so I don't care about compression.
Supporting E and F should be straightforward. Just rewrite the code in board.h that implements B and N, say. You would need to generate the 5-piece subtables before you can generate a 6-piece table, but that should not take more than a minute or so.
Memory use might be a problem, though, as I don't have a 64-bit compiler on Windows, and the Linux VM probably will not allow me using the 8GB of memory that I have on my largest machine. But shuttling info between two bitmap representation for the wtm and btm (which require 1GB each if I use 8-fold symmetry) would probably be dable in 4GB.
The Syzygy generator needs 2x462x64^4 bytes for a 6-piece table. Implementing a bitmap-based generator from scratch is probably easier than changing this.
User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: Sysygy Shatranj?

Post by phhnguyen »

hgm wrote: Mon Nov 04, 2019 11:15 am Would it be trivial to adapt the Syzygy EGT generator for Shatranj? Or would it be easier to just write a dedicated generator for that? I am only interested in the WDL statistics of a few specific 6-men end-games (KRFE-KR and KFF-KFE). I don't need the tables itself, so I don't care about compression. And because it is a one-time effort I don't really care whether it takes a minute or a night to do the calculation, so a simple and dumb algorithm would be good enough. Memory use might be a problem, though, as I don't have a 64-bit compiler on Windows, and the Linux VM probably will not allow me using the 8GB of memory that I have on my largest machine. But shuttling info between two bitmap representation for the wtm and btm (which require 1GB each if I use 8-fold symmetry) would probably be dable in 4GB.
Thought you have already your own a fast and straightforward EGTB generator that can run well on your hardware? :roll:
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Sysygy Shatranj?

Post by hgm »

I have several: FairyGen for 3- to 5-men end-games with fairy pieces on 8x8, an unreleased one for 3- or 4-men end-games on arbitrary boards against a bare King, a 3-men on-line 8x8 generator in JavaScript, a version of Marcel van Kervinck's 'PrettyFast' 4-men generator, and one for (partial) Xiangqi end-games.

But none of those does more than 5-men, (except the XQ one, where the whole Palace only counts as a single man), and just scaling them up in a 64-bit compile would exceed the capabilities of my hardware. They are all byte-based (except the PrettyFast). And to do 6-men in a 32-bit architecture you cannot afford more than 1 bit per position/side-to-move.

For Shatranj an added complication is the baring rule.
User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: Sysygy Shatranj?

Post by phhnguyen »

Perhaps you just add more men to your generator, test it (with fewer men) in your computer then ask some volunteers to compile and run in their systems?

I can help to run if it requires no more than 16 GB (the mem size of my iMac).
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager