syzygy request for info

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Re: syzygy request for info

Post by syzygy »

elcabesa wrote: Sun Dec 02, 2018 7:36 pm from what I have understood e.get(i, f)->pieces[k] will store the 4 bit ( with color information ) info about the piece. so I have to mantain the color, but invert the order of pieces.
Correct.
User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: syzygy request for info

Post by phhnguyen »

Hi Ronald de Man,
From an Apple's document of "Mapping Files Into Memory" (https://developer.apple.com/library/arc ... emory.html) I have read a condition NOT to map files:
The file is several hundred megabytes or more in size. Mapping large files into memory fills memory quickly and may lead to paging, which would negate the benefits of mapping the file in the first place. For large sequential read operations, disable disk caching and read the file into a small memory buffer instead.
From my reading I know your syzygy tablebase uses file mapping and many files (from 6 men) are more than "several hundred megabytes". My curious questions:
1) Do I miss somethings?
2) Are you aware and / or have code for that (not to map) condition?
Thanks
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: syzygy request for info

Post by syzygy »

They're thinking of sequential read operations which would cause the whole file to be transferred into physical RAM. That is an entirely different use case.
User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: syzygy request for info

Post by phhnguyen »

Do you think after one or few games, a large endgame file may be read out too many so it ends up to be loaded entirely into memory by mapping-file?
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
elcabesa
Posts: 855
Joined: Sun May 23, 2010 1:32 pm

Re: syzygy request for info

Post by elcabesa »

one year later I'm still here reading and studying syzygy.

I have just seen that when first reading the files, the code read the PairsData, each pairsData contains an array of pieces with defines the order of pieces.
I have just read KNNvKB files and and in all the pairsData struct contained the order of pieces seems to be: white King, black King, black Bishop, white Knight, white knight.
does it apply to all the files? or it can be that each pairdata inside a file can have different piece order?
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: syzygy request for info

Post by syzygy »

elcabesa wrote: Sun May 12, 2019 11:15 am I have just read KNNvKB files and and in all the pairsData struct contained the order of pieces seems to be: white King, black King, black Bishop, white Knight, white knight.
does it apply to all the files? or it can be that each pairdata inside a file can have different piece order?
Why do you want to know? The file format clearly allows different piece orders. If you are going to implement it, better stick to the file format.

If you still want to know the answer, have a look at the generator (or just run it).