A complete 2000 lines of code engine

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

Moderators: hgm, Rebel, chrisw

User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: A complete 2000 lines of code engine

Post by Guenther »

tpoppins wrote: Mon Oct 29, 2018 4:14 pm I should have remembered. Graham also has a non-POPCNT box, although he's unlikely to run anything under 2000 Elo, which has lately been my domain.

minic-06-64-old-tp.zip

I expect that your h/w supports SSE2 at least, let me know if this won't run.
My cpu supports up to SSE 4.1 but no popcount, yet this binary crashes here.
(of course I used the cmd '-xboard')

Code: Select all

Fehlermodulname:	StackHash_1dc2
Edit:
No big problem though, Viviens' new 0.8 version runs here out of the box.
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: A complete 2000 lines of code engine

Post by xr_a_y »

Mmm, you may try windows compatibility mode. Looks like a BEX64 issue.
tpoppins
Posts: 919
Joined: Tue Nov 24, 2015 9:11 pm
Location: upstate

Re: A complete 2000 lines of code engine

Post by tpoppins »

Günther's right, it crashes here too. Ditto for v0.6 64-bit I posted on 26th. I'd swear they worked just yesterday. ;)
After a little experimenting it seems that the "-flto" CFLAG is the culprit. No crashes when compiling without it. Funny thing is, the 64-bit execs for v0.1 and v0.4 I posted earlier run fine, and they were compiled with "-flto" ...

For historical purposes here's a replacement for the v0.6:
minic-06-tp-f.zip
Tirsa Poppins
CCRL
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: A complete 2000 lines of code engine

Post by xr_a_y »

Probably some optim involving special instruction that depends on the whole program layout ...
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: A complete 2000 lines of code engine

Post by Sven »

I recently added -flto and -msse4.2 compile flags to my engine Jumbo, hoping to produce an executable that still runs on many different machines. The improvement was about 35 Elo points in ultra-fast selfplay so I would really like to keep that change ... Does it crash anywhere?

http://www.schuelebln.de/chess/jumbo/ju ... 62-x64.zip

(jumbo64-0.6.62-bb.exe, don't forget to also copy the cygwin DLLs included in the zip)
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)
User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: A complete 2000 lines of code engine

Post by Guenther »

Sven wrote: Mon Oct 29, 2018 9:12 pm I recently added -flto and -msse4.2 compile flags to my engine Jumbo, hoping to produce an executable that still runs on many different machines. The improvement was about 35 Elo points in ultra-fast selfplay so I would really like to keep that change ... Does it crash anywhere?

http://www.schuelebln.de/chess/jumbo/ju ... 62-x64.zip

(jumbo64-0.6.62-bb.exe, don't forget to also copy the cygwin DLLs included in the zip)
Well, my machine e.g. only allows up to SSE 4.1 instructions so I doubt it will run here.

as expected: (for both versions, bb and non-bb - 0.6.35 still runs here)

Code: Select all

Exception: STATUS_ILLEGAL_INSTRUCTION at rip=00100402076
rax=E0A0E00000000000 rbx=003F7F6000000000 rcx=0000000000000036
rdx=003F7F7F7F7F7F7F rsi=0000000000000036 rdi=0000200000000000
r8 =0000000000000004 r9 =000000010065AD60 r10=000000010047CF80
r11=0000000000000066 r12=0000000000000048 r13=0000200000000000
r14=000000010057EF60 r15=000000010057F360
rbp=00000001004781A0 rsp=00000000FFFF99B8
program=C:\Engines\jumbo-0.6.62-x64\jumbo64-0.6.62-bb.exe, pid 1844, thread main
cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame        Function    Args
001004781A0  00100402076 (00600089BC0, 00000000000, 000801414FF, 00000000000)
00000000010  0010040C8AF (001800C9B9E, 00180020010, 00000000000, 00000000000)
000FFFF9C5F  0010044366F (00000000020, FF0700010302FF00, 00180047B51, 00000000000)
000FFFFCCB0  00180047BC2 (00000000000, 00000000000, 00000000000, 00000000000)
00000000000  00180045863 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0  00180045914 (00000000000, 00000000000, 00000000000, 00000000000)
End of stack trace
I suggest to add another compile for 'old' 64-bit cpus, thus you don't lose the speedup for all newer platforms, if you like.
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: A complete 2000 lines of code engine

Post by Sven »

Guenther wrote: Mon Oct 29, 2018 9:20 pm I suggest to add another compile for 'old' 64-bit cpus, thus you don't lose the speedup for all newer platforms, if you like.
Try again, please! (Same link with additional binaries compiled without -msse4.2 but still with -flto)
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)
tpoppins
Posts: 919
Joined: Tue Nov 24, 2015 9:11 pm
Location: upstate

Re: A complete 2000 lines of code engine

Post by tpoppins »

Sven wrote: Mon Oct 29, 2018 9:12 pm I recently added -flto and -msse4.2 compile flags to my engine Jumbo, hoping to produce an executable that still runs on many different machines. The improvement was about 35 Elo points in ultra-fast selfplay so I would really like to keep that change ... Does it crash anywhere?

http://www.schuelebln.de/chess/jumbo/ju ... 62-x64.zip
Runs fine on this Westmere-EP Xeon.
I think LTO is fine, the first two 64-bit Minic versions I posted were compiled with it and run without any issues. The problem must have originated somewhere between v0.4 and v0.6.
Last edited by tpoppins on Mon Oct 29, 2018 10:26 pm, edited 1 time in total.
Tirsa Poppins
CCRL
User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: A complete 2000 lines of code engine

Post by Guenther »

Sven wrote: Mon Oct 29, 2018 10:07 pm
Guenther wrote: Mon Oct 29, 2018 9:20 pm I suggest to add another compile for 'old' 64-bit cpus, thus you don't lose the speedup for all newer platforms, if you like.
Try again, please! (Same link with additional binaries compiled without -msse4.2 but still with -flto)
Thanks! The SSE 4.1 versions work here.
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A complete 2000 lines of code engine

Post by MikeB »

xr_a_y wrote: Sat Oct 20, 2018 11:30 am Being a little tired of finding bugs in Weini, I started a week-end project last sunday. The idea was the following : "starting from a blank page, how far can I go in 2 days now I know a little more on chess programming".

An expected side effect was to get a simple engine to experiment with and maybe find some Weini's bug in it.

It is a mailbox negamax (pvs) engine, with classic pruning trick, a double bucket TT and only PST eval.

After 2 days the engine was working in xboard, validated in perft, finds mate in 8 from a collection I often use and was able to always win against me at fast TC (but loses against fairy-max).

Since then I corrected some stuff but the engine is still quite bad, but working :D

Here's the source code : https://github.com/tryingsomestuff/Mini ... r/minic.cc

Some of you probably can easily spot very bad things that makes it so weak.

Maybe, as a 2000 lines c++ code, it may also become an entry point for beginners. I can open the repository for write if some of you want to contribute.
Very nice- here's a macOS version based on the latest source
https://www.dropbox.com/s/envzgbn1uo2be ... S.zip?dl=1

under xboard - edit the xboard config file to something like this:
"/Users/xxxx/cluster.mfb/minic -xboard" -fd "/Users/xxxx/cluster.mfb"
Image