serg-meus / k2 Goto Github PK
View Code? Open in Web Editor NEWChess engine with UCI and Xboard interface
License: GNU General Public License v3.0
Chess engine with UCI and Xboard interface
License: GNU General Public License v3.0
In release versions 0.87 and 0.83 detected crash in the following position:
6k1/5pp1/8/7b/3r3p/3q2bP/6PR/5Q1K w - - 0 3
step
!git clone https://github.com/serg-meus/k2
!cd k2 && make
!cp k2/k2 /bin/
result
when using xboard protocol
[/usr/local/lib/python3.9/dist-packages/chess/engine.py](https://localhost:8080/#) in communicate(self, command_factory)
1092 self.command._cancel(self)
1093
-> 1094 return await command.result
1095
1096 def __repr__(self) -> str:
EngineError: xboard engine did not declare required feature: ping
Under Arena and Fritz GUI detected engine time waste if type of time control is set so that it changes during the game. For example, first TC is set to 5 min per 40 moves and second TC is set to 3 minutes for all the rest moves. In that case after 40 move engine will waste all 3 minutes for move 41.
Detected freeze for all engine versions begins from 0.57 in the following position:
3k4/8/2P5/3N2n1/n7/5N2/8/8 b - - 0 1
I'm using K2 0.83 with PicoChess using python-chess by @niklasf. I compiled K2 on Raspberry Pi 3 with -march=armv6 to ensure backwards compatibility with RPi2.
The problem is: when K2 leaves the opening book it stops responding. What could be the cause?
There was another engine, Cinnamon by @gekomad, which also had this error. It was related to an infinite loop when closing stdin and to the use of isready/readyok. Cinnamon has been fixed now (pull requests #3 and #4).
Traceback (most recent call last):
File "./picochess.py", line 841, in
main()
File "./picochess.py", line 788, in main
stop_search_and_clock()
File "./picochess.py", line 205, in stop_search_and_clock
stop_search()
File "./picochess.py", line 198, in stop_search
engine.stop()
File "/opt/picochess/engine.py", line 230, in stop
self.engine.stop()
File "/usr/local/lib/python3.4/dist-packages/chess/uci.py", line 1249, in stop
return self._queue_command(command, async_callback)
File "/usr/local/lib/python3.4/dist-packages/chess/uci.py", line 890, in _queue_command
return future.result()
File "/usr/lib/python3.4/concurrent/futures/_base.py", line 397, in result
self._condition.wait(timeout)
File "/usr/lib/python3.4/threading.py", line 290, in wait
waiter.acquire()
the UCI "stop" command does not work in version 0.91 .. but in 0.87 is does !?
Hi Sergey,
we had something similar on #1 (comment)
Can y consider to support this (by uci docu needed) feature, please?
Jürgen
crashed with mingw64 gcc after "uci" command
so as for me safest build with:
g++ main.cpp engine.cpp eval.cpp hash.cpp movegen.cpp chess.cpp Timer.cpp -std=c++0x -march=native -static -fno-exceptions -pipe -funroll-loops -ffunction-sections -Wl,--gc-sections -Wl,--strip-all -Wall -Wcast-qual -pedantic -Wextra -Wshadow -O3 -DNDEBUG=1 -o k2
but it produced warnings below:
main.cpp: In member function 'void k2main::SetboardCommand(std::__cxx11::string)':
main.cpp:267:44: warning: cast from type 'const char*' to type 'char*' casts away qualifiers [-Wcast-qual]
if(!FenStringToEngine((char )in.c_str()))
^
main.cpp: In member function 'void k2main::PerftCommand(std::__cxx11::string)':
main.cpp:298:11: warning: declaration of 'timer' shadows a member of 'k2main' [-Wshadow]
Timer timer;
^~~~~
In file included from main.h:1:0,
from main.cpp:1:
engine.h:63:11: note: shadowed declaration is here
Timer timer;
^~~~~
main.cpp: In member function 'void k2main::PositionCommand(std::__cxx11::string)':
main.cpp:661:55: warning: cast from type 'const char' to type 'char*' casts away qualifiers [-Wcast-qual]
if(!FenStringToEngine((char )fenstring.c_str()))
^
main.cpp: In member function 'void k2main::ProcessMoveSequence(std::__cxx11::string)':
main.cpp:695:47: warning: cast from type 'const char' to type 'char*' casts away qualifiers [-Wcast-qual]
if(!MakeMoveFinaly((char *)arg1.c_str()))
^
engine.cpp: In member function 'bool k2engine::MoveIsPseudoLegal(k2chess::move_c&, bool)':
engine.cpp:1571:67: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
if(get_col(from_coord) != 4 || get_row(from_coord) != stm ? 0 : 7)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
eval.cpp: In member function 'k2chess::score_t k2eval::KingOpenFiles(k2chess::side_to_move_t)':
eval.cpp:1033:14: warning: declaration of 'k' shadows a previous local [-Wshadow]
auto k = pawn_max[get_col(*rit)][king_color] ? 1 : 2;
^
eval.cpp:1002:10: note: shadowed declaration is here
auto k = *king_coord[king_color];
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.