New 6-piece tablebases

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: New 6-piece tablebases

Post by syzygy »

Sharaf_DG wrote:Looking forward to a bug free, DTZ working version
The info quoted by Kirill has all the information you need, and I already gave you the information several times. I am not a customer service desk, and this is the "Programming and Technical Discussions" part of the forum. Thank you.
Sharaf_DG
Posts: 30
Joined: Fri Aug 02, 2013 11:03 am

Re: New 6-piece tablebases

Post by Sharaf_DG »

My apologies for any misunderstanding...Keep Up the Good work!!!
gotogo
Posts: 92
Joined: Tue Jan 26, 2010 5:03 am

Re: New 6-piece tablebases

Post by gotogo »

why is it call new 6 piece tablebases when only 5 piece set is available?
anyone want to buy a police car?
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: New 6-piece tablebases

Post by syzygy »

gotogo wrote:why is it call new 6 piece tablebases when only 5 piece set is available?
I am not even offering the 5 piece set for download.

I am only providing the source code of a tablebase generator that is capable of generating the 6 piece set. This is only intended for experienced users who are comfortable with command line interfaces and compiling their own binaries.

Anyone who wishes can try to generate the full 6 piece set and make it available for download. It is 150 GB, much smaller than the 1.2 TB of Nalimov but still big.

Another idea is developing a GUI frontend for the generator that would allow end users to generate the full set with a single click. On a fast 4-core cpu with 16 GB of RAM it should take less than 10 days. This might be more convenient than a 150 GB download.
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: New 6-piece tablebases

Post by hgm »

syzygy wrote:Another idea is developing a GUI frontend for the generator that would allow end users to generate the full set with a single click. On a fast 4-core cpu with 16 GB of RAM it should take less than 10 days. This might be more convenient than a 150 GB download.
If you want a single-click interface, a simple .BAT file containing the required commands would do.
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: New 6-piece tablebases

Post by syzygy »

hgm wrote:
syzygy wrote:Another idea is developing a GUI frontend for the generator that would allow end users to generate the full set with a single click. On a fast 4-core cpu with 16 GB of RAM it should take less than 10 days. This might be more convenient than a 150 GB download.
If you want a single-click interface, a simple .BAT file containing the required commands would do.
It is a bit more complicated, since a few parameters need to be set (number of threads, whether the system has 'only' 16 GB or at least 24 GB, whether to generate the 6-piece set or just the 5-piece set).

Btw, do you happen to know how to test (in a .BAT file) for the existence of a file and execute a command only if the file does not exist? This is necessary for being able to continue an interrupted generation process from where it left off. Currently I use a Perl script, but on Windows that requires installation of Perl.
User avatar
Kirill Kryukov
Posts: 492
Joined: Sun Mar 19, 2006 4:12 am

Re: New 6-piece tablebases

Post by Kirill Kryukov »

syzygy wrote:Btw, do you happen to know how to test (in a .BAT file) for the existence of a file and execute a command only if the file does not exist? This is necessary for being able to continue an interrupted generation process from where it left off. Currently I use a Perl script, but on Windows that requires installation of Perl.

Code: Select all

if not exist <file> <command>
or type "if /?" for more details.
User avatar
Kirill Kryukov
Posts: 492
Joined: Sun Mar 19, 2006 4:12 am

Re: New 6-piece tablebases

Post by Kirill Kryukov »

Hi Ronald,

I finally had the time to try your generator. I could build the 3-4-5 piece tablebases without problems, and all checksums matched yours. However "rtbgen" crashes every time I try to build any 6-piece tablebase - both standalone and via "run.pl". It crashes instantly with no useful diagnostics.

Code: Select all

      0 &#91;main&#93; rtbgen 7224 open_stackdumpfile&#58; Dumping stack trace to rtbgen.exe.stackdump
So far I only tried it with GCC 4.8.1 (cygwin64) on Windows 7. The machine has 16 GB of RAM, the "--disk" option was always supplied to both generators and to "run.pl".

Another point, GCC printed a bunch or warnings. I humbly suggest that it's perhaps good idea to try and eliminate all warnings, so that the code will give better impression and inspire more confidence.

Code: Select all

tbgen.c&#58;522&#58;14&#58; warning&#58; ‘optarg’ redeclared without dllimport attribute&#58; previous dllimport ignored &#91;-Wattributes&#93;
 extern char *optarg;
              ^
In file included from tbgen.c&#58;17&#58;0&#58;
probe.c&#58; In function ‘encode_piece’&#58;
probe.c&#58;821&#58;7&#58; warning&#58; ‘idx’ may be used uninitialized in this function &#91;-Wmaybe-uninitialized&#93;
   idx *= factor&#91;0&#93;;
       ^
probe.c&#58; In function ‘decode_pawn’&#58;
probe.c&#58;1640&#58;20&#58; warning&#58; array subscript is above array bounds &#91;-Warray-bounds&#93;
  if &#40;sort&#91;j&#93; > sort&#91;k&#93;) Swap&#40;sort&#91;j&#93;, sort&#91;k&#93;);
                    ^
probe.c&#58;1640&#58;43&#58; warning&#58; array subscript is above array bounds &#91;-Warray-bounds&#93;
  if &#40;sort&#91;j&#93; > sort&#91;k&#93;) Swap&#40;sort&#91;j&#93;, sort&#91;k&#93;);
                                           ^
permute.c&#58; In function ‘init_permute_piece’&#58;
permute.c&#58;919&#58;26&#58; warning&#58; array subscript is above array bounds &#91;-Warray-bounds&#93;
        piece_perm_list&#91;i&#93;&#91;m++&#93; = tidx&#91;type_perm_list&#91;i&#93;&#91;k&#93;&#93; + l;
                          ^
permute.c&#58;919&#58;26&#58; warning&#58; array subscript is above array bounds &#91;-Warray-bounds&#93;
permute.c&#58;919&#58;26&#58; warning&#58; array subscript is above array bounds &#91;-Warray-bounds&#93;
permute.c&#58;942&#58;26&#58; warning&#58; array subscript is above array bounds &#91;-Warray-bounds&#93;
        piece_perm_list&#91;i&#93;&#91;m++&#93; = tidx&#91;type_perm_list&#91;i&#93;&#91;k&#93;&#93; + l;
                          ^
permute.c&#58;942&#58;26&#58; warning&#58; array subscript is above array bounds &#91;-Warray-bounds&#93;
compress.c&#58; In function ‘remove_wdl_worker’&#58;
compress.c&#58;473&#58;10&#58; warning&#58; ‘t’ may be used uninitialized in this function &#91;-Wmaybe-uninitialized&#93;
   int s, t;
          ^
compress.c&#58; In function ‘adjust_work_replace’&#58;
compress.c&#58;427&#58;15&#58; warning&#58; ‘idx2’ may be used uninitialized in this function &#91;-Wmaybe-uninitialized&#93;
       work&#91;i&#93; = idx2;
               ^
tbgenp.c&#58;627&#58;14&#58; warning&#58; ‘optarg’ redeclared without dllimport attribute&#58; previous dllimport ignored &#91;-Wattributes&#93;
 extern char *optarg;
              ^
In file included from tbgenp.c&#58;18&#58;0&#58;
probe.c&#58; In function ‘encode_piece’&#58;
probe.c&#58;821&#58;7&#58; warning&#58; ‘idx’ may be used uninitialized in this function &#91;-Wmaybe-uninitialized&#93;
   idx *= factor&#91;0&#93;;
       ^
probe.c&#58; In function ‘decode_pawn’&#58;
probe.c&#58;1640&#58;20&#58; warning&#58; array subscript is above array bounds &#91;-Warray-bounds&#93;
  if &#40;sort&#91;j&#93; > sort&#91;k&#93;) Swap&#40;sort&#91;j&#93;, sort&#91;k&#93;);
                    ^
probe.c&#58;1640&#58;43&#58; warning&#58; array subscript is above array bounds &#91;-Warray-bounds&#93;
  if &#40;sort&#91;j&#93; > sort&#91;k&#93;) Swap&#40;sort&#91;j&#93;, sort&#91;k&#93;);
                                           ^
tbver.c&#58;96&#58;14&#58; warning&#58; ‘optarg’ redeclared without dllimport attribute&#58; previous dllimport ignored &#91;-Wattributes&#93;
 extern char *optarg;
              ^
In file included from tbver.c&#58;18&#58;0&#58;
probe.c&#58; In function ‘encode_piece’&#58;
probe.c&#58;821&#58;7&#58; warning&#58; ‘idx’ may be used uninitialized in this function &#91;-Wmaybe-uninitialized&#93;
   idx *= factor&#91;0&#93;;
       ^
In file included from tbver.c&#58;85&#58;0&#58;
rtbver.c&#58; In function ‘load_wdl’&#58;
rtbver.c&#58;826&#58;7&#58; warning&#58; ‘v1_p’ may be used uninitialized in this function &#91;-Wmaybe-uninitialized&#93;
 printf&#40;"WDL_ERROR&#58; idx = %"PRIu64", v2 = %d, v1 = %d\n", idx_p, v2, v1_p&#41;;
       ^
In file included from tbver.c&#58;18&#58;0&#58;
probe.c&#58; In function ‘decode_pawn’&#58;
probe.c&#58;1640&#58;20&#58; warning&#58; array subscript is above array bounds &#91;-Warray-bounds&#93;
  if &#40;sort&#91;j&#93; > sort&#91;k&#93;) Swap&#40;sort&#91;j&#93;, sort&#91;k&#93;);
                    ^
probe.c&#58;1640&#58;43&#58; warning&#58; array subscript is above array bounds &#91;-Warray-bounds&#93;
  if &#40;sort&#91;j&#93; > sort&#91;k&#93;) Swap&#40;sort&#91;j&#93;, sort&#91;k&#93;);
                                           ^
In file included from tbver.c&#58;85&#58;0&#58;
rtbver.c&#58; In function ‘load_dtz’&#58;
rtbver.c&#58;914&#58;36&#58; warning&#58; ‘v1_p’ may be used uninitialized in this function &#91;-Wmaybe-uninitialized&#93;
     table&#91;idx_p&#93; = wdl_to_dtz&#91;v1_p&#93;&#91;v2&#93;;
                                    ^
tbverp.c&#58;105&#58;14&#58; warning&#58; ‘optarg’ redeclared without dllimport attribute&#58; previous dllimport ignored &#91;-Wattributes&#93;
 extern char *optarg;
              ^
In file included from tbverp.c&#58;20&#58;0&#58;
probe.c&#58; In function ‘encode_piece’&#58;
probe.c&#58;821&#58;7&#58; warning&#58; ‘idx’ may be used uninitialized in this function &#91;-Wmaybe-uninitialized&#93;
   idx *= factor&#91;0&#93;;
       ^
In file included from tbverp.c&#58;94&#58;0&#58;
rtbverp.c&#58; In function ‘load_wdl’&#58;
rtbverp.c&#58;1334&#58;34&#58; warning&#58; ‘v1_p’ may be used uninitialized in this function &#91;-Wmaybe-uninitialized&#93;
     table&#91;idx_p&#93; = wdl_matrix&#91;v2&#93;&#91;v1_p&#93;;
                                  ^
In file included from tbverp.c&#58;20&#58;0&#58;
probe.c&#58; In function ‘decode_pawn’&#58;
probe.c&#58;1640&#58;20&#58; warning&#58; array subscript is above array bounds &#91;-Warray-bounds&#93;
  if &#40;sort&#91;j&#93; > sort&#91;k&#93;) Swap&#40;sort&#91;j&#93;, sort&#91;k&#93;);
                    ^
probe.c&#58;1640&#58;43&#58; warning&#58; array subscript is above array bounds &#91;-Warray-bounds&#93;
  if &#40;sort&#91;j&#93; > sort&#91;k&#93;) Swap&#40;sort&#91;j&#93;, sort&#91;k&#93;);
                                           ^
I will try to build it with MinGW around weekend and see if it works better.

Thanks,
Kirill
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: New 6-piece tablebases

Post by syzygy »

Kirill Kryukov wrote:I finally had the time to try your generator. I could build the 3-4-5 piece tablebases without problems, and all checksums matched yours. However "rtbgen" crashes every time I try to build any 6-piece tablebase - both standalone and via "run.pl". It crashes instantly with no useful diagnostics.

Code: Select all

      0 &#91;main&#93; rtbgen 7224 open_stackdumpfile&#58; Dumping stack trace to rtbgen.exe.stackdump
Did you try the very latest code? It has worked for others, at least with (MingW) gcc-4.7.2.
Does rtbgen.exe.stackdump contain anything?
Another point, GCC printed a bunch or warnings. I humbly suggest that it's perhaps good idea to try and eliminate all warnings, so that the code will give better impression and inspire more confidence.
All array bounds warnings are a bug of gcc-4.8.x. The solution is to add -Wno-array-bounds. The "may be used uninitialized" warnings are all bogus.

Code: Select all

tbgen.c&#58;522&#58;14&#58; warning&#58; ‘optarg’ redeclared without dllimport attribute&#58; previous dllimport ignored &#91;-Wattributes&#93;
 extern char *optarg;
I never saw this warning. I suppose the line could/should be removed.
I will try to build it with MinGW around weekend and see if it works better.
Ah! I never tested with cygwin. It probably can't deal with very large memory allocations.
User avatar
Kirill Kryukov
Posts: 492
Joined: Sun Mar 19, 2006 4:12 am

Re: New 6-piece tablebases

Post by Kirill Kryukov »

syzygy wrote:Did you try the very latest code? It has worked for others, at least with (MingW) gcc-4.7.2.
Yes, of course the latest. It's great to hear that it worked for someone, I will try it with MinGW soon.
syzygy wrote:Does rtbgen.exe.stackdump contain anything?

Code: Select all

Exception&#58; STATUS_ACCESS_VIOLATION at rip=001801447D5
rax=000006FF31DF0000 rbx=00000001CE210000 rcx=00000001CE210000
rdx=000006FF31DF0000 rsi=00000001CE200030 rdi=00000001CE000010
r8 =00000001CE20FFE2 r9 =0000000000000001 r10=0000000000000000
r11=0000000000000206 r12=0000000000000005 r13=0000000000000007
r14=0000000000000006 r15=000000000022A8A0
rbp=00000001CE000000 rsp=000000000022A5C0
program=K&#58;\egtb\syzygy\rtbgen.exe, pid 11184, thread main
cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B
If you'd like to debug it, I will be happy to assist in any way I can.
syzygy wrote:All array bounds warnings are a bug of gcc-4.8.x. The solution is to add -Wno-array-bounds. The "may be used uninitialized" warnings are all bogus.
OK, this is amusing, but if you are sure then it's OK.
syzygy wrote:Ah! I never tested with cygwin. It probably can't deal with very large memory allocations.
Could be. 64-bit is a very recent addition to cygwin, perhaps something is not sorted yet.