I included a function that ask Win-Draw-Loss info from the TBs, without the distance to mate. In this way, this function can be used when the distance is not needed. For now, this function internally calls the regular one. However, the idea is that it will call something that will give a better performance. For instance, it could be an actual bitbase. I am implementing a second cache that will store the WDL info, saving a LOT of space or multiplying the efficiency of the cache for the same amount of memory. You could look at is as multiplying the cache memory 8x or look at it a having bitbases that are built on the fly. In any case, the performance should be better than plain TBs.
For now, I provide you with the interface, to see if you have any comments, and to start thinking about the implementation in your own program. I implemented the interface in Gaviota already .
Of course, it comes in two flavors, soft and hard, like the regular functions (soft probes only the cache, never the HD).
If you use it now, it may not be different from the regular TBs, but you will notice a boost in performance next time, just by upgrading the files.
I believe that having a common interface for TBs or bitbases should be the way to go. The engine should not be interested in knowing what happen behind the curtains. The engine knows that sometimes the actual distance to mate is not needed. The library should know how to optimize the flow of information based on that and keep those things separate. TBs or bitbases? none of the engine's business!
You can download the update here, version [0.1.6.1]
Code: Select all
This is the regular function extern int /*bool*/ tb_probe_hard (unsigned stm, unsigned epsq, unsigned castles, const unsigned *inp_wSQ, const unsigned *inp_bSQ, const unsigned char *inp_wPC, const unsigned char *inp_bPC, /*@out@*/ unsigned *tbinfo, /*@out@*/ unsigned *plies); This is the WDL function, without returning "plies". extern int /*bool*/ tb_probe_WDL_hard (unsigned stm, unsigned epsq, unsigned castles, const unsigned *inp_wSQ, const unsigned *inp_bSQ, const unsigned char *inp_wPC, const unsigned char *inp_bPC, /*@out@*/ unsigned *tbinfo);