fogleman / MisterQueen

A chess engine written in C.
MIT License
151 stars 31 forks source link

Error messages from cmd after compiling? #8

Open rwbc opened 4 years ago

rwbc commented 4 years ago

Hi Michael,

After a successful compiling (with -static and -march=native added) under WIN with just two warnings, a first test from cmd shows nearly two thousands of error lines about invalid attack tables for Bishop and Rook.

After this MisterQueen can still be started with the uci command and reacts to 'go infinite' with b1c3 (no pv, no info though) Haven't tried yet if it might play a game under a GUI despite the error messages in the beginning.

Any idea?

debug info from a logging tool

0.000: - Starting server: MisterQueen.exe
0.031: - Priority class set to normal
0.031: - Thread priority set to normal
0.046: < ERROR: invalid ATTACK_BISHOP table
...
0.280: < ERROR: invalid ATTACK_BISHOP table
0.280: < ERROR: invalid ATTACK_ROOK table
...
0.670: < ERROR: invalid ATTACK_ROOK table
2.449: > uci
2.449: < id name Mister Queen
2.449: < id author Michael Fogleman
2.449: < uciok
5.460: > ucinewgame
7.004: > isready
7.004: < readyok
11.247: > go infinite
12.246: < bestmove b1c3
$ make
Creating directories
Beginning release build
Compiling: src/bb.c -> build/release/bb.o
Compiling: src/bk.c -> build/release/bk.o
Compiling: src/board.c -> build/release/board.o
src/board.c: In function 'board_print':
src/board.c:234:19: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized]
  234 |                 c |= 0x20;
      |                 ~~^~~~~~~
Compiling: src/book.c -> build/release/book.o
Compiling: src/deps/tinycthread/tinycthread.c -> build/release/deps/tinycthread/tinycthread.o
Compiling: src/eval.c -> build/release/eval.o
Compiling: src/gen.c -> build/release/gen.o
Compiling: src/main.c -> build/release/main.o
Compiling: src/move.c -> build/release/move.o
src/move.c: In function 'score_move':
src/move.c:162:9: warning: variable 'piece_material' set but not used [-Wunused-but-set-variable]
  162 |     int piece_material = 0;
      |         ^~~~~~~~~~~~~~
Compiling: src/opening.c -> build/release/opening.o
Compiling: src/perft.c -> build/release/perft.o
Compiling: src/search.c -> build/release/search.o
Compiling: src/table.c -> build/release/table.o
Compiling: src/uci.c -> build/release/uci.o
Compiling: src/util.c -> build/release/util.o
Linking: bin/release/main
Making symlink: main -> bin/release/main

Guenther (maintainer of the RWBC XB/UCI chronology)

fogleman commented 4 years ago

This might be your problem:

https://twitter.com/WEREMSOFT/status/1286317465941823488

Ok, the problem was that wasm has diferent sizes for data types. There was an overflow issue. The solution was to change the following line 4 in bb.h:

define BIT(sq) (1L << (sq))

to

define BIT(sq) (1LL << (sq))

rwbc commented 4 years ago

Hooray! Thanks for the quick hint.

Finally I can add MisterQueen to the XB/UCI chronology, except you won't like to be there? https://rwbc-chess.de/ https://docs.google.com/spreadsheets/d/1GXoy3lGhdKPJbatdw2_2dhWT3TkpthPcNtHs51MQydM BTW it would be nice if a version number would exist. Ofc I can still add the last commit date to the binary.

This is on an old quadcore in case you wonder about the speed:

uci
id name Mister Queen
id author Michael Fogleman
uciok
go infinite
info depth 1 score cp 20 nodes 40 time 0 pv b1c3
info depth 2 score cp 0 nodes 143 time 9 pv b1c3 b8c6
info depth 3 score cp 40 nodes 363 time 18 pv b1c3 b8c6 d2d4
info depth 4 score cp 10 nodes 1980 time 28 pv b1c3 b8c6 g1f3 d7d5
info depth 5 score cp 40 nodes 4472 time 43 pv g1f3 b8c6 b1c3 g8f6 e2e4
info depth 6 score cp 5 nodes 26139 time 73 pv g1f3 g8f6 d2d4 d7d5 b1c3 b8d7
info depth 7 score cp 25 nodes 66299 time 108 pv e2e4 b8c6 g1f3 g8f6 e4e5 f6e4 d2d4
info depth 8 score cp 10 nodes 136186 time 156 pv e2e4 b8c6 g1f3 g8f6 b1c3 d7d5 e4e5 f6g4
info depth 9 score cp 25 nodes 534915 time 361 pv e2e4 e7e5 g1f3 g8f6 d2d4 e5d4 d1d4 b8c6 d4d5
info depth 10 score cp 5 nodes 1772719 time 961 pv e2e4 e7e5 g1f3 g8f6 d2d4 e5d4 d1d4 b8c6 b1c3 c6d4
info depth 11 score cp 20 nodes 5280634 time 2602 pv e2e4 e7e5 b1c3 g8f6 f1b5 c7c6 b5c4 d7d5 e4d5 c6d5 c4b5
info depth 12 score cp 5 nodes 13710917 time 6451 pv e2e4 e7e5 b1c3 g8f6 f2f4 d7d5 e4d5 e5f4 d2d4 f8b4 d1e2

May be you are even willing to add three time repetition detection after all the years? :)

Limitations

Unaware of draw by repetition.
[Event "CuteChess 1.20 dev"]
[Site "RWBC-CAPPUCCINO"]
[Date "2020.10.10"]
[Round "1"]
[White "MisterQueen_2020-04-08"]
[Black "Stash_122-64"]
[Result "1/2-1/2"]
[ECO "B30"]
[GameDuration "00:03:30"]
[GameEndTime "2020-10-10T22:53:38.155 Mitteleuropäische Sommerzeit"]
[GameStartTime "2020-10-10T22:50:08.019 Mitteleuropäische Sommerzeit"]
[Opening "Sicilian defense"]
[PlyCount "64"]
[TimeControl "40/120"]

1. e4 {book} c5 {book}
2. Nf3 {book} Nc6 {book}
3. Be2 {book} g6 {book}
4. Bb5 {+0.75/10 4.01} Nd4 {-0.21/10 3.23}
5. Nxd4 {+0.65/10 4.01} cxd4 {-0.17/10 3.23}
6. O-O {+0.65/10 4.00} a6 {-0.08/10 3.23}
7. Ba4 {+0.75/11 4.01} e5 {-0.01/10 3.24}
8. d3 {+0.65/10 4.00} Nf6 {-0.03/9 3.23}
9. f4 {+0.85/10 4.01} Bd6 {-0.22/11 3.23}
10. Nd2 {+0.90/10 4.00} b5 {-0.40/11 3.23}
11. Bb3 {+0.90/10 4.00} exf4 {-0.35/10 3.23}
12. Nf3 {+0.90/9 4.00} Bc5 {-0.31/9 3.23}
13. Bxf4 {+1.10/9 4.00} d6 {-0.28/8 3.24}
14. Nh4 {+1.60/8 4.00} Bg4 {-0.98/8 3.24}
15. Qc1 {+1.80/9 4.00} Nd7 {-1.76/10 3.24}
16. Bxf7+ {+2.75/10 4.00} Kxf7 {-5.11/12 3.23}
17. Bg5+ {+4.10/11 4.00} Kg7 {-5.73/12 3.23}
18. Bxd8 {+4.05/10 4.01} Rhxd8 {-5.86/11 3.24}
19. Qg5 {+4.00/10 4.00} Ne5 {-6.02/11 3.24}
20. h3 {+4.00/9 4.06} Bd7 {-5.98/11 3.23}
21. Nf3 {+4.00/9 4.00} Nc6 {-5.43/9 3.23}
22. Qd5 {+4.10/9 4.01} h6 {-4.70/8 3.24}
23. Rae1 {+4.15/8 4.00} a5 {-4.71/9 3.25}
24. a3 {+4.15/9 4.03} Rac8 {-4.83/9 3.23}
25. Rd1 {+4.10/9 4.01} Ne7 {-4.80/10 3.24}
26. Qb7 {+4.05/10 4.00} Ra8 {-3.77/10 3.24}
27. Qc7 {+4.10/8 4.01} Nc6 {-2.97/11 3.25}
28. b4 {+2.45/10 4.01} Rac8 {-2.92/12 3.24}
29. Qb7 {+2.90/12 4.00} Rb8 {-2.93/13 3.24}
30. Qc7 {+2.90/12 4.00} Rbc8 {-2.90/12 3.25}
31. Qb7 {+2.90/12 4.00} Rb8 {-2.92/13 3.25}
32. Qc7 {+2.90/12 4.01} Rbc8 {0.00/15 3.24}
{Draw by 3-fold repetition}
1/2-1/2