Release of DCTL: draughts and checkers template library

Discussion about development of draughts in the time of computer and Internet.
Walter Thoen
Posts: 44
Joined: Wed Nov 17, 2010 13:26
Real name: Walter Thoen

Re: Release of DCTL: draughts and checkers template library

Post by Walter Thoen » Sun Dec 30, 2012 10:38

Hi Rein,

Thanks for the detailed explanation. It seems I might have encountered another Visual C++ specific problem.

2>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector(554): error C2039: 'construct' : is not a member of 'dctl::short_alloc<U,0x010>'
2> with
2> [
2> U=std::_Container_proxy
2> ]
2> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector(550) : while compiling class template member function 'void std::_Vector_alloc<true,std::_Vec_base_types<_Ty,_Alloc>>::_Alloc_proxy(void)'
2> with
2> [
2> _Ty=int
2> , _Alloc=dctl::IntAlloc
2> ]
2> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector(528) : see reference to function template instantiation 'void std::_Vector_alloc<true,std::_Vec_base_types<_Ty,_Alloc>>::_Alloc_proxy(void)' being compiled
2> with
2> [
2> _Ty=int
2> , _Alloc=dctl::IntAlloc
2> ]
2> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector(657) : see reference to class template instantiation 'std::_Vector_alloc<true,std::_Vec_base_types<_Ty,_Alloc>>' being compiled
2> with
2> [
2> _Ty=int
2> , _Alloc=dctl::IntAlloc
2> ]
2> C:\Users\Walter.Tho\Desktop\DCTL\dctl/search/variation.hpp(19) : see reference to class template instantiation 'std::vector<int,dctl::IntAlloc>' being compiled
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I will try to setup a Linux VM as well.

Regards,
Walter

Rein Halbersma
Posts: 1722
Joined: Wed Apr 14, 2004 16:04
Contact:

Re: Release of DCTL: draughts and checkers template library

Post by Rein Halbersma » Sun Dec 30, 2012 11:32

Did you compile in Debug or Release mode? IIRC, VC++ runs in Debug mode by default. Unfortunately, this will add some code to the vector memory allocator that is not fully Standard compliant for custom allocators like I use (another C++11 feature that I rely on). E.g. the error about a missing member function construct() is bogus because this is supposed to be provided by std::allocator_traits

Under Release mode those errors should go away.

Walter Thoen
Posts: 44
Joined: Wed Nov 17, 2010 13:26
Real name: Walter Thoen

Re: Release of DCTL: draughts and checkers template library

Post by Walter Thoen » Sun Dec 30, 2012 14:17

Hi Rein,

It is all working now. Thanks for your help.

Let me know if I can assist you with anything to develop this nice project further.

Regards,
Walter

Rein Halbersma
Posts: 1722
Joined: Wed Apr 14, 2004 16:04
Contact:

Re: Release of DCTL: draughts and checkers template library

Post by Rein Halbersma » Sun Dec 30, 2012 14:21

Walter Thoen wrote:Hi Rein,

It is all working now. Thanks for your help.

Let me know if I can assist you with anything to develop this nice project further.

Regards,
Walter
HI Walter,

Good to hear you succeeded in building the project! I will update the installation instructions on BitBucket. We can discuss ideas by email INITIAL NODOTORSPACE LASTNAME AT GMAIL DOT COM. I am very interested in hearing what you would like to use the library for.

Rein

Rein Halbersma
Posts: 1722
Joined: Wed Apr 14, 2004 16:04
Contact:

Re: Release of DCTL: draughts and checkers template library

Post by Rein Halbersma » Mon Dec 31, 2012 00:23

Hi everyone, I've greatly updated my DCTL page with a lot of new documentation on installing and building the library.
See https://bitbucket.org/rhalbersma/dctl/overview for an overview.

Maurits Meijer
Posts: 221
Joined: Thu Nov 27, 2008 19:22
Contact:

Re: Release of DCTL: draughts and checkers template library

Post by Maurits Meijer » Sun Feb 24, 2013 15:33

Very nice project.
Is it correct that this project won't run on 32 bits?
http://slagzet.com

Rein Halbersma
Posts: 1722
Joined: Wed Apr 14, 2004 16:04
Contact:

Re: Release of DCTL: draughts and checkers template library

Post by Rein Halbersma » Sun Feb 24, 2013 19:31

Maurits Meijer wrote:Very nice project.
Is it correct that this project won't run on 32 bits?
Thanks for your interesting my library! Are you using it already or just browsing the source code?

To answer your question: no, the project will run on 32-bits, but you might need to change the default bit twiddling functionality depending on which branch from the repository you use. The current default is to use 64-bit CPU-intrinsics for counting the number of 1-bits and to find the index of the first 1-bit. For 32-bits machines, these intrinsics are not available and you will get a compile error. Instead, I provide small lookup 256-sized tables to get index/count values for each byte. In a next release, I will enable a conditional compiler flag based on the detected architecture into the Makefile. For now, in dctl/src/bit/bit.hpp you can change the implementations of bit::index and bit::count to use lookup::index and lookup::count instead of intrinsic::index and intrinsic::count.

Note that the library is currently pre-alpha experimental, and the interface is subject to change!

Rein

Maurits Meijer
Posts: 221
Joined: Thu Nov 27, 2008 19:22
Contact:

Re: Release of DCTL: draughts and checkers template library

Post by Maurits Meijer » Sun Feb 24, 2013 19:50

Rein Halbersma wrote: Thanks for your interesting my library! Are you using it already or just browsing the source code?
You're welcome, thank you for providing it. :D
I was looking for some tooling to test and work on the slagzet.com engine when I remembered this project. So i decided to take a look. While the vs2012 install was failing I read trough this thread and got the suspicion it wouldn't work on 32 bit, so i gave up. But now I will definitely try again.
http://slagzet.com

Rein Halbersma
Posts: 1722
Joined: Wed Apr 14, 2004 16:04
Contact:

Re: Release of DCTL: draughts and checkers template library

Post by Rein Halbersma » Tue Apr 30, 2013 22:52

I have made significant changes to the DCTL project, streamlining the build process and documenting the requirements. See the BitBucket repository for more information https://bitbucket.org/rhalbersma/dctl/overview

Walter
Posts: 96
Joined: Fri Jul 13, 2012 19:23
Real name: Walter Thoen

Re: Release of DCTL: draughts and checkers template library

Post by Walter » Tue Dec 31, 2013 11:03

Rein Halbersma wrote:I have made significant changes to the DCTL project, streamlining the build process and documenting the requirements. See the BitBucket repository for more information https://bitbucket.org/rhalbersma/dctl/overview
Hi Rein,

I see regular commits on Bitbucket, but maybe you could update us a bit more on overall progress. What is your latest forecast for a working bare bones engine?

After all the end of the year is a good time to look both back and forward :D

Walter

Rein Halbersma
Posts: 1722
Joined: Wed Apr 14, 2004 16:04
Contact:

Re: Release of DCTL: draughts and checkers template library

Post by Rein Halbersma » Tue Dec 31, 2013 23:26

Walter wrote:
Rein Halbersma wrote:I have made significant changes to the DCTL project, streamlining the build process and documenting the requirements. See the BitBucket repository for more information https://bitbucket.org/rhalbersma/dctl/overview
Hi Rein,

I see regular commits on Bitbucket, but maybe you could update us a bit more on overall progress. What is your latest forecast for a working bare bones engine?

After all the end of the year is a good time to look both back and forward :D

Walter
Hi Walter,

Well, I have made a lot of progress, but perhaps not in the direction you are looking for the most :-)
On the one hand, I have made the very time-consuming transition from raw 64-bit integer bitboards to a bit_set class template that allows arbitrary user-defined board sizes. This was very difficult and required changing almost all template-metaprogramming to the new C++14 constexpr features. Current compiler technology still limits it a little (at least until I have figured out a way to override some Clang template and constexpr limits), but DCTL now supports up to 26x26 boards with both numeric and algebraic notation, and possibly even larger boards with only numeric notation (untested). The upside is that all this refactoring also made the code a few thousand lines smaller, so less to maintain in the future.

With some help by Wieger, I have also made some progress towards an engine. If you follow the instructions on the BitBucket repository, you can try to install the requirements and build and run the test suite yourself. From the build directory, you can then run the program test/game/game_play which sets up an interactive shell that displays the initial position (currently for the 26x26 board, but it's easy to change the test source file <dctl/test/game/play.cpp> and setup a 10x10 board in numeric notation. Let me know if you need help! (Wieger succeeded in building and running the tests, so it does not work on just my machine ;-) ) This test program will be the stepping stone on top of which I want to build the engine.

On big issue I haven't resolved yet is which GUI to program against. For 8x8 checkers, I want to support Martin Fierz's CheckerBoard, and for 10x10 draughts the GUIDE protocol seems promising. I have also been dabbling with XBoard a little. Plus Aart's Android GUI is looking very nice. One thing to be done is to generate captures with all the intermediate step as additional data, in such a way as to avoid code duplication (I have an idea how to approach it, but it will take some time).

A final snag to resolve is how to get Clang to compile a Windows native target. There is a Visual C++ plugin but that is a) very experimental and b) requires the professional edition in order to be used. Hopefully, GCC 4.9 (scheduled for March/April '14) will support C++14 constexpr, so that I can use the MinGW version for Windows builds.

So... I think you should see more progress towards a playable engine in 2014 (no promises and fixed dates however).

Rein

Walter
Posts: 96
Joined: Fri Jul 13, 2012 19:23
Real name: Walter Thoen

Re: Release of DCTL: draughts and checkers template library

Post by Walter » Wed Jan 01, 2014 12:11

Rein,

Thanks for the update. It is still a very interesting project :D as it seems to combine extreme flexibility with extreme efficiency.

The feature to get all intermediate fields of a capture sequence is indeed very important for an attractive user interface. It is clearly a challenge to achieve this without duplicate code and without comprising the efficiency of the move generator. You might just have to pay the price of duplicate code :(

For my selfish purposes DXP support would be more important than GUI support as DXP is needed to evaluate and improve the engine strength first before it becomes interesting for a human to play against the engine. In general, I would be interested to know how to you intend to do evaluation given all the different board sizes and rules that DCTL supports.

If at some point in time you are interested to test with Visual Studio, then let me know. As part of our Microsoft Partner and MSDN subscriptions we are entitled to more licenses than we currently use.

Ps. This year's Joop Meure Rapid Tournament on 22 March will feature a special Killer-group. Anyone interested in experimenting with this new rule is more than welcome to participate.

Regards,
Walter

BertTuyt
Posts: 1592
Joined: Wed Sep 01, 2004 19:42

Re: Release of DCTL: draughts and checkers template library

Post by BertTuyt » Wed Jan 01, 2014 22:50

Walter, as I also use (an older version) Visual Studio (VS) I might be interested to work with a more recent VS version.
What are the conditions to use the newer release...

Bert

Rein Halbersma
Posts: 1722
Joined: Wed Apr 14, 2004 16:04
Contact:

Re: Release of DCTL: draughts and checkers template library

Post by Rein Halbersma » Thu Jan 02, 2014 20:36

Walter wrote: For my selfish purposes DXP support would be more important than GUI support as DXP is needed to evaluate and improve the engine strength first before it becomes interesting for a human to play against the engine. In general, I would be interested to know how to you intend to do evaluation given all the different board sizes and rules that DCTL supports.
The DXP support is something not very far off. For long term engine development, I am looking for integration with another framework: cute-chess-cli. I am told that it can support non-chess engine matches, and that means you get all kinds of statistical tools and parameter-tuning frameworks at your disposal.

For the evaluation function, my first probably very naive strategy is to just write a bunch of general eval terms (material, center, balance, terrain, tempo, outposts) plus some lock and bridge patterns, and just automatically tune the coefficients and see where that leads to. But these would just be base level programs, I don't expect them to be competitive compared to the state of the art. That will require more manual labor :-)
If at some point in time you are interested to test with Visual Studio, then let me know. As part of our Microsoft Partner and MSDN subscriptions we are entitled to more licenses than we currently use.
Thanks, that's very generous of you! I will keep that in mind.

BertTuyt
Posts: 1592
Joined: Wed Sep 01, 2004 19:42

Re: Release of DCTL: draughts and checkers template library

Post by BertTuyt » Fri Jan 03, 2014 23:20

For the evaluation function, my first probably very naive strategy is to just write a bunch of general eval terms (material, center, balance, terrain, tempo, outposts) plus some lock and bridge patterns, and just automatically tune the coefficients and see where that leads to. But these would just be base level programs, I don't expect them to be competitive compared to the state of the art. That will require more manual labor :-)
I expect that with all your draughts knowledge and auto coefficient tuning your implementation could already approach top level!

But I tend to agree that in the end the eval function is the area which makes the difference and (so far) requires a huge manual effort.
For this reason I'm still thinking how we could approach evaluation function learning in a different way.

That was also the reason that Im now working on DQL.
The base idea is to find specific board/game positions with a DQL-search, and than extract the relevant patterns from the DQL search output.

My main focus these days is the white outpost on 24 evaluation. The base algorithm (as used by most i guess), is to count attackers and defenders (with some clever race-conditions).
Unfortunately there are many exceptions, and exceptions on exceptions, and ...

I still did not find the breakthrough solution/approach , but if it was easy everybody would have done it already...

Bert

Post Reply