Giter Club home page Giter Club logo

dctl's People

Contributors

rhalbersma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dctl's Issues

use [[no_unique_address]]

This allows better layout of basic_action and basic_state and automatic generation of operator== for these classes.

Note that this is not yet supported for Visual C++.

Investigate long range king jump capture

  • landing after final jump
  • intermediate sliding and turning
  • add 2-argument jump_sources for short-ranged pieces
  • store number of sliding squares ahead into builder

DCTL build fails on MSVC with error C2280, error C2088, error C3889...

Hi all,
DCTL failed to build with "error C2280, error C2088, error C3889..."with MSVC on Windows. Could you please help look at this issue?

Environment:
Windows: windows server 2019
VS: 2019

Repro steps:
1.open VS2019 x64 tools command
2.git clone https://github.com/rhalbersma/dctl F:\gitP\rhalbersma\dctl
3.cd F:\gitP\rhalbersma\dctl
4.mkdir build_amd64 & cd F:\gitP\rhalbersma\dctl\build_amd64
5.set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
6.msbuild /m /p:Platform=x64 /p:Configuration=Release dctl.sln /t:Rebuild

Error info:
F:\gitP\rhalbersma\dctl\include\dctl/core/model/detail/builder.hpp(221,86): error C2280: 'bool dctl::core::basic_action<dctl::core::block_adl::international,dctl::core::block_adl::basic_boarddctl::core::block_adl::international>::operator ==(const dctl::core::basic_action<dctl::core::block_adl::international,dctl::core::block_adl::basic_boarddctl::core::block_adl::international> &) const': attempting to reference a deleted function [F:\gitP\rhalbersma\dctl\build_amd64\example\play.vcxproj]
F:\gitP\rhalbersma\dctl\include\dctl/core/model/detail/builder.hpp(221,86): error C2088: '==': illegal for class [F:\gitP\rhalbersma\dctl\build_amd64\example\play.vcxproj]
F:\gitP\rhalbersma\dctl\include\dctl/core/model/detail/builder.hpp(221,37): error C3889: call to object of class type 'std::ranges::_None_of_fn': no matching call operator found [F:\gitP\rhalbersma\dctl\build_amd64\example\play.vcxproj]
F:\gitP\rhalbersma\dctl\include\dctl/core/model/detail/builder.hpp(204,55): error C2297: '||': not valid as right operand has type 'void' [F:\gitP\rhalbersma\dctl\build_amd64\example\play.vcxproj]
F:\tools\boost_1_70_0\x64\boost/graph/topological_sort.hpp(44,1): error C2220: the following warning is treated as an error [F:\gitP\rhalbersma\dctl\build_amd64\test\egdb.divide.vcxproj]

log
build.log

DCTL failed to run egdb.database test on release and debug configuration with MSVC on Windows

DCTL failed to run egdb.database test on release and debug configuration with MSVC on Windows. It can be reproduced on master branch latest reversion a63d2a3. Could you help take a look at this? Thanks a lot.

Repro steps:

  1. git clone https://github.com/rhalbersma/dctl.git D:\DCTL\src
  2. open a VS 2017 amd64 command prompt as admin and browse to D:\DCTL
  3. git clone https://github.com/rhalbersma/xstd.git D:\DCTL\xstd
  4. git clone https://github.com/rhalbersma/bit_set.git D:\DCTL\bit_set
  5. put boost_1_69_0 under C:\boost_1_69_0\x64
  6. cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_SYSTEM_VERSION=10.0.17134.0 -DBOOST_ROOT=C:\boost_1_69_0\x64\boost -DBOOST_INCLUDEDIR=C:\boost_1_69_0\x64 ..\src\
  7. msbuild /m /p:Configuration=Release;Platform=x64 dctl.sln /t:Rebuild
  8. ctest --build-config Release -E "egdb.divide|search|traversal"

log_x64_test.log

Failures:
Start 35: egdb.database
35/37 Test #35: egdb.database ........................Exit code 0xc0000135
***Exception: 0.05 sec
Start 36: egdb.index
36/37 Test #36: egdb.index ........................... Passed 0.34 sec
Start 37: util.literals
37/37 Test #37: util.literals ........................ Passed 0.05 sec

97% tests passed, 1 tests failed out of 37

Total Test time (real) = 2.87 sec

The following tests FAILED:
35 - egdb.database (Exit code 0xc0000135
)

update readme.md

  • GitHub instead of BitBucket
  • latest versions of clang, libstdc++, Boost

DCTL failed with error C2988 C2059 C2334 when built by msvc on Windows

DCTL failed with C2988 C2059 C2334 when built by msvc on Windows, I use source db7db34 on master branch. Could you help take a look at this? Noted that this issue only found when compiles with unreleased vctoolset, that next release of MSVC will have this behavior.

Repro steps:

  1. git clone https://github.com/rhalbersma/dctl.git D:\DCTL\src
  2. open a VS 2017 amd64 command prompt as admin and browse to D:\DCTL
  3. git clone https://github.com/rhalbersma/xstd.git D:\DCTL\xstd
  4. git clone https://github.com/rhalbersma/bit_set.git D:\DCTL\bit_set
  5. put boost_1_67_0 under C:\boost_1_67_0\x64
  6. cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_SYSTEM_VERSION=10.0.17134.0 -DBOOST_ROOT=C:\boost_1_67_0\x64\boost -DBOOST_INCLUDEDIR=C:\boost_1_67_0\x64 ..\src\
  7. msbuild /m /p:Configuration=Release;Platform=x64 dctl.sln /t:Rebuild

Failures:
D:\DCTL\src\include\dctl\core\board\basic_board.hpp(142,1): error C2988: unrecognizable template declaration/definition
XSTD_PP_CONSTEXPR_INTRINSIC static auto squares_filter(UnaryPredicate pred) noexcept
^
D:\DCTL\src\include\dctl\core\board\basic_board.hpp(301): note: see reference to class template instantiation 'dctl::core::block_adl::basic_board' being compiled
};
D:\DCTL\src\include\dctl\core\board\basic_board.hpp(142,1): error C2059: syntax error: 'constant'
XSTD_PP_CONSTEXPR_INTRINSIC static auto squares_filter(UnaryPredicate pred) noexcept
^
D:\DCTL\src\include\dctl\core\board\basic_board.hpp(143,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
{
^

complete Frisian draughts

We are currently lacking data members in the state class to track the most recently moved kings.

  • define data structure tracking the most recently moved kings
  • modify operator<< to print out the number of moves for the most recently moved kings

DCTL failed with error C2679 when build by msvc on Windows

DCTL failed with error C2679 when build by msvc on Windows, I use latest version 2ee0699 on master branch. Could you please help take a look at this? Noted that this issue only found when compiles with unreleased vctoolset, that next release of MSVC will have this behavior.

You can repro this issue as the steps below:

  1. git clone https://github.com/rhalbersma/dctl.git D:\DCTL\src
  2. git clone https://github.com/rhalbersma/xstd.git D:\DCTL\xstd
  3. git clone https://github.com/rhalbersma/int_set.git D:\DCTL\int_set
  4. extract boost_1_67_0.zip to D:\DCTL\boost_1_67_0\x64
  5. open a VS 2017 amd64 command prompt as admin and browse to D:\DCTL
  6. cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_SYSTEM_VERSION=10.0.17134.0 -DBOOST_ROOT=D:\DCTL\boost_1_67_0\x64\boost -DBOOST_INCLUDEDIR=D:\DCTL\boost_1_67_0\x64 ..\src\
  7. msbuild /m /p:Configuration=Release;Platform=x64 dctl.sln /t:Rebuild

Our workaround:
database.hpp:
std::copy(m_files.begin(), m_files.end(), std::ostream_iteratorstd::string(std::cout, "\n"));
=>
std::copy(m_files.begin(), m_files.end(), std::ostream_iterator<std::wstring, wchar_t>(std::wcout, L"\n"));

Error info:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\xutility(1784): error C2679: binary '=': no operator found which takes a right-hand operand of type 'std::filesystem::path' (or there is no acceptable conversion)
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\iterator(232): note: could be 'std::ostream_iterator<std::string,char,std::char_traits> &std::ostream_iterator<std::string,char,std::char_traits>::operator =(std::ostream_iterator<std::string,char,std::char_traits> &&)'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\iterator(232): note: or 'std::ostream_iterator<std::string,char,std::char_traits> &std::ostream_iterator<std::string,char,std::char_traits>::operator =(const std::ostream_iterator<std::string,char,std::char_traits> &)'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\iterator(208): note: or 'std::ostream_iterator<std::string,char,std::char_traits> &std::ostream_iterator<std::string,char,std::char_traits>::operator =(const _Ty &)'
with
[
_Ty=std::string
]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\xutility(1784): note: while trying to match the argument list '(std::ostream_iterator<std::string,char,std::char_traits>, std::filesystem::path)'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\xutility(1821): note: see reference to function template instantiation '_OutIt std::_Copy_uncheckedstd::filesystem::path*,_Iter(_InIt,_InIt,_OutIt)' being compiled
with
[
_OutIt=std::ostream_iterator<std::string,char,std::char_traits>,
_Iter=std::ostream_iterator<std::string,char,std::char_traits>,
_InIt=std::filesystem::path *
]
D:\DCTL\src\include\dctl\egdb\database.hpp(53): note: see reference to function template instantiation '_OutIt std::copy<std::_Vector_iterator<std::_Vector_val<std::_Simple_types<_Ty>>>,std::ostream_iterator<std::string,char,std::char_traits>>(_InIt,_InIt,_OutIt)' being compiled
with
[
_OutIt=std::ostream_iterator<std::string,char,std::char_traits>,
_Ty=std::filesystem::path,
_InIt=std::_Vector_iterator<std::_Vector_val<std::_Simple_typesstd::filesystem::path>>
]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\filesystem(2066): note: see reference to class template instantiation 'std::chrono::time_pointstd::filesystem::_File_time_clock,std::filesystem::_File_time_clock::duration' being compiled
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\xstring(1689): note: see reference to class template instantiation 'std::basic_string_view<wchar_t,std::char_traits<wchar_t>>' being compiled

Investigate code coverage

  • put code inside if constexp on separate line
  • eliminate old fill-based move detection/generation
  • eliminate code that was put there for completeness (YAGNI)

Add support for Tanzanian rule

Do not forget to add Tanzanian rule (American checkers but with flying king) we will appreciate. It is only available in few apps, but most famous one is Dalmax checkers for Android.

Generalize action building

  • store visited squares and jump order (suitable for GUIs that do jump path animation)
  • counting container (incrementing a counter, rather than building an action) when keeping duplicates
    • for trivial jump precedence
    • for non-trivial jump precedence
  • successor container (building the successor state, rather than an action)
  • make an action_view (inspired by std::string_view) that can adopt either
    • an action
    • a state and an action
    • two states
  • action_view should support
    • jump precedence comparisons
    • make on states
    • undo on states

Explore design space of endgame database building

  • Binomial coefficients
    • ranking/unranking of combinations (colex)
    • ranking/unranking of positions
    • increment/decrement of combinations (colex)
    • increment/decrement of positions
    • gappless position indexing
    • symmetry reduced indexing
  • Subdivisions
    • by piece counts
    • by piece counts, leading ranks (any region)
    • by piece counts, leading ranks, leading rank configurations
    • by piece counts, leading ranks, leading rank configurations, subleading ranks
  • Conversions
    • enumerate capture conversions
    • enumerate promotion conversions
    • enumerate leading rank conversions
    • enumerate subleading rank conversions
  • Build dependencies
    • create Boost.Graph (vertices = subdivisions, edges = conversions)
    • topological sort for valid build order
    • total work
    • minimal memory requirements
    • uniform-cost search for critical path
    • potential parallelism
    • bread-first search for parallel build order
  • Build algorithm
    • forward iteration
    • backward iteration
    • outcounting
    • leapfrog
    • one-sided vs. two-sided
  • Metric
    • bitbases (won, not won)
    • WLD (win, loss, draw)
    • DTZ (distance to zeroing move)
    • DTM (distance to mate)
  • Statistics
    • disk I/O
    • memory access
    • moves generated
    • moves done/undone
    • ranking/unranking
    • estimate performance model (per build algorithm)
    • automate build algorithm selection per subdivision
  • Storage
    • design format of db, idx, log, stats files
    • serialization of std::vector, boost::dynamic_bitset
    • explore iostreams performance settings
  • Compression
    • run-length
    • Tunstall
    • explore Re-Pair
  • Access
    • LRU cache
    • explore memory mapped I/O

Investigate per-piece vs per-direction processing

  • For densely packed pieces, it is likely cheaper to do per-direction filtering, and then per-piece processing.
  • For sparsely packed pieces, it is likely cheaper to do per-piece processing over all directions simultaneously.

A good proxy for sparsity might be the number of empty squares minus 4 times (or another small power of 2) the number of pieces:

  • if this is negative, the pieces are dense (say 40 pawns on a 10x10 board, 50 - (4 + 1) * 40 = -150).

  • if this is non-negative, the pieces are sparse (say 10 kings on a 10x10 board: 50 - (4 + 1) * 10 = 0).

  • Since the initial position starts with densely packed men, the default for pawns should be per-direction filtering followed by per-piece processing.

  • In endgames, pieces are mostly sparsely packed, the default for kings should therefore be per-piece processing over all directions simultaneously.

The question is whether we should dynamically check for sparsity for pawns and kings. In pathological positions (40 kings e.g.) we get a massive slow-down. If __builtin_expect is cheap enough, it might be worthwhile to test for this. Note that we currently already check for pieces(/*piece type*/).empty(). Instead, we might now branch on pieces(/*piece type*/).count().

Note that for long-ranged king moves, per-direction filtering should be followed by per-piece lookups on the remaining empty squares ahead. This is what Moby Dam implements unconditionally.

remove board::mask namespace

The various variable templates should live in the dctl namespace, similar to the rule traits.

  • make variable templates for the various mask classes
  • move the variable templates into board_traits.hpp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.