syzygy request for info

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
syzygy
Posts: 4426
Joined: Tue Feb 28, 2012 10:56 pm

Re: syzygy request for info

Post by syzygy » Sun Dec 02, 2018 7:00 pm

elcabesa wrote:
Sun Dec 02, 2018 6: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: 340
Joined: Wed Apr 21, 2010 2:58 am
Location: Australia
Full name: Nguyen Hong Pham
Contact:

Re: syzygy request for info

Post by phhnguyen » Sun Dec 02, 2018 9:47 pm

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://github.com/nguyenpham/Banksia
An open source C++11 chess tournament manager

syzygy
Posts: 4426
Joined: Tue Feb 28, 2012 10:56 pm

Re: syzygy request for info

Post by syzygy » Sun Dec 02, 2018 10:53 pm

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: 340
Joined: Wed Apr 21, 2010 2:58 am
Location: Australia
Full name: Nguyen Hong Pham
Contact:

Re: syzygy request for info

Post by phhnguyen » Mon Dec 03, 2018 12:08 am

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://github.com/nguyenpham/Banksia
An open source C++11 chess tournament manager

elcabesa
Posts: 803
Joined: Sun May 23, 2010 11:32 am
Contact:

Re: syzygy request for info

Post by elcabesa » Sun May 12, 2019 9:15 am

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: 4426
Joined: Tue Feb 28, 2012 10:56 pm

Re: syzygy request for info

Post by syzygy » Sun May 12, 2019 8:03 pm

elcabesa wrote:
Sun May 12, 2019 9: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).

Post Reply