Zeta_Dva vers 0.1.0

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

smatovic
Posts: 2658
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Zeta_Dva vers 0.1.0

Post by smatovic »

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
Tom Barrister
Posts: 227
Joined: Tue Oct 05, 2010 5:29 pm

Re: Zeta_Dva vers 0.1.0

Post by Tom Barrister »

Will there be a windows version?
This production is being brought to you by Rybka: "The engine made from scratch.™"
UncombedCoconut
Posts: 319
Joined: Fri Dec 18, 2009 11:40 am
Location: Naperville, IL

Re: Zeta_Dva vers 0.1.0

Post by UncombedCoconut »

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.)
smatovic
Posts: 2658
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Zeta_Dva vers 0.1.0

Post by smatovic »

Will there be a windows version?
sorry, no. got currently no windows running.

--
srdja
UncombedCoconut
Posts: 319
Joined: Fri Dec 18, 2009 11:40 am
Location: Naperville, IL

Re: Zeta_Dva vers 0.1.0

Post by UncombedCoconut »

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.
smatovic
Posts: 2658
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Zeta_Dva vers 0.1.0

Post by smatovic »

Thanks for the info Justin,

maybe next week i will try MinGW.

Code: Select all

The compiler points out&#58;
zeta_dva.c&#58;1353&#58; warning&#58; array subscript is above array bounds 
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
UncombedCoconut
Posts: 319
Joined: Fri Dec 18, 2009 11:40 am
Location: Naperville, IL

Re: Zeta_Dva vers 0.1.0

Post by UncombedCoconut »

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. :D (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! :)
smatovic
Posts: 2658
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Zeta_Dva vers 0.1.0

Post by smatovic »

Thanks a lot!
It lost to Stockfish in 30 perfectly legal moves
:-)

--
srdja
UncombedCoconut
Posts: 319
Joined: Fri Dec 18, 2009 11:40 am
Location: Naperville, IL

Re: Zeta_Dva vers 0.1.0

Post by UncombedCoconut »

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.
User avatar
Matthias Gemuh
Posts: 3245
Joined: Thu Mar 09, 2006 9:10 am

Re: Zeta_Dva vers 0.1.0

Post by Matthias Gemuh »

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.
... if (fischer_time_control) crash(); ? :(
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de