GithubHelp home page GithubHelp logo

witek902 / caissa Goto Github PK

View Code? Open in Web Editor NEW
54.0 6.0 11.0 92.31 MB

Strong chess engine

License: MIT License

C++ 50.63% C 48.30% CMake 0.40% Makefile 0.31% Shell 0.10% Python 0.23% Batchfile 0.03%
chess ai neural-network cpp nnue

caissa's People

Contributors

skiminki avatar witek902 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

caissa's Issues

Reflect a bug in Caissa1.14.1

3r3k/7p/2Q5/8/2B2PK1/6P1/4P3/5q2 b - - 98 99
Please forgive me for my poor English. Caissa1.14.1 is very powerful! But there is a bug, the above situation went through Rd8-d4 in the engine league, resulting in one step being killed by the king. I hope to correct it.

about the Contempt options

hi,

i just managed to compile your v1.12 on Xubuntu 22.04, AVX2 version .. i see two "contempt" options 'Static' and 'Dynamic' .. what are those ?

as i understand 'contempt' is something like 'optimism' .. i can imagine how playing style & bestmove can be different when setting such values .. maybe you even have test positions to show the effect of these options ?

how to get PNN file ?

hi, i managed to compile your newest Caissa on Linux .. the UCI info says v1.6.11 but also : Failed to load default neural network eval-7.pnn .. indeed this file is missing, where to get it ?

Android compitability

Any chance that the source code will become compatible with Android again (arm64-v8a and armeabi-v7a)?

connection stalls in CuteChess

i let Caissa v1.3 play several games in CuteChess .. all went well but it lost the last game on time : "connection stalls" .. see screenshot. At that moment Caissa had a lost position anyway, maybe that was the cause, but it shouldn't happen. The CuteChess log did not show anything. I don't know what can be done to fix this, i just want to mention this incident.

Caissa_v1-3_connection_stalls

Caissa 1.11 disconnections/Crashes/Timeouts

OS: Archlinux

Caissa works, tested in Nibbler GUI and everything was fine yet it seems something is wrong as I try to make it play games against other engines in Cutechess gui nor BanksiaGUI. I am curious about if it is also the same for Windows.

unable to compile v1.7 on Linux

again i'm unable to compile your (v1.7) source files on Linux .. i tried to get the source files by git clone and also the supplied ZIP, both fail :

[ i'm on Xubuntu 22.04 ]

$ make
[  1%] Building CXX object src/backend/CMakeFiles/backend.dir/Bitboard.cpp.o
[  3%] Building CXX object src/backend/CMakeFiles/backend.dir/Common.cpp.o
[  5%] Building CXX object src/backend/CMakeFiles/backend.dir/Endgame.cpp.o
In file included from /home/roelof/Compiled/Caissa-1.7/src/backend/Endgame.cpp:7:
/home/roelof/Compiled/Caissa-1.7/src/backend/MoveGen.hpp:13:8: error: duplicate ‘inline’
   13 | INLINE inline void GeneratePromotionsMoveList(const Square from, const Square to, MoveList& outMoveList)
      |        ^~~~~~
      |        ------
In file included from /home/roelof/Compiled/Caissa-1.7/src/backend/Endgame.cpp:7:
/home/roelof/Compiled/Caissa-1.7/src/backend/MoveGen.hpp: In lambda function:
/home/roelof/Compiled/Caissa-1.7/src/backend/MoveGen.hpp:59:101: error: expected primary-expression before ‘)’ token
   59 |                 Square(targetIndex).Shift_Unsafe<pawnRevDirection>().Shift_Unsafe<pawnRevDirection>(),
      |                                                                                                     ^
In file included from /home/roelof/Compiled/Caissa-1.7/src/backend/Endgame.cpp:8:
/home/roelof/Compiled/Caissa-1.7/src/backend/Math.hpp: In function ‘uint64_t MulHi64(uint64_t, uint64_t)’:
/home/roelof/Compiled/Caissa-1.7/src/backend/Math.hpp:35:23: warning: ISO C++ does not support ‘__int128’ for ‘type name’ [-Wpedantic]
   35 |     return ((unsigned __int128)a * (unsigned __int128)b) >> 64;
      |                       ^~~~~~~~
/home/roelof/Compiled/Caissa-1.7/src/backend/Math.hpp:35:46: warning: ISO C++ does not support ‘__int128’ for ‘type name’ [-Wpedantic]
   35 |     return ((unsigned __int128)a * (unsigned __int128)b) >> 64;
      |                                              ^~~~~~~~
In file included from /home/roelof/Compiled/Caissa-1.7/src/backend/Endgame.cpp:7:
/home/roelof/Compiled/Caissa-1.7/src/backend/MoveGen.hpp: In instantiation of ‘void GeneratePawnMoveList(const Position&, MoveList&) [with MoveGenerationMode mode = MoveGenerationMode::Quiets; Color sideToMove = Color::White]’:
/home/roelof/Compiled/Caissa-1.7/src/backend/MoveGen.hpp:227:43:   required from ‘void GenerateMoveList(const Position&, MoveList&) [with MoveGenerationMode mode = MoveGenerationMode::Quiets; Color sideToMove = Color::White]’
/home/roelof/Compiled/Caissa-1.7/src/backend/MoveGen.hpp:273:45:   required from ‘void GenerateMoveList(const Position&, MoveList&) [with MoveGenerationMode mode = MoveGenerationMode::Quiets]’
/home/roelof/Compiled/Caissa-1.7/src/backend/MoveGen.hpp:284:49:   required from here
/home/roelof/Compiled/Caissa-1.7/src/backend/MoveGen.hpp:59:82: error: no match for ‘operator<’ (operand types are ‘<unresolved overloaded function type>’ and ‘const Direction’)
   59 |                 Square(targetIndex).Shift_Unsafe<pawnRevDirection>().Shift_Unsafe<pawnRevDirection>(),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/roelof/Compiled/Caissa-1.7/src/backend/MoveGen.hpp: In instantiation of ‘void GeneratePawnMoveList(const Position&, MoveList&) [with MoveGenerationMode mode = MoveGenerationMode::Quiets; Color sideToMove = Color::Black]’:
/home/roelof/Compiled/Caissa-1.7/src/backend/MoveGen.hpp:227:43:   required from ‘void GenerateMoveList(const Position&, MoveList&) [with MoveGenerationMode mode = MoveGenerationMode::Quiets; Color sideToMove = Color::Black]’
/home/roelof/Compiled/Caissa-1.7/src/backend/MoveGen.hpp:277:45:   required from ‘void GenerateMoveList(const Position&, MoveList&) [with MoveGenerationMode mode = MoveGenerationMode::Quiets]’
/home/roelof/Compiled/Caissa-1.7/src/backend/MoveGen.hpp:284:49:   required from here
/home/roelof/Compiled/Caissa-1.7/src/backend/MoveGen.hpp:59:82: error: no match for ‘operator<’ (operand types are ‘<unresolved overloaded function type>’ and ‘const Direction’)
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-four-char-constants’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-nested-anon-types’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-gnu-anonymous-struct’ may have been intended to silence earlier diagnostics
make[2]: *** [src/backend/CMakeFiles/backend.dir/build.make:104: src/backend/CMakeFiles/backend.dir/Endgame.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:149: src/backend/CMakeFiles/backend.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Compiles

Hi,

may you release a non-AVX2/BMI version too, please? I can't run it, I'm limited to AVS and SSE.

Thanx,
Alex

more endgame knowledge

hi, your v1.9 release page states "Add more endgame knowledge, should evaluate some fortress positions better" .. well, a known issue here is mate with 2 kNights, which will never happen, but many engines do not fear to exchange pieces and pawns to reach such position, while they think it is winning due to the material balance .. however, without a pawn, White team KkPP will never win, eg. see https://en.wikipedia.org/wiki/Two_knights_endgame .. Btw. also read about the exception : the opponent might have (only) one pawn, then a mate is possible ..

is Caissa aware of this matter ?

Android NDK

When I compile with Android NDK (which uses the Clang compiler) by using the flag "-DUSE_ARM_NEON", I get the following error message:

backend/PackedNeuralNetwork.cpp:544:33: fatal error: no matching function for call to 'vaddq_s32'
val += vaddvq_s32(vaddq_s32(vaddq_s32(sumA, sumB, vaddq_s32(sumC, sumD));

I assume the line must look like this:

val += vaddvq_s32(vaddq_s32(vaddq_s32(sumA, sumB), vaddq_s32(sumC, sumD)));

Finally, an additional "#include <cmath>" is required in Evaluate.hpp.

With these changes, Caissa compiles smoothly with Android NDK.

compile on Linux ?

is the source code also for Linux ? I guess not .. after doing cmake -DCMAKE_BUILD_TYPE=Debug i get a makefile .. then i do make but i get these errors :

~/Compiled/Caissa$ make
[  2%] Building CXX object src/backend/CMakeFiles/backend.dir/Bitboard.cpp.o
[  4%] Building CXX object src/backend/CMakeFiles/backend.dir/Common.cpp.o
[  6%] Building CXX object src/backend/CMakeFiles/backend.dir/Endgame.cpp.o
[  8%] Building CXX object src/backend/CMakeFiles/backend.dir/Evaluate.cpp.o
In file included from /home/roelof/Compiled/Caissa/src/backend/Evaluate.cpp:8:
/home/roelof/Compiled/Caissa/src/backend/Search.hpp:247:44: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
  247 |         using NNEvaluatorContextPtr = std::unique_ptr<NNEvaluatorContext>;
      |                                            ^~~~~~~~~~
/home/roelof/Compiled/Caissa/src/backend/Search.hpp:8:1: note: ‘std::unique_ptr’ is defined in header ‘<memory>’; did you forget to ‘#include <memory>’?
    7 | #include "Memory.hpp"
  +++ |+#include <memory>
    8 | #include "NeuralNetworkEvaluator.hpp"
/home/roelof/Compiled/Caissa/src/backend/Search.hpp:248:9: error: ‘NNEvaluatorContextPtr’ does not name a type; did you mean ‘NNEvaluatorContext’?
  248 |         NNEvaluatorContextPtr nnContextStack[MaxSearchDepth];
      |         ^~~~~~~~~~~~~~~~~~~~~
      |         NNEvaluatorContext
cc1plus: note: unrecognized command-line option ‘-Wno-four-char-constants’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-nested-anon-types’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-gnu-anonymous-struct’ may have been intended to silence earlier diagnostics
make[2]: *** [src/backend/CMakeFiles/backend.dir/build.make:118: src/backend/CMakeFiles/backend.dir/Evaluate.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:149: src/backend/CMakeFiles/backend.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

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.