Improving speed

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Improving speed

Post by Ras »

Henk wrote:No Skipper has not the right data structures.
You could just put that stuff into static eval.
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: Improving speed

Post by Henk »

After changing at least 500 lines of code looks like my engine is 5-10 percent faster. So my original data structure wasn't that bad after all.

Been busy all day doing all kinds of stupid edits. Not much fun.
Daniel Anulliero
Posts: 759
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Improving speed

Post by Daniel Anulliero »

Sven Schüle wrote:
Henk wrote:What I understood is that there are engines that are five times faster than Fairy-max. That means I should be able to get 3.5 million NPS. I already demolished my code to get a speed of 1.4 million NPS on my machine. So there is still room for improvement. Factor two would be nice.
Your goal must be to reach a rating above 2200. If I assume a current rating for Skipper in the range of 1700-1800 (just a wild guess) then you can't reach that goal only by making your engine faster. "Factor two" would be about +70 .. +100 Elo points for you, I would consider all energy as wasted that you put into improving speed at that stage of the engine. So you need to improve your search and eval, and this starts at fixing (a lot of) bugs and nowhere else.

In the game Jumbo vs. Skipper on last Sunday at the HGM online blitz tourney, Skipper played 8...a5 after 6...a6 and 7...b6, that *is* a bug (probably in the eval) and you have to fix it. In move 25 Skipper played Rxa2?? which loses the rook (or queen vs rook, as in the game) in very few plies (after Re1 Qd5 Qb3 the rook has no safe square). A program must see a simple loss of material in five plies, even in blitz. *That* is where you need to investigate first, not NPS, LMR, mating the bare king or WTF :-)
Isa download :
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: Improving speed

Post by Henk »

Daniel Anulliero wrote:
Sven Schüle wrote:
Henk wrote:What I understood is that there are engines that are five times faster than Fairy-max. That means I should be able to get 3.5 million NPS. I already demolished my code to get a speed of 1.4 million NPS on my machine. So there is still room for improvement. Factor two would be nice.
Your goal must be to reach a rating above 2200. If I assume a current rating for Skipper in the range of 1700-1800 (just a wild guess) then you can't reach that goal only by making your engine faster. "Factor two" would be about +70 .. +100 Elo points for you, I would consider all energy as wasted that you put into improving speed at that stage of the engine. So you need to improve your search and eval, and this starts at fixing (a lot of) bugs and nowhere else.

In the game Jumbo vs. Skipper on last Sunday at the HGM online blitz tourney, Skipper played 8...a5 after 6...a6 and 7...b6, that *is* a bug (probably in the eval) and you have to fix it. In move 25 Skipper played Rxa2?? which loses the rook (or queen vs rook, as in the game) in very few plies (after Re1 Qd5 Qb3 the rook has no safe square). A program must see a simple loss of material in five plies, even in blitz. *That* is where you need to investigate first, not NPS, LMR, mating the bare king or WTF :-)
That wasn't a bug. That was done deliberately. Because eval consumes CPU time and I was focusing on speed only. Just an experiment.

[Don't know yet about Rxa2?? Probably LMR reduction.]
Daniel Anulliero
Posts: 759
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Improving speed

Post by Daniel Anulliero »

Ok
Again , the conclusion is , after reading all the topic , Mr Henk NEVER listen advices . Pff ... answering to this guy is a waste of time ... everytime I say to myself "dont answer , not useful, he just do what he want ..." and every time , I write some things lol
Poor Skipper ... :cry:
Isa download :
abulmo2
Posts: 433
Joined: Fri Dec 16, 2016 11:04 am
Location: France
Full name: Richard Delorme

Re: Improving speed

Post by abulmo2 »

I released a downsized version of Amoeba:
https://github.com/abulmo/Dumb/releases/tag/1.0
with almost no knowledge (just material & positional) and very basic search techniques: hash table, pvs/negascout, aspiration windows, iid, quiescence search, null move, check extension and that's it.
If your program is much weaker than this Dumb engine, there are probably bugs in your code, or very poor implementations of some algorithms.
Richard Delorme
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: Improving speed

Post by Henk »

Speed first. First I have to fix the speed bugs.
smcracraft
Posts: 737
Joined: Wed Mar 08, 2006 8:08 pm
Location: Orange County California
Full name: Stuart Cracraft

Re: Improving speed

Post by smcracraft »

I finished some coding about 10 years ago and let it be for the intervening time. When I came back to it, on faster hardware, with the gap, and made a few obvious changes (simplification, and other tweaks), the result is good. I think I'll mothball it for another ten years. :-)
Daniel Anulliero
Posts: 759
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Improving speed

Post by Daniel Anulliero »

abulmo2 wrote:I released a downsized version of Amoeba:
https://github.com/abulmo/Dumb/releases/tag/1.0
with almost no knowledge (just material & positional) and very basic search techniques: hash table, pvs/negascout, aspiration windows, iid, quiescence search, null move, check extension and that's it.
If your program is much weaker than this Dumb engine, there are probably bugs in your code, or very poor implementations of some algorithms.
Thanks for sharing Richard ! I'll try it vs my last version of Isa
And Mr "Speed" Henk must try it vs Skipper ... or new name ? Speeder ? :lol:
Isa download :
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: Improving speed

Post by Henk »

I removed occupier property from my Field or Square class. So now it is bit board only. Very handy for debugging (not). Again I had to change about 400 lines of code.

And guess what speed is 10-20% slower. But at least I know it was not causing the speed bug.