OliThink 5.9.5 is very small

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

Moderators: hgm, Rebel, chrisw

OliverBr
Posts: 725
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

OliThink 5.9.5 is very small

Post by OliverBr »

OliThink 5.9.5 has only 44 kByte or 1500 lines of code.

It's even smaller than its predecessor OliThink4, which is very compact.
The mobility evaluation is very small. There are no pre-computed or texelian numbers.
Still there are quite a couple of bugs in search and pruning.

OliThink supports MacOSX, Linux and Windows and there is a 1:1 translation into Java.
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: OliThink 5.9.5 is very small

Post by Dann Corbit »

I made a version with variable sized hash tables:


I kept the power of 2 thing, but allowed whatever fits within the request:
memory N
where N is megabytes.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
OliverBr
Posts: 725
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: OliThink 5.9.5 is very small

Post by OliverBr »

Thank you very much, Dann!

May I use your code within the next version of OliThink, with some changes?
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: OliThink 5.9.5 is very small

Post by Dann Corbit »

OliverBr wrote: Thu May 20, 2021 10:23 pm Thank you very much, Dann!

May I use your code within the next version of OliThink, with some changes?
Of course, any changes I make you can use without asking permission. IOW, you have my implicit permission to use any tweaks I ever make to Olithink.
I looked at the code, and I think I left out initialization of the last hash element. So that's a bug.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
User avatar
Werner
Posts: 2871
Joined: Wed Mar 08, 2006 10:09 pm
Location: Germany
Full name: Werner Schüle

Re: OliThink 5.9.5 is very small

Post by Werner »

Dann Corbit wrote: Wed May 19, 2021 3:01 am I made a version with variable sized hash tables:


I kept the power of 2 thing, but allowed whatever fits within the request:
memory N
where N is megabytes.
Hi Dann,
how to use inside Arena=
commandline parameter Memory 256 does not work here ?
or
startcommand Memory 256 does not work here ?
thanks
Werner
Archimedes
Posts: 135
Joined: Tue Mar 05, 2019 3:43 pm
Full name: Archimedes

Re: OliThink 5.9.5 is very small

Post by Archimedes »

OliverBr wrote: Tue May 18, 2021 11:54 pm OliThink supports MacOSX, Linux and Windows and there is a 1:1 translation into Java.
It also works on Android (tested with Chess for Android).

OliThink 5.9.5 for Android:
https://app.box.com/s/ga6nnh7fxw01mg7hxuqe3ixv9ivgy0zs
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: OliThink 5.9.5 is very small

Post by Ras »

Dann Corbit wrote: Wed May 19, 2021 3:01 amI made a version with variable sized hash tables:
But memory=1 is missing in the feature announcent in line 1529 so that this will not be used. From http://hgm.nubati.net/CECP.html:
memory N
Specifies the engine can use at most N megabytes of memory. Only sent when the engine requested it through feature memory=1, and never during a game.

Also, stdlib.h should be included to use calloc() (in which case the integer variable random needs to be renamed), and the scanf() in line 1552 is using the wrong format string for the type size_t of the variable wanted.
Rasmus Althoff
https://www.ct800.net
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: OliThink 5.9.5 is very small

Post by Dann Corbit »

Amazing that I can generate so many bugs with about ten new lines of code.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
OliverBr
Posts: 725
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: OliThink 5.9.5 is very small

Post by OliverBr »

Dann Corbit wrote: Sat May 22, 2021 10:35 am Of course, any changes I make you can use without asking permission. IOW, you have my implicit permission to use any tweaks I ever make to Olithink.
I am implementing now your code and there is something I don't understand:
Using xboard I configured 1024 MB Hashsize, but xboard sends the following string to the engine:

Code: Select all

memory 1028
What exactly is the purpose of those "4 Mbyte extra"?
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
OliverBr
Posts: 725
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: OliThink 5.9.5 is very small

Post by OliverBr »

Ras wrote: Sat May 22, 2021 3:41 pm But memory=1 is missing in the feature announcent in line 1529 so that this will not be used. From http://hgm.nubati.net/CECP.html:
memory N
Specifies the engine can use at most N megabytes of memory. Only sent when the engine requested it through feature memory=1, and never during a game.

Also, stdlib.h should be included to use calloc() (in which case the integer variable random needs to be renamed), and the scanf() in line 1552 is using the wrong format string for the type size_t of the variable wanted.
That's right.
The import of stdlib.h is a little annoying. Another extra line and I can't use "random" anymore, of course. I had to rename it.
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink