Page 2 of 5

Re: OliThink 5.9.5 is very small

Posted: Sun May 23, 2021 11:48 pm
by supersharp77
OliverBr wrote: Sun May 23, 2021 11:25 pm
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.
I think this little exe is popcnt only.....it crashed right away in windows 10 x64 npopcnt.... :) :wink:

Re: OliThink 5.9.5 is very small

Posted: Mon May 24, 2021 12:08 am
by OliverBr
supersharp77 wrote: Sun May 23, 2021 11:48 pm I think this little exe is popcnt only.....it crashed right away in windows 10 x64 npopcnt.... :) :wink:
You are talking about the OliThink Windows executable? Yes, the one on my homepage is popcnt only. I am surprised there are cpus running without popcnt out there...

Re: OliThink 5.9.5 is very small

Posted: Mon May 24, 2021 2:51 am
by supersharp77
OliverBr wrote: Mon May 24, 2021 12:08 am
supersharp77 wrote: Sun May 23, 2021 11:48 pm I think this little exe is popcnt only.....it crashed right away in windows 10 x64 npopcnt.... :) :wink:
You are talking about the OliThink Windows executable? Yes, the one on my homepage is popcnt only. I am surprised there are cpus running without popcnt out there...
Yeah of course because others have been putting out Olithink compiles for years all over the net..Java..exes you name it..
lots of those compiles have bugs it seems..The java compiles just stop working in some GUI's..
some don't work at all... :) :wink:

Re: OliThink 5.9.5 is very small

Posted: Mon May 24, 2021 4:36 am
by Dann Corbit
OliverBr wrote: Sun May 23, 2021 11:15 pm
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"?
I guess HGM can explain. I have no idea.
Especially since 1024 is a power of 2 and 1028 is not.

Re: OliThink 5.9.5 is very small

Posted: Mon May 24, 2021 10:44 am
by Ras
OliverBr wrote: Sun May 23, 2021 11:25 pmThe import of stdlib.h is a little annoying. Another extra line
I'd draw a line where minimalism impacts robustness. For example, I'd also add error handling for calloc() and try half the allocation of the previous attempt if it returns NULL, or exit if even the minimum allocation (e.g. 1 MB) fails.

Re: OliThink 5.9.5 is very small

Posted: Mon May 24, 2021 11:01 am
by OliverBr
Ras wrote: Mon May 24, 2021 10:44 am I'd draw a line where minimalism impacts robustness. For example, I'd also add error handling for calloc() and try half the allocation of the previous attempt if it returns NULL, or exit if even the minimum allocation (e.g. 1 MB) fails.
Of course you have a point about this.

But I have another issue: When the memory is dynamically allocated, the version loses a couple of ELOs. This is a simple performance issue, it's somewhat slower even though it's hardy measurable.

I have this issue, too, when combining "generateNoisy" and "generateQuite" into one method, which is elegant, but loses even more ELO points.

Re: OliThink 5.9.5 is very small

Posted: Mon May 24, 2021 12:27 pm
by mvanthoor
OliverBr wrote: Mon May 24, 2021 12:08 am You are talking about the OliThink Windows executable? Yes, the one on my homepage is popcnt only. I am surprised there are cpus running without popcnt out there...
Indeed. POPCNT was introduced in 2008, so you'd need to be running a Core2Duo or Core2Quad or even older CPU to not have it. (I don't know on top of my head when AMD introduced this instruction.)

I can only think of a few reasons why you'd run a CPU without POPCNT:
- For retro-purposes
- If you _really_ don't have any money to get a second hand computer built after 2008. (I've seen computers built in 2016 been given away for free, or for a token price such as €25.)

I still have an old Core2Duo laptop lying around to see if non-POPCNT compiles actually start. I provide a 32-bit generic compile, but I just test that on my normal computer. If it starts, I'm fine with it. If it's going to give me problems in the future, I'll drop it. It isn't even extensively tested, as it's about half the speed of the 64-bit compile.

Re: OliThink 5.9.5 is very small

Posted: Mon May 24, 2021 10:48 pm
by Dann Corbit
OliverBr wrote: Mon May 24, 2021 11:01 am
Ras wrote: Mon May 24, 2021 10:44 am I'd draw a line where minimalism impacts robustness. For example, I'd also add error handling for calloc() and try half the allocation of the previous attempt if it returns NULL, or exit if even the minimum allocation (e.g. 1 MB) fails.
Of course you have a point about this.

But I have another issue: When the memory is dynamically allocated, the version loses a couple of ELOs. This is a simple performance issue, it's somewhat slower even though it's hardy measurable.

I have this issue, too, when combining "generateNoisy" and "generateQuite" into one method, which is elegant, but loses even more ELO points.
I think the bigger hash is important because SMP is just around the corner. And when Olithink has SMP, a small hash table will fill up in a heartbeat on big hardware.

Re: OliThink 5.9.5 is very small

Posted: Tue May 25, 2021 1:37 am
by supersharp77
mvanthoor wrote: Mon May 24, 2021 12:27 pm
OliverBr wrote: Mon May 24, 2021 12:08 am
I can only think of a few reasons why you'd run a CPU without POPCNT:
- For retro-purposes
- If you _really_ don't have any money to get a second hand computer built after 2008. (I've seen computers built in 2016 been given away for free, or for a token price such as €25.)

Oh..really Free Computers Given Awaqy in Amsterdam? Wheres That at for these circa 2016 Laptops for sale or given away for 25 Euros? Your got any links for these "sales"? You can't blow Smoke for Free in USA Hash Houses..Sorry Mate... :) :wink:

Re: OliThink 5.9.5 is very small

Posted: Tue May 25, 2021 10:13 am
by mvanthoor
supersharp77 wrote: Tue May 25, 2021 1:37 am Oh..really Free Computers Given Awaqy in Amsterdam? Wheres That at for these circa 2016 Laptops for sale or given away for 25 Euros? Your got any links for these "sales"? You can't blow Smoke for Free in USA Hash Houses..Sorry Mate... :) :wink:
Here you go for desktops

And laptops

Lots of stuff for free, somewhere in the range of €25-100, or price negotiable. Some hardware is really old, but some of the hardware is newer, low-end stuff that does have the necessary functionality. You still won't get a monster computer, but it'll at least be 5-7 years newer than a Core2Duo-era machine. There are more sites beside this one.