rosenthj / winter Goto Github PK
View Code? Open in Web Editor NEWUCI Chess Engine
License: GNU General Public License v3.0
UCI Chess Engine
License: GNU General Public License v3.0
Used the provided Makefile to compile version 0.60 on macOS 13.6 and got this error:
...
...
g++ -c -DNDEBUG -Ofast -flto -g3 -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/board.cc -o src/board.osrc/board.cc:138:20: error: constexpr variable 'all_castling_squares' must be
initialized by a constant expression
...all_castling_squares = castling_relevant_bbs[0] | castling_relevant_bbs[1]
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/board.cc:138:43: note: non-constexpr function 'operator[]' cannot be used in
a constant expression
constexpr BitBoard all_castling_squares = castling_relevant_bbs[0] | cas...
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/array:193:21: note:
declared here
const_reference operator[](size_type __n) const {return _elems[__n];}
^
1 error generated.
make: *** [src/board.o] Error 1
BTW: Winter 0.55 compiles fine (only 3 warnings about unused variable & function). My compiler:
g++ --version Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 10.0.0 (clang-1000.10.44.4) Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Hi,
Would you please compile it for android?
Thanks.
Hi again.
Look at this game:
[Event "PGN Import"]
[Site "?"]
[Date "?"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "*"]
[ECO "C83"]
[Opening "Spanische Partie"]
[Variation "Offene Verteidigung, Klassisch, 10.Nbd2 O-O 11.Bc2 f5 12.Nb3"]
[TimeControl "40/120:40/120:40/120"]
[Termination "unterminated"]
[PlyCount "200"]
[WhiteType "human"]
[BlackType "human"]
My engine played 101. Nb4?? believing that the next move of the opponent triggers 50-moves-draw.
And so does Winter-0.4. But next move then is 101. โฆ Bf2 mate.
I'm not a Chess Player myself but people in Grahams Chat told me that mate has priority to 50 moves counter full. So we probably have to fix that in both of our engines.
it seems you train NN files almost every day, i regularly receive an email message about it. Now i wonder : are these nets getting better ? Or are you just testing ? I managed to compile your latest source and it gave me v1.09, but it's a rather small file of 1 Mb and i guess the NN is included .. are those NNs that small ? Most (SF) NNs are about 20 Mb or even 45 Mb .. can you explain ?
Winter runs fine in CuteChess and it's strong ! Thanks.
[ i'm on Xubuntu 22.04 ]
hi jonathan,
we discussed winter participating in TCEC season 14 not too long ago.
winter is invited to participate in the entrance division, would you be so kind as to contact me or anton about the details?
thank you in advance,
kan
PS there is also a tcec discord for easier communication now
src/learning/linear_algebra.h:286:19:
error: unknown type name '__m128'
using SIMDFloat = __m128;
^
src/learning/linear_algebra.h:291:18: error: unknown type name 'SIMDFloat'
inline float sum(SIMDFloat v) {
^
src/learning/linear_algebra.h:292:3: error: unknown type name 'SIMDFloat'
SIMDFloat shuf = _mm_shuffle_ps(v, v, _MM_SHUFFLE(2, 3, 0, 1));
^
src/learning/linear_algebra.h:292:41: error: use of undeclared identifier '_MM_SHUFFLE'
SIMDFloat shuf = _mm_shuffle_ps(v, v, _MM_SHUFFLE(2, 3, 0, 1));
^
src/learning/linear_algebra.h:293:3: error: unknown type name 'SIMDFloat'
SIMDFloat sums = _mm_add_ps(v, shuf);
^
src/learning/linear_algebra.h:299:8: error: unknown type name 'SIMDFloat'
inline SIMDFloat add(const SIMDFloat a, const SIMDFloat b) { return _mm_add_ps(a, b); }
^
src/learning/linear_algebra.h:299:28: error: unknown type name 'SIMDFloat'
inline SIMDFloat add(const SIMDFloat a, const SIMDFloat b) { return _mm_add_ps(a, b); }
^
src/learning/linear_algebra.h:299:47: error: unknown type name 'SIMDFloat'
inline SIMDFloat add(const SIMDFloat a, const SIMDFloat b) { return _mm_add_ps(a, b); }
^
src/learning/linear_algebra.h:300:8: error: unknown type name 'SIMDFloat'
inline SIMDFloat multiply(const SIMDFloat a, const SIMDFloat b) { return _mm_mul_ps(a, b); }
^
src/learning/linear_algebra.h:300:33: error: unknown type name 'SIMDFloat'
inline SIMDFloat multiply(const SIMDFloat a, const SIMDFloat b) { return _mm_mul_ps(a, b); }
^
src/learning/linear_algebra.h:300:52: error: unknown type name 'SIMDFloat'
inline SIMDFloat multiply(const SIMDFloat a, const SIMDFloat b) { return _mm_mul_ps(a, b); }
^
src/learning/linear_algebra.h:301:36: error: unknown type name 'SIMDFloat'
inline void store(float* mem_addr, SIMDFloat a) { _mm_storeu_ps(mem_addr, a); }
^
src/learning/linear_algebra.h:302:8: error: unknown type name 'SIMDFloat'
inline SIMDFloat load(float const* mem_addr) { return _mm_loadu_ps(mem_addr); }
^
src/learning/linear_algebra.h:302:55: error: use of undeclared identifier '_mm_loadu_ps'
inline SIMDFloat load(float const* mem_addr) { return _mm_loadu_ps(mem_addr); }
^
src/learning/linear_algebra.h:303:8: error: unknown type name 'SIMDFloat'
inline SIMDFloat max(SIMDFloat a, SIMDFloat b) { return _mm_max_ps(a, b); }
^
src/learning/linear_algebra.h:303:22: error: unknown type name 'SIMDFloat'
inline SIMDFloat max(SIMDFloat a, SIMDFloat b) { return _mm_max_ps(a, b); }
^
src/learning/linear_algebra.h:303:35: error: unknown type name 'SIMDFloat'
inline SIMDFloat max(SIMDFloat a, SIMDFloat b) { return _mm_max_ps(a, b); }
^
src/learning/linear_algebra.h:304:8: error: unknown type name 'SIMDFloat'
inline SIMDFloat set(float a) { return _mm_set1_ps(a); }
^
src/learning/linear_algebra.h:304:40: error: use of undeclared identifier '_mm_set1_ps'
inline SIMDFloat set(float a) { return _mm_set1_ps(a); }
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Makefile:29: src/learning/cluster.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from src/learning/machine_learning.cc:30:
In file included from src/learning/machine_learning.h:30:
src/learning/linear_algebra.h:286:19: error: unknown type name '__m128'
using SIMDFloat = __m128;
^
src/learning/linear_algebra.h:291:18: error: unknown type name 'SIMDFloat'
inline float sum(SIMDFloat v) {
^
src/learning/linear_algebra.h:292:3: error: unknown type name 'SIMDFloat'
SIMDFloat shuf = _mm_shuffle_ps(v, v, _MM_SHUFFLE(2, 3, 0, 1));
^
src/learning/linear_algebra.h:292:41: error: use of undeclared identifier '_MM_SHUFFLE'
SIMDFloat shuf = _mm_shuffle_ps(v, v, _MM_SHUFFLE(2, 3, 0, 1));
^
src/learning/linear_algebra.h:293:3: error: unknown type name 'SIMDFloat'
SIMDFloat sums = _mm_add_ps(v, shuf);
^
src/learning/linear_algebra.h:299:8: error: unknown type name 'SIMDFloat'
inline SIMDFloat add(const SIMDFloat a, const SIMDFloat b) { return _mm_add_ps(a, b); }
^
src/learning/linear_algebra.h:299:28: error: unknown type name 'SIMDFloat'
inline SIMDFloat add(const SIMDFloat a, const SIMDFloat b) { return _mm_add_ps(a, b); }
^
src/learning/linear_algebra.h:299:47: error: unknown type name 'SIMDFloat'
inline SIMDFloat add(const SIMDFloat a, const SIMDFloat b) { return _mm_add_ps(a, b); }
^
src/learning/linear_algebra.h:300:8: error: unknown type name 'SIMDFloat'
inline SIMDFloat multiply(const SIMDFloat a, const SIMDFloat b) { return _mm_mul_ps(a, b); }
^
src/learning/linear_algebra.h:300:33: error: unknown type name 'SIMDFloat'
inline SIMDFloat multiply(const SIMDFloat a, const SIMDFloat b) { return _mm_mul_ps(a, b); }
^
src/learning/linear_algebra.h:300:52: error: unknown type name 'SIMDFloat'
inline SIMDFloat multiply(const SIMDFloat a, const SIMDFloat b) { return _mm_mul_ps(a, b); }
^
src/learning/linear_algebra.h:301:36: error: unknown type name 'SIMDFloat'
inline void store(float* mem_addr, SIMDFloat a) { _mm_storeu_ps(mem_addr, a); }
^
src/learning/linear_algebra.h:302:8: error: unknown type name 'SIMDFloat'
inline SIMDFloat load(float const* mem_addr) { return _mm_loadu_ps(mem_addr); }
^
src/learning/linear_algebra.h:302:55: error: use of undeclared identifier '_mm_loadu_ps'
inline SIMDFloat load(float const* mem_addr) { return _mm_loadu_ps(mem_addr); }
^
src/learning/linear_algebra.h:303:8: error: unknown type name 'SIMDFloat'
inline SIMDFloat max(SIMDFloat a, SIMDFloat b) { return _mm_max_ps(a, b); }
^
src/learning/linear_algebra.h:303:22: error: unknown type name 'SIMDFloat'
inline SIMDFloat max(SIMDFloat a, SIMDFloat b) { return _mm_max_ps(a, b); }
^
src/learning/linear_algebra.h:303:35: error: unknown type name 'SIMDFloat'
inline SIMDFloat max(SIMDFloat a, SIMDFloat b) { return _mm_max_ps(a, b); }
^
src/learning/linear_algebra.h:304:8: error: unknown type name 'SIMDFloat'
inline SIMDFloat set(float a) { return _mm_set1_ps(a); }
^
src/learning/linear_algebra.h:304:40: error: use of undeclared identifier '_mm_set1_ps'
inline SIMDFloat set(float a) { return _mm_set1_ps(a); }
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.``
please support make on Raspberry Pi 4 (AARM64)
Can you build a Korean chess engine?
Patiently awaiting the training script and guide :)
Thanks rosenthj
When trying to compile for my Rock64, a Raspberry Pi like SBC, I got an error here:
root@rock64:~/Winter# make -j4
g++ -c -DNDEBUG -O3 -flto -g3 -Wall -Wno-sign-compare -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/general/bookkeeping.cc -o src/general/bookkeeping.o
g++ -c -DNDEBUG -O3 -flto -g3 -Wall -Wno-sign-compare -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/general/wdl_score.cc -o src/general/wdl_score.o
g++ -c -DNDEBUG -O3 -flto -g3 -Wall -Wno-sign-compare -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/general/debug.cc -o src/general/debug.o
g++ -c -DNDEBUG -O3 -flto -g3 -Wall -Wno-sign-compare -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/general/parse.cc -o src/general/parse.o
g++ -c -DNDEBUG -O3 -flto -g3 -Wall -Wno-sign-compare -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/general/magic.cc -o src/general/magic.o
g++ -c -DNDEBUG -O3 -flto -g3 -Wall -Wno-sign-compare -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/learning/machine_learning.cc -o src/learning/machine_learning.o
src/general/magic.cc:30:10: fatal error: immintrin.h: No such file or directory
#include <immintrin.h>
How is that possible ? Is the NN included ? I guess so ..
Hi Jonathan,
I have successfully compiled Winter for Windows. However, I am not sure if I did it correctly. I see there is a net f192,,,.bin included in the package but how is that used during compilation? I see no reference for it in the makefile. When running the exe, in the options I can't see an option for the net. Is that included in the binary somehow?
I guess LDFLAGS shall be at the end
diff --git a/Makefile b/Makefile
index fe718fa..c23cab8 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ EXE:=Winter
all: $(SOURCES) $(EXE)
$(EXE): $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $@
+ $(CC) $(OBJECTS) -o $@ $(LDFLAGS)
.cc.o:
$(CC) $(CFLAGS) $< -o $@
Hi
It'll be nice to see your engine compete in the future Musketeer Chess tournaments that i'm organising.
Some interesting issues and repositories can be found here:
http://talkchess.com/forum3/viewtopic.php?f=7&t=72572&start=10#p822789
Best regards
Dr HADDAD
www.musketeerchess.net
It's sad that it's not possible to compile the newest version on Android and Linux devices.
Small issue: 0.4 seems to send wrong seldepth info. The values are constant per move and sometimes > 100. Seems to decrease with the moves like a counter to 50 moves draw but not exactly.
I did: gen_eval_csv filename out_filename.
and get three csv files:
okok.dynamic.csv,
okok.res.csv,
okok.static.csv.
What to do next ?
I got Segmentation Fault when trying to execute the UCI commands with the following FEN:
rnbqkbnr/ppp2ppp/3p4/8/3pP3/5N2/PPP2PPP/RNBQKB1R w KQkq d3 1 3
This FEN was obtained after the following moves:
root@rock64:~/Winter# winter
position fen rnbqkbnr/ppp2ppp/3p4/8/3pP3/5N2/PPP2PPP/RNBQKB1R w KQkq d3 1 3
go movetime 3000
Segmentation fault
This fault doesn't seem to occur on two other engines I tested.
Test on Stockfish
root@rock64:~/Winter# stockfish
Stockfish 090620 by T. Romstad, M. Costalba, J. Kiiski, G. Linscott
position fen rnbqkbnr/ppp2ppp/3p4/8/3pP3/5N2/PPP2PPP/RNBQKB1R w KQkq d3 1 3
go movetime 3000
info depth 1 seldepth 1 multipv 1 score cp 369 nodes 40 nps 20000 tbhits 0 time 2 pv d1d4
info depth 2 seldepth 2 multipv 1 score cp 961 nodes 146 nps 36500 tbhits 0 time 4 pv c1g5 c7c6 g5d8 e8d8
info depth 3 seldepth 3 multipv 1 score cp 889 nodes 215 nps 43000 tbhits 0 time 5 pv c1g5 d6d5 g5d8 e8d8 d1d4
info depth 4 seldepth 4 multipv 1 score cp 157 nodes 967 nps 69071 tbhits 0 time 14 pv b1d2 d6d5 e4d5 d8d5
info depth 5 seldepth 6 multipv 1 score cp 157 nodes 1426 nps 67904 tbhits 0 time 21 pv b1d2 d6d5 e4d5 d8d5 d1e2 d5e6
info depth 6 seldepth 8 multipv 1 score cp 88 nodes 3800 nps 108571 tbhits 0 time 35 pv d1d4 b8c6 d4d3 g8f6 b1d2 d8e7
info depth 7 seldepth 10 multipv 1 score cp 115 nodes 7963 nps 132716 tbhits 0 time 60 pv f1c4 g8f6 e1g1 b8c6 f3d4 d8d7
info depth 8 seldepth 12 multipv 1 score cp 84 nodes 21176 nps 169408 tbhits 0 time 125 pv d1d4 b8c6 d4d3 c8d7 c2c3 g8f6 b1d2
info depth 9 seldepth 13 multipv 1 score cp 133 nodes 24670 nps 174964 tbhits 0 time 141 pv d1d4 b8c6 d4d3 g8f6 b1c3 g7g6
info depth 10 seldepth 16 multipv 1 score cp 155 nodes 42854 nps 190462 tbhits 0 time 225 pv f1c4 g8f6 d1d4 b8d7 e1g1 a7a6 b1c3 b7b5 c4e2
info depth 11 seldepth 20 multipv 1 score cp 88 nodes 96502 nps 203590 tbhits 0 time 474 pv f3d4 g8f6 b1c3 f8e7 f1d3 e8g8 h2h3 b8d7 e1g1 d7e5 c3d5 f6d5 e4d5
info depth 12 seldepth 22 multipv 1 score cp 77 nodes 157336 nps 206749 tbhits 0 time 761 pv f3d4 g8f6 b1c3 f8e7 f1b5 c7c6 b5d3 e8g8 e1g1 b8d7 h2h3 d7e5 c1e3 c6c5 d4f3 c8e6 f3e5
info depth 13 seldepth 21 multipv 1 score cp 80 nodes 177008 nps 207755 tbhits 0 time 852 pv f3d4 g8f6 b1c3 f8e7 f1c4 b8c6 d4f5 c8f5 e4f5 e8g8 c3d5 c6e5
info depth 14 seldepth 21 multipv 1 score cp 95 nodes 201747 nps 208847 tbhits 0 time 966 pv f3d4 g8f6 b1c3 f8e7 f1c4 b8c6 d4c6 b7c6 e1g1 e8g8 a1b1 c8e6 d1d3 e6c4 d3c4 c6c5 b2b3
info depth 15 seldepth 25 multipv 1 score cp 100 nodes 470971 nps 214957 hashfull 225 tbhits 0 time 2191 pv f3d4 g8f6 b1c3 f8e7 f1e2 e8g8 e1g1 c7c5 d4f5 c8f5 e4f5 b8c6 e2f3 c6d4 f3b7 a8b8 b7d5 d4f5 g2g4 f6d5
info depth 16 seldepth 25 multipv 1 score cp 79 nodes 651426 nps 216925 hashfull 316 tbhits 0 time 3003 pv f3d4 g8f6
bestmove f3d4 ponder g8f6
quit
Test on Xiphos
root@rock64:~/Winter# xiphos
Xiphos 0.6.1 NO-POPCNT by Milos Tatarevic
threads=1
hash=128MB
position fen rnbqkbnr/ppp2ppp/3p4/8/3pP3/5N2/PPP2PPP/RNBQKB1R w KQkq d3 1 3
go movetime 3000
info depth 1 score cp 154 nodes 41 tbhits 0 time 2 nps 13666 pv d1d4
info depth 2 score cp 861 nodes 95 tbhits 0 time 2 nps 31666 pv d1d4 d6d5
info depth 3 score cp 633 nodes 150 tbhits 0 time 3 nps 37500 pv d1d4 d6d5 e4d5
info depth 4 score cp 633 nodes 200 tbhits 0 time 3 nps 50000 pv d1d4 d6d5 e4d5 d8e7
info depth 5 score cp 74 nodes 647 tbhits 0 time 9 nps 64700 pv c2d3 c7c6 h1g1 c6c5 g1h1
info depth 6 score cp 78 nodes 1032 tbhits 0 time 15 nps 64500 pv c2d3 f8e7 c1f4 c7c6 h1g1 c6c5
info depth 7 score cp 34 nodes 2647 tbhits 0 time 28 nps 91275 pv c2d3 f8e7 b1c3 b8c6 h1g1 e7f6 g1h1
info depth 8 score cp 66 nodes 6593 tbhits 0 time 48 nps 134551 pv c2d3 g8f6 c1d2 c7c5 f1e2 b8c6 b1c3 f8e7
info depth 9 score cp 44 nodes 18547 tbhits 0 time 99 nps 185470 pv c2d3 d6d5 f1e2 d5e4 d3e4 d8d1 e2d1 b8c6 b1c3 g8f6
info depth 10 score cp 44 nodes 23405 tbhits 0 time 118 nps 196680 pv c2d3 d6d5 f1e2 d5e4 d3e4 d8d1 e2d1 b8c6 b1c3 g8f6
info depth 11 score cp 70 nodes 44652 tbhits 0 time 197 nps 225515 pv c2d3 d6d5 c1d2 b8c6 f1e2 d5e4 d3e4 g8f6 b1c3 d8e7 e1g1 f6e4 c3e4
info depth 12 score cp 70 nodes 53475 tbhits 0 time 231 nps 230495 pv c2d3 d6d5 c1d2 b8c6 f1e2 d5e4 d3e4 g8f6 b1c3 d8e7 e1g1 f6e4 c3e4
info depth 13 score cp 74 nodes 80184 tbhits 0 time 332 nps 240792 pv c2d3 d6d5 c1d2 b8c6 e4d5 d8d5 b1c3 d5h5 d3d4 g8f6 f1c4 f8e7 e1g1 e8g8 d2f4 c8g4 d4d5
info depth 14 score cp 76 nodes 157662 tbhits 0 time 628 nps 250655 pv c2d3 d6d5 c1d2 b8c6 e4d5 d8d5 b1c3 d5f5 d3d4 g8f6 f1c4 f8e7 d1e2 f5g4 e1g1 e8g8 d4d5
info depth 15 score cp 62 nodes 467887 tbhits 0 time 1784 nps 262121 pv c2d3 d6d5 c1d2 b8c6 e4d5 d8d5 b1c3 d5f5 d3d4 g8f6 f1b5 c8d7 d1e2 f8e7 e1g1 d7e6 f1e1 e8g8 h2h3 a8d8 b5c6 b7c6
info depth 16 score cp 62 nodes 568485 tbhits 0 time 2149 nps 264411 pv c2d3 d6d5 c1d2 b8c6 e4d5 d8d5 b1c3 d5f5 d3d4 g8f6 f1b5 c8d7 d1e2 f8e7 e1g1 d7e6 f1e1 e8g8 h2h3 a8d8 b5c6 b7c6
info depth 16 score cp 62 nodes 761411 tbhits 0 time 2850 nps 267068 pv c2d3 d6d5 c1d2 b8c6 e4d5 d8d5 b1c3 d5f5 d3d4 g8f6 f1b5 c8d7 d1e2 f8e7 e1g1 d7e6 f1e1 e8g8 h2h3 a8d8 b5c6 b7c6
bestmove c2d3 ponder d6d5
quit
I suspect this is related to the En passant field on the FEN (See the "d3" on the FEN). I understand this is a common bug on many engines according to this article: https://www.chessprogramming.org/En_passant
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.