Heyho
here my simple chess programm:
linux64 source:
https://github.com/smatovic/zeta_dva/tree/zeta_dva_010
It plays slower but a bit stronger than MSCP, ~ 200knps
whats inside:
- single core
- bitboards (with hashtables from stockfish)
- iterative deepeing
- PV-Search
- SEE
- Tablebased Eval function
- Transposition Tables
TODOs:
- limit branch factor
- speedup code
- time control
- SMP
--
srdja
Zeta_Dva vers 0.1.0
Moderators: hgm, Rebel, chrisw
-
- Posts: 2658
- Joined: Wed Mar 10, 2010 10:18 pm
- Location: Hamburg, Germany
- Full name: Srdja Matovic
-
- Posts: 227
- Joined: Tue Oct 05, 2010 5:29 pm
Re: Zeta_Dva vers 0.1.0
Will there be a windows version?
This production is being brought to you by Rybka: "The engine made from scratch.™"
-
- Posts: 319
- Joined: Fri Dec 18, 2009 11:40 am
- Location: Naperville, IL
Re: Zeta_Dva vers 0.1.0
If I have time I can build a Windows version. The code looks like it's mostly portable, but it needs to be more cautious about the integer types it uses. (Meaning: I got it to build for Windows, but I *really* doubt it will work.)
-
- Posts: 2658
- Joined: Wed Mar 10, 2010 10:18 pm
- Location: Hamburg, Germany
- Full name: Srdja Matovic
Re: Zeta_Dva vers 0.1.0
sorry, no. got currently no windows running.Will there be a windows version?
--
srdja
-
- Posts: 319
- Joined: Fri Dec 18, 2009 11:40 am
- Location: Naperville, IL
Re: Zeta_Dva vers 0.1.0
Srdja, I don't have Windows either, but the MinGW cross-compiler works very well for simple programs like chess engines. The best way to get it working depends on your Linux distribution.
The int-types issue is easily fixed: have types.h include <stdint.h> (available on C99-compliant compilers; I think that Microsoft has finally shipped that header file in MSVC as well!) and typedef U64 as a uint64_t rather than an unsigned long.
The compiler points out:
zeta_dva.c:1353: warning: array subscript is above array bounds
In theory fixing these should be enough, but after a "new" and "go" my Windows and Linux compiles crash instantly. I'm not yet sure why.
The int-types issue is easily fixed: have types.h include <stdint.h> (available on C99-compliant compilers; I think that Microsoft has finally shipped that header file in MSVC as well!) and typedef U64 as a uint64_t rather than an unsigned long.
The compiler points out:
zeta_dva.c:1353: warning: array subscript is above array bounds
In theory fixing these should be enough, but after a "new" and "go" my Windows and Linux compiles crash instantly. I'm not yet sure why.
-
- Posts: 2658
- Joined: Wed Mar 10, 2010 10:18 pm
- Location: Hamburg, Germany
- Full name: Srdja Matovic
Re: Zeta_Dva vers 0.1.0
Thanks for the info Justin,
maybe next week i will try MinGW.
I fixed this in the repository,
in line 1352 just replace this
for(i=0;i<12;i++) {
by this
for(i=0;i<11;i++) {
and i removed some debug printing:
--- a/zeta_dva.c
+++ b/zeta_dva.c
@@ -1151,7 +1151,7 @@ Move rootsearch(Bitboard *board, Boardindex *bindex, int som, int depth, Move la
end = clock();
elapsed = ((double) (end - start)) / CLOCKS_PER_SEC;
- print_stats();
+// print_stats();
fflush(stdout);
--
Srdja
maybe next week i will try MinGW.
Code: Select all
The compiler points out:
zeta_dva.c:1353: warning: array subscript is above array bounds
in line 1352 just replace this
for(i=0;i<12;i++) {
by this
for(i=0;i<11;i++) {
and i removed some debug printing:
--- a/zeta_dva.c
+++ b/zeta_dva.c
@@ -1151,7 +1151,7 @@ Move rootsearch(Bitboard *board, Boardindex *bindex, int som, int depth, Move la
end = clock();
elapsed = ((double) (end - start)) / CLOCKS_PER_SEC;
- print_stats();
+// print_stats();
fflush(stdout);
--
Srdja
-
- Posts: 319
- Joined: Fri Dec 18, 2009 11:40 am
- Location: Naperville, IL
Re: Zeta_Dva vers 0.1.0
The crasher seems to be that you only call init_tt() in response to a "memory" command. cutechess-cli never sends one. I just added that call to main() after init_tables() and the engine seems to work. It lost to Stockfish in 30 perfectly legal moves. (No offense intended -- I usually don't last any longer!)
I have also commented the print_stats() call. The result + win32 & win64 binaries are here. I have tested the win32 binary.
Just to clarify: I ran the normal build command, but with "gcc" replaced by ARCH-mingw32msvc-gcc (where ARCH is i586 or amd64; with these I respectively used -march=i686 and no -march) and removed the "-lm". The exact command will vary across distributions. Good luck with your engine!
I have also commented the print_stats() call. The result + win32 & win64 binaries are here. I have tested the win32 binary.
Just to clarify: I ran the normal build command, but with "gcc" replaced by ARCH-mingw32msvc-gcc (where ARCH is i586 or amd64; with these I respectively used -march=i686 and no -march) and removed the "-lm". The exact command will vary across distributions. Good luck with your engine!
-
- Posts: 2658
- Joined: Wed Mar 10, 2010 10:18 pm
- Location: Hamburg, Germany
- Full name: Srdja Matovic
Re: Zeta_Dva vers 0.1.0
Thanks a lot!
--
srdja
It lost to Stockfish in 30 perfectly legal moves
--
srdja
-
- Posts: 319
- Joined: Fri Dec 18, 2009 11:40 am
- Location: Naperville, IL
Re: Zeta_Dva vers 0.1.0
I clearly didn't test the engine enough. If the GUI doesn't send a "black" command, it can only play as black. Instead of maintaining "my_side" the way you do, I suggest that you maintain a side_to_move variable in zeta_dva.c. After all, it is simple to update and the appropriate response to "go" depends only on who goes next.
-
- Posts: 3245
- Joined: Thu Mar 09, 2006 9:10 am
Re: Zeta_Dva vers 0.1.0
... if (fischer_time_control) crash(); ?UncombedCoconut wrote:I clearly didn't test the engine enough. If the GUI doesn't send a "black" command, it can only play as black. Instead of maintaining "my_side" the way you do, I suggest that you maintain a side_to_move variable in zeta_dva.c. After all, it is simple to update and the appropriate response to "go" depends only on who goes next.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de
http://www.chess.hylogic.de