Hi,
I would like to add the syzygy_egtb to my chess program.
I looked at the included c-code and I think it'll take quite a bit of time to convert into something more generic. I think it is stockfish oriented?
So I'm wondering: has anyone created a c++ class around it or some kind of c-wrapper with a license that allows free inclusion in other software? (gpl, mit, bsd, etc) E.g. that receives a FEN-string as input.
c++ class or a c wrapper for the syzygy egtb
Moderators: hgm, Rebel, chrisw
-
- Posts: 5563
- Joined: Tue Feb 28, 2012 11:56 pm
Re: c++ class or a c wrapper for the syzygy egtb
No need to make it more generic. Just replace the calls to SF move generation routines with calls to the equivalent routines of your engine.flok wrote:I looked at the included c-code and I think it'll take quite a bit of time to convert into something more generic. I think it is stockfish oriented?
-
- Posts: 12540
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: c++ class or a c wrapper for the syzygy egtb
The published API has nothing to do with stockfish.flok wrote:Hi,
I would like to add the syzygy_egtb to my chess program.
I looked at the included c-code and I think it'll take quite a bit of time to convert into something more generic. I think it is stockfish oriented?
So I'm wondering: has anyone created a c++ class around it or some kind of c-wrapper with a license that allows free inclusion in other software? (gpl, mit, bsd, etc) E.g. that receives a FEN-string as input.
There are not many open source engines that use syzygy tablebase files.
Stockfish is one of the very few that actually work (e.g. the Gull patch has bugs in it).
Hence, studying the Stockfish interface to syzygy is probably the best that you can do, if you do not want to go directly off of the C code.
There is a sample interface for the Gaviota tablebase files that uses an EPD input.
So maybe you would like to try that instead.
Re: c++ class or a c wrapper for the syzygy egtb
Not as easy as it may seem: my engine is rather different from how other engines do it. No bitboards for starters.syzygy wrote:No need to make it more generic. Just replace the calls to SF move generation routines with calls to the equivalent routines of your engine.flok wrote:I looked at the included c-code and I think it'll take quite a bit of time to convert into something more generic. I think it is stockfish oriented?
-
- Posts: 55
- Joined: Thu Oct 22, 2015 2:14 am
Re: c++ class or a c wrapper for the syzygy egtb
Coincidentally I have written a tool to do exactly this. I will be releasing it in the next week or two and will make an announcement on this forum. I wrote this as part of my effort to bring syzygy to Gull.flok wrote: So I'm wondering: has anyone created a c++ class around it or some kind of c-wrapper with a license that allows free inclusion in other software?
-
- Posts: 5563
- Joined: Tue Feb 28, 2012 11:56 pm
Re: c++ class or a c wrapper for the syzygy egtb
Lack of bitboards is not a problem.flok wrote:Not as easy as it may seem: my engine is rather different from how other engines do it. No bitboards for starters.syzygy wrote:No need to make it more generic. Just replace the calls to SF move generation routines with calls to the equivalent routines of your engine.flok wrote:I looked at the included c-code and I think it'll take quite a bit of time to convert into something more generic. I think it is stockfish oriented?
The probing code expects you to tell it what piece combination is on the board (via a material key) and to give it the positions of these pieces.
If your engine does not keep track of a material key, then you could generate it on the spot in the probing routine (but it might be better to add one to your engine... material keys can be useful for other reasons as well). If your engine does have a material key, but it distinguishes between dark and light bishops, then you need a bit of trickery as my probing code expects the same material key independent of bishop color (i.e. dark/light).
-
- Posts: 589
- Joined: Tue Jun 04, 2013 10:15 pm
Re: c++ class or a c wrapper for the syzygy egtb
You can smoothen that by keeping counters for "light+dark" and "light" (or dark) in the material key, instead of the more traditional separate "light" and "dark" counters. Then no trickery is needed because you can mask away the unwanted counters when probing (instead of shifting, masking and adding).syzygy wrote:If your engine does have a material key, but it distinguishes between dark and light bishops, then you need a bit of trickery as my probing code expects the same material key independent of bishop color (i.e. dark/light).
[Account deleted]
-
- Posts: 55
- Joined: Thu Oct 22, 2015 2:14 am
Re: c++ class or a c wrapper for the syzygy egtb
The syzygy stand-alone wrapper (called Fathom) is now available: https://github.com/basil00/Fathom
Fathom has been used to bring syzygy to Gull. See here for more information.
Fathom has been used to bring syzygy to Gull. See here for more information.
Re: c++ class or a c wrapper for the syzygy egtb
Hi,basil00 wrote:The syzygy stand-alone wrapper (called Fathom) is now available: https://github.com/basil00/Fathom
Fathom has been used to bring syzygy to Gull. See here for more information.
Any chance for an interface that accepts a fen-string as input?
-
- Posts: 55
- Joined: Thu Oct 22, 2015 2:14 am
Re: c++ class or a c wrapper for the syzygy egtb
See the fathom.c example tool which already does this.flok wrote:Any chance for an interface that accepts a fen-string as input?