Page 4 of 4

Re: syzygy request for info

Posted: Sun Dec 02, 2018 8:00 pm
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.

Re: syzygy request for info

Posted: Sun Dec 02, 2018 10:47 pm
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

Re: syzygy request for info

Posted: Sun Dec 02, 2018 11:53 pm
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.

Re: syzygy request for info

Posted: Mon Dec 03, 2018 1:08 am
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?

Re: syzygy request for info

Posted: Sun May 12, 2019 11:15 am
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?

Re: syzygy request for info

Posted: Sun May 12, 2019 10:03 pm
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).