I have just completed my little side quest, also meant as the first stage of rewriting my engine. Here comes Mini Rodent 1.0 - an engine achieving something like 2700-2730 Elo on CCRL scale in 2400 lines of code (excluding comments and empty lines).
https://github.com/nescitus/Rodent_II/b ... %201.0.zip
(click "RAW" button and download will start)
It is still way below Rodent's best release. Hell, it's even slightly weaker than Rodent 1.4, but code is much clearer and many obvious improvements are still missing.
Mini Rodent is intended as a didactic engine / a springboard for lazy developers. It is released under GPL, so feel free to rename it and improve it, just as it improves over Sungorus 1.4
Mini Rodent 1.0
Moderators: hgm, Rebel, chrisw
-
- Posts: 893
- Joined: Mon Jan 15, 2007 11:23 am
- Location: Warsza
-
- Posts: 589
- Joined: Tue Jun 04, 2013 10:15 pm
Re: Mini Rodent 1.0
Thank you for this little diamond.
I had some trouble to compile it with gcc/g++ on linux, but with clang it works. It is quite strong, no need to be so humble.
I had some trouble to compile it with gcc/g++ on linux, but with clang it works. It is quite strong, no need to be so humble.
[Account deleted]
-
- Posts: 326
- Joined: Mon May 24, 2010 4:32 pm
Re: Mini Rodent 1.0
Thank you Pawel for this "mini" - release
-
- Posts: 4889
- Joined: Thu Mar 09, 2006 6:34 am
- Location: Pen Argyl, Pennsylvania
Re: Mini Rodent 1.0
Pretty impressive!PK wrote: ...something like 2700-2730 Elo on CCRL scale in 2400 lines of code ...
-
- Posts: 4889
- Joined: Thu Mar 09, 2006 6:34 am
- Location: Pen Argyl, Pennsylvania
Re: Mini Rodent 1.0
a fair number of complier warnings:
crashes on Mac Pro
Code: Select all
eval.cpp:26:25: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char *factor_name[] = { "Pst ", "Pawns ", "Passers ", "Attac...
^
eval.cpp:26:39: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char *factor_name[] = { "Pst ", "Pawns ", "Passers ", "Attac...
^
eval.cpp:26:53: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char *factor_name[] = { "Pst ", "Pawns ", "Passers ", "Attac...
^
eval.cpp:26:67: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
...= { "Pst ", "Pawns ", "Passers ", "Attack ", "Mobility "...
^
eval.cpp:26:81: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
...= { "Pst ", "Pawns ", "Passers ", "Attack ", "Mobility "...
^
eval.cpp:26:95: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
...", "Pawns ", "Passers ", "Attack ", "Mobility ", "Outposts "...
^
eval.cpp:26:109: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
..."Passers ", "Attack ", "Mobility ", "Outposts ", "Lines ", "O...
^
eval.cpp:26:123: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
...", "Attack ", "Mobility ", "Outposts ", "Lines ", "Others "};
^
eval.cpp:464:12: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
printf(factor_name[fc]);
^~~~~~~~~~~~~~~
9 warnings generated.
search.cpp:49:42: warning: length modifier 'I64' results in undefined behavior
or no effect with 'd' conversion specifier [-Wformat]
printf("info depth %d time %d nodes %I64d nps %I64d\n", root_depth, ...
~^~~~
search.cpp:49:52: warning: length modifier 'I64' results in undefined behavior
or no effect with 'd' conversion specifier [-Wformat]
printf("info depth %d time %d nodes %I64d nps %I64d\n", root_depth, ...
~^~~~
search.cpp:333:10: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
type = "mate";
^
search.cpp:339:12: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
type = "cp";
^
search.cpp:342:40: warning: length modifier 'I64' results in undefined behavior
or no effect with 'd' conversion specifier [-Wformat]
printf("info depth %d time %d nodes %I64d nps %I64d score %s %d pv %s\n",
~^~~~
search.cpp:342:50: warning: length modifier 'I64' results in undefined behavior
or no effect with 'd' conversion specifier [-Wformat]
printf("info depth %d time %d nodes %I64d nps %I64d score %s %d pv %s\n",
~^~~~
6 warnings generated.
test.cpp:16:16: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
while ( move = NextMove(m, &mv_type) ) {
~~~~~^~~~~~~~~~~~~~~~~~~~~~~
test.cpp:16:16: note: place parentheses around the assignment to silence this
warning
while ( move = NextMove(m, &mv_type) ) {
^
( )
test.cpp:16:16: note: use '==' to turn this assignment into an equality
comparison
while ( move = NextMove(m, &mv_type) ) {
^
==
test.cpp:32:26: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char *piece_name[] = { "P ", "p ", "N ", "n ", "B ", "b ", "R ", "r "...
^
test.cpp:32:32: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char *piece_name[] = { "P ", "p ", "N ", "n ", "B ", "b ", "R ", "r "...
^
test.cpp:32:38: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char *piece_name[] = { "P ", "p ", "N ", "n ", "B ", "b ", "R ", "r "...
^
test.cpp:32:44: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char *piece_name[] = { "P ", "p ", "N ", "n ", "B ", "b ", "R ", "r "...
^
test.cpp:32:50: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char *piece_name[] = { "P ", "p ", "N ", "n ", "B ", "b ", "R ", "r "...
^
test.cpp:32:56: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char *piece_name[] = { "P ", "p ", "N ", "n ", "B ", "b ", "R ", "r ", "Q ", ...
^
test.cpp:32:62: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
...= { "P ", "p ", "N ", "n ", "B ", "b ", "R ", "r ", "Q ", "q ", "K ", "...
^
test.cpp:32:68: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
...= { "P ", "p ", "N ", "n ", "B ", "b ", "R ", "r ", "Q ", "q ", "K ", "...
^
test.cpp:32:74: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
..."P ", "p ", "N ", "n ", "B ", "b ", "R ", "r ", "Q ", "q ", "K ", "k ", ...
^
test.cpp:32:80: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
..."p ", "N ", "n ", "B ", "b ", "R ", "r ", "Q ", "q ", "K ", "k ", ". " };
^
test.cpp:32:86: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
...", "N ", "n ", "B ", "b ", "R ", "r ", "Q ", "q ", "K ", "k ", ". " };
^
test.cpp:32:92: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
...", "N ", "n ", "B ", "b ", "R ", "r ", "Q ", "q ", "K ", "k ", ". " };
^
test.cpp:32:98: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
...", "N ", "n ", "B ", "b ", "R ", "r ", "Q ", "q ", "K ", "k ", ". " };
^
test.cpp:36:12: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
printf(piece_name[p->pc[sq ^ (BC * 56)]]);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.cpp:48:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"r1bqkbnr/pp1ppppp/2n5/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq -",
^
test.cpp:49:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq -",
^
test.cpp:50:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - -",
^
test.cpp:51:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"4rrk1/pp1n3p/3q2pQ/2p1pb2/2PP4/2P3N1/P2B2PP/4RRK1 b - - 7 19",
^
test.cpp:52:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"rq3rk1/ppp2ppp/1bnpb3/3N2B1/3NP3/7P/PPPQ1PP1/2KR3R w - - 7 14",
^
test.cpp:53:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"r1bq1r1k/1pp1n1pp/1p1p4/4p2Q/4Pp2/1BNP4/PPP2PPP/3R1RK1 w - - 2 14",
^
test.cpp:54:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"r3r1k1/2p2ppp/p1p1bn2/8/1q2P3/2NPQN2/PPP3PP/R4RK1 b - - 2 15",
^
test.cpp:55:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"r1bbk1nr/pp3p1p/2n5/1N4p1/2Np1B2/8/PPP2PPP/2KR1B1R w kq - 0 13",
^
test.cpp:56:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"r1bq1rk1/ppp1nppp/4n3/3p3Q/3P4/1BP1B3/PP1N2PP/R4RK1 w - - 1 16",
^
test.cpp:57:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"4r1k1/r1q2ppp/ppp2n2/4P3/5Rb1/1N1BQ3/PPP3PP/R5K1 w - - 1 17",
^
test.cpp:58:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"2rqkb1r/ppp2p2/2npb1p1/1N1Nn2p/2P1PP2/8/PP2B1PP/R1BQK2R b KQ - 0 11",
^
test.cpp:59:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"r1bq1r1k/b1p1npp1/p2p3p/1p6/3PP3/1B2NN2/PP3PPP/R2Q1RK1 w - - 1 16",
^
test.cpp:60:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"3r1rk1/p5pp/bpp1pp2/8/q1PP1P2/b3P3/P2NQRPP/1R2B1K1 b - - 6 22",
^
test.cpp:61:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"r1q2rk1/2p1bppp/2Pp4/p6b/Q1PNp3/4B3/PP1R1PPP/2K4R w - - 2 18",
^
test.cpp:62:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"4k2r/1pb2ppp/1p2p3/1R1p4/3P4/2r1PN2/P4PPP/1R4K1 b - - 3 22",
^
test.cpp:63:5: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
"3q2k1/pb3p1p/4pbp1/2r5/PpN2N2/1P2P2P/5PP1/Q2R2K1 b - - 4 26",
^
test.cpp:78:12: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
printf(test[i]);
^~~~~~~
32 warnings generated.
uci.cpp:33:18: warning: conversion from string literal to 'char *' is deprecated
[-Wc++11-compat-deprecated-writable-strings]
SetPosition(p, START_POS);
^
./rodent.h:78:25: note: expanded from macro 'START_POS'
#define START_POS "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -"
^
uci.cpp:60:63: warning: format specifies type 'int' but the argument has type
'U64' (aka 'unsigned long long') [-Wformat]
...printf (" perft %d : %d nodes in %d miliseconds\n", depth, nodes, Timer....
~~ ^~~~~
%llu
uci.cpp:166:20: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
SetPosition(p, START_POS);
^
./rodent.h:78:25: note: expanded from macro 'START_POS'
#define START_POS "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -"
^
3 warnings generated.
Mac-Pro:src michaelbyrne$
Code: Select all
Mac-Pro:~ michaelbyrne$ /Users/michaelbyrne/Downloads/Mini\ Rodent\ 1.0/src/rodent ; exit;
uci
id name Mini Rodent 1.0
id author Pawel Koziol (based on Sungorus 1.4 by Pablo Vazquez)
option name Hash type spin default 16 min 1 max 4096
option name Clear Hash type button
option name Attack type spin default 100 min 0 max 500
option name Mobility type spin default 100 min 0 max 500
option name PassedPawns type spin default 100 min 0 max 500
option name PawnStructure type spin default 100 min 0 max 500
uciok
go depth 15
info depth 1 time 0 nodes I64d nps I64d
Segmentation fault: 11
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
-
- Posts: 893
- Joined: Mon Jan 15, 2007 11:23 am
- Location: Warsza
Re: Mini Rodent 1.0
Michael, I'll change %d to %luu But what would be correct format of a printable array of strings?
Pawel Koziol
http://www.pkoziol.cal24.pl/rodent/rodent.htm
http://www.pkoziol.cal24.pl/rodent/rodent.htm