Mussaurus 0.1-prealpha - a poor man's Vice

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

Moderators: hgm, Rebel, chrisw

shinkarom
Posts: 92
Joined: Tue Nov 19, 2019 1:26 pm
Full name: Roman Shynkarenko

Mussaurus 0.1-prealpha - a poor man's Vice

Post by shinkarom »

So I decided to write my own chess engine. (Because if it ever appears on CCRL it means I left at least some trail in the world).
After watching Bluefever's Vice series I started rewriting it in D.
The first changes were changing board representation to 0x88. Now I also added tapering of Vice's king PST based on chessprogramming.org code.
Although even with all the things that Vice had at the time, it still doesn't dominate Nero 6.1.
The old bugs resurface, and due to my approach to defensive programming (no point in doing too many asserts till somebody pays attention to the engine), it is very easy to get discouraged.
It means that if I don't show my creation to somebody soon, I will simply delete the project.
The engine is named Mussaurus, the smallest dinosaur. I saw this name in Michael Chrichton's "The Lost World", and since the previous book was only about large dinosaurs, mussaurus is something new.
Full disclosure: After playing a whole hour of Lichess hourly arena, I got burnt out and stayed away from chess for two weeks. Now I lose to Chessmaster's Cassie.
Here's the link, if you want to laugh: https://github.com/shinkarom/mussaurus.
shinkarom
Posts: 92
Joined: Tue Nov 19, 2019 1:26 pm
Full name: Roman Shynkarenko

Re: Mussaurus 0.1-prealpha - a poor man's Vice

Post by shinkarom »

Nobody has anything to say to me at all?
User avatar
Graham Banks
Posts: 41423
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: Mussaurus 0.1-prealpha - a poor man's Vice

Post by Graham Banks »

shinkarom wrote: Thu Nov 21, 2019 9:00 am Nobody has anything to say to me at all?
Well gone on writing a chess engine.
I hope that you keep developing it. :)
gbanksnz at gmail.com
User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: Mussaurus 0.1-prealpha - a poor man's Vice

Post by Ovyron »

Yes, something like this is not for pointing and laughing, the effort is appreciated and new programmers are always welcome.
User avatar
pocopito
Posts: 238
Joined: Tue Jul 12, 2011 1:31 pm

Re: Mussaurus 0.1-prealpha - a poor man's Vice

Post by pocopito »

What about a README file in your github, with some instructions to compile Mussaurus?
Two first meanings of the dutch word "leren":
1. leren [vc] (learn, larn, acquire) acquire or gain knowledge or skills.
2. leren [v] (teach, learn, instruct) impart skills or knowledge to.
shinkarom
Posts: 92
Joined: Tue Nov 19, 2019 1:26 pm
Full name: Roman Shynkarenko

Re: Mussaurus 0.1-prealpha - a poor man's Vice

Post by shinkarom »

@Graham Banks Nobody needs another also ran. The perpetually buggy sorta clone would be quickly forgotten if there are more noteworthy engines around.
@Ovyron Well, didn't you smile when you saw the poor and sloppy shape my code is in? Then after you ran it and the engine crashed at seemingly random point, what did it make you think about the programmer?
@pocopito I haven't decided on the license yet. The README would also be the repository's readme, which means it should be copied from the root to bin folder after every change, and that also need to be figured out. The building instructions are simple: "dub build".
Gabor Szots
Posts: 1362
Joined: Sat Jul 21, 2018 7:43 am
Location: Szentendre, Hungary
Full name: Gabor Szots

Re: Mussaurus 0.1-prealpha - a poor man's Vice

Post by Gabor Szots »

Unfortunately, it always hangs under Banksia. Here is a sample log:
19:16:38 Numpty Recharged 64-bit> move e1g1
19:16:38 Mussaurus 0.1< position startpos moves e2e4 c7c5 g1f3 d7d6 d2d4 c5d4 f3d4 g8f6 b1c3 a7a6 c1e3 e7e5 d4b3 c8e6 f2f3 f8e7 f1d3 e6b3 a2b3 e8d7 e1g1
go wtime 103208 btime 112582 winc 0 binc 0 movestogo 30
19:16:38 Mussaurus 0.1> r n . q . . . r
19:16:38 Mussaurus 0.1> . p . k b p p p
19:16:38 Mussaurus 0.1> p . . p . n . .
19:16:38 Mussaurus 0.1> . . . . p . . .
19:16:38 Mussaurus 0.1> . . . . P . . .
19:16:38 Mussaurus 0.1> . P N B B P . .
19:16:38 Mussaurus 0.1> . P P . . . P P
19:16:38 Mussaurus 0.1> R . . Q . R K .
19:16:38 Mussaurus 0.1> Side: b
19:16:38 Mussaurus 0.1> En passant: -
19:16:38 Mussaurus 0.1> Castling: ----
19:16:38 Mussaurus 0.1> Key: ba6eaa996e9f3f91
19:16:38 Mussaurus 0.1> Pieces:
19:16:38 Mussaurus 0.1> wP: [F3 B2 C2 E4 H2 G2 B3 ] wN: [C3 ] wB: [E3 D3 ] wR: [A1 F1 ] wQ: [D1 ] wK: [G1 ] bP: [G7 B7 H7 D6 A6 F7 E5 ] bN: [B8 F6 ] bB: [E7 ] bR: [A8 H8 ] bQ: [D8 ] bK: [D7 ]
19:16:38 Mussaurus 0.1> Score: -59
19:16:38 Mussaurus 0.1> info score cp -33 depth 1 nodes 175 time 0 pv d7c8
19:16:38 Mussaurus 0.1> Ordering: 77%
19:16:38 Mussaurus 0.1> info score cp -43 depth 2 nodes 1954 time 8 pv d7c8 f3f4
19:16:38 Mussaurus 0.1> Ordering: 78%
19:16:38 Mussaurus 0.1> info score cp -24 depth 3 nodes 9517 time 36 pv b8c6 c3d5 f6d5
19:16:38 Mussaurus 0.1> Ordering: 75%
19:16:38 Mussaurus 0.1> info score cp -32 depth 4 nodes 56586 time 224 pv b8c6 d3c4 d7e8 f3f4
19:16:38 Mussaurus 0.1> Ordering: 76%
19:16:39 Mussaurus 0.1> info score cp 0 depth 5 nodes 171276 time 662 pv b8c6 g1f2 h8e8 d3c4 e8f8
19:16:39 Mussaurus 0.1> Ordering: 78%
19:16:41 Mussaurus 0.1> info score cp 84 depth 6 nodes 729319 time 2768 pv h8f8 g1f2 d7e6 f2g3 b8c6 f3f4
19:16:41 Mussaurus 0.1> Ordering: 80%
19:16:42 Mussaurus 0.1> bestmove h8f8
19:16:42 Numpty Recharged 64-bit< force
19:16:42 Numpty Recharged 64-bit< h8f8
19:16:42 Numpty Recharged 64-bit< time 10320
otim 10886
19:16:42 Numpty Recharged 64-bit< go
19:16:42 Numpty Recharged 64-bit> 4 50 1 20067 f3f4
19:16:42 Numpty Recharged 64-bit> 5 80 8 268986 f3f4
19:16:42 Numpty Recharged 64-bit> 5 107 12 385044 c3d5
19:16:43 Numpty Recharged 64-bit> 6 60 149 4653640 c3d5
19:16:47 Numpty Recharged 64-bit> move c3d5
19:16:47 Mussaurus 0.1< position startpos moves e2e4 c7c5 g1f3 d7d6 d2d4 c5d4 f3d4 g8f6 b1c3 a7a6 c1e3 e7e5 d4b3 c8e6 f2f3 f8e7 f1d3 e6b3 a2b3 e8d7 e1g1 h8f8 c3d5
go wtime 97578 btime 108868 winc 0 binc 0 movestogo 29
19:16:47 Mussaurus 0.1> r n . q . r . .
19:16:47 Mussaurus 0.1> . p . k b p p p
19:16:47 Mussaurus 0.1> p . . p . n . .
19:16:47 Mussaurus 0.1> . . . N p . . .
19:16:47 Mussaurus 0.1> . . . . P . . .
19:16:47 Mussaurus 0.1> . P . B B P . .
19:16:47 Mussaurus 0.1> . P P . . . P P
19:16:47 Mussaurus 0.1> R . . Q . R K .
19:16:47 Mussaurus 0.1> Side: b
19:16:47 Mussaurus 0.1> En passant: -
19:16:47 Mussaurus 0.1> Castling: ----
19:16:47 Mussaurus 0.1> Key: 96be8b3656532ab5
19:16:47 Mussaurus 0.1> Pieces:
19:16:47 Mussaurus 0.1> wP: [F3 B2 C2 E4 H2 G2 B3 ] wN: [D5 ] wB: [E3 D3 ] wR: [A1 F1 ] wQ: [D1 ] wK: [G1 ] bP: [G7 B7 H7 D6 A6 F7 E5 ] bN: [B8 F6 ] bB: [E7 ] bR: [A8 F8 ] bQ: [D8 ] bK: [D7 ]
19:16:47 Mussaurus 0.1> Score: -64
19:16:47 Mussaurus 0.1> info score cp -39 depth 1 nodes 32 time 0 pv f6d5
19:16:47 Mussaurus 0.1> Ordering: 100%
19:16:47 Mussaurus 0.1> info score cp -43 depth 2 nodes 674 time 2 pv d7c8 d3c4
19:16:47 Mussaurus 0.1> Ordering: 81%
19:16:47 Mussaurus 0.1> info score cp -41 depth 3 nodes 1873 time 7 pv f6d5 e4d5 f7f5
19:16:47 Mussaurus 0.1> Ordering: 82%
19:16:47 Mussaurus 0.1> info score cp -59 depth 4 nodes 13722 time 55 pv f6d5 e4d5 f7f5 c2c4
19:16:47 Mussaurus 0.1> Ordering: 82%
19:16:48 Mussaurus 0.1> info score cp -194 depth 5 nodes 52101 time 200 pv f6d5 e4d5 d7c8 g1h1 f7f5
19:16:48 Mussaurus 0.1> Ordering: 85%
19:16:49 Mussaurus 0.1> info score cp -2824 depth 6 nodes 387843 time 1554 pv f6d5 e4d5 d7c8 g1h1 f7f5 c2c4
19:16:49 Mussaurus 0.1>


19:16:49 Mussaurus 0.1> Ordering: 74%
19:16:49 Mussaurus 0.1> core.exception.AssertError@source\search.d(230): Assertion failure

----------------
19:16:49 Mussaurus 0.1>

0x004275E7 in _d_assertp

0x0042381D in int search.AlphaBeta(int, int, int, ref defs.Board, ref defs.SearchInfo, bool) at D:\MyDocuments\mussaurus\source\search.d(179)

0x0042381D in int search.AlphaBeta(int, int, int, ref defs.Board, ref defs.SearchInfo, bool) at D:\MyDocuments\mussaurus\source\search.d(179)

0x0042381D in int search.AlphaBeta(int, int, int, ref defs.Board, ref defs.SearchInfo, bool) at D:\MyDocuments\mussaurus\source\search.d(179)

0x0042381D in int search.AlphaBeta(int, int, int, ref defs.Board, ref defs.SearchInfo, bool) at D:\MyDocuments\mussaurus\source\search.d(179)

0x0042381D in int search.AlphaBeta(int, int, int, ref defs.Board, ref defs.SearchInfo, bool) at D:\MyDocuments\mussaurus\source\search.d(179)

0x0042381D in int search.AlphaBeta(int, int, int, ref defs.Board, ref defs.SearchInfo, bool) at D:\MyDocuments\mussaurus\source\search.d(179)

0x00423BC2 in void search.SearchPosition(ref defs.Board, ref defs.SearchInfo) at D:\MyDocuments\mussaurus\source\search.d(244)

0x004240D8 in void uci.ParseGo(immutable(char)[][], ref defs.Board, ref defs.SearchInfo) at D:\MyDocuments\mussaurus\source\uci.d(67)

0x0042440A in void uci.UCI_Loop(defs.Board, defs.SearchInfo) at D:\MyDocuments\mussaurus\source\uci.d(139)

0x00402406 in _Dmain at D:\MyDocuments\mussaurus\source\app.d(29)

0x0042486B in void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll().__lambda1()

0x004247E5 in void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()

0x00424680 in _d_run_main

0x0041C05C in main at D:\MyDocuments\mussaurus\source\defs.d(7)

0x0044D345 in mainCRTStartup

0x77366359 in BaseThreadInitThunk

0x77717B74 in RtlGetAppContainerNamedObjectPath

0x77717B44 in RtlGetAppContainerNamedObjectPath

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

Re: Mussaurus 0.1-prealpha - a poor man's Vice

Post by Guenther »

Gabor Szots wrote: Thu Nov 21, 2019 7:27 pm Unfortunately, it always hangs under Banksia. Here is a sample log:
19:16:38 Numpty Recharged 64-bit> move e1g1
19:16:38 Mussaurus 0.1< position startpos moves e2e4 c7c5 g1f3 d7d6 d2d4 c5d4 f3d4 g8f6 b1c3 a7a6 c1e3 e7e5 d4b3 c8e6 f2f3 f8e7 f1d3 e6b3 a2b3 e8d7 e1g1
What happens if you try w/o a given start position?
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
Gabor Szots
Posts: 1362
Joined: Sat Jul 21, 2018 7:43 am
Location: Szentendre, Hungary
Full name: Gabor Szots

Re: Mussaurus 0.1-prealpha - a poor man's Vice

Post by Gabor Szots »

Guenther wrote: Thu Nov 21, 2019 8:15 pm
Gabor Szots wrote: Thu Nov 21, 2019 7:27 pm Unfortunately, it always hangs under Banksia. Here is a sample log:
19:16:38 Numpty Recharged 64-bit> move e1g1
19:16:38 Mussaurus 0.1< position startpos moves e2e4 c7c5 g1f3 d7d6 d2d4 c5d4 f3d4 g8f6 b1c3 a7a6 c1e3 e7e5 d4b3 c8e6 f2f3 f8e7 f1d3 e6b3 a2b3 e8d7 e1g1
What happens if you try w/o a given start position?
The same.
Gabor Szots
CCRL testing group
shinkarom
Posts: 92
Joined: Tue Nov 19, 2019 1:26 pm
Full name: Roman Shynkarenko

Re: Mussaurus 0.1-prealpha - a poor man's Vice

Post by shinkarom »

https://github.com/shinkarom/mussaurus/ ... -prealpha2
I've reuploaded the fixed version. The problem is when it puts a move into TT after alpha cutoff when all moves in a list were cut off. In that case it didn't select a move and produced empty pv. After disabling TTing of alpha cutoffs the problem disappeared at the cost of some speedups.