Natwarlal v0.10

Discussions about Winboard/Xboard. News about engines or programs to use with these GUIs (e.g. tournament managers or adapters) belong in this sub forum.

Moderator: Andres Valverde

Natwarlal v0.10

Postby Pallav Nawani » 28 Feb 2005, 10:45

New version of Natwarlal is available. Thanks to Dann and all the people who offered advice on how to speed up the engine.

Linux & Windows executables:
http://www.ironcode.com/data/Natwarlal010-bin.zip

Source Code:
http://www.ironcode.com/data/Natwarlal010-src.zip

Major Changes:
* New, faster move generator :wink:
* Increased NPS: about 10%
* Modified Piece Square tables.

Best regards,
Pallav
User avatar
Pallav Nawani
 
Posts: 147
Joined: 26 Sep 2004, 20:00
Location: Dehradun, India

Slight problem

Postby Pallav Nawani » 28 Feb 2005, 12:43

Hi,

I just realised that this version has problems with the single reply extension. This was the only thing I did not test before releasing the new version. : (

Anyway, here is a temp workaround. In the natwarlal.ini change

; Singular reply extension
single_reply_extension = 10

to

; Singular reply extension
single_reply_extension = 7

Sorry for the bother.
Best regards,
Pallav
User avatar
Pallav Nawani
 
Posts: 147
Joined: 26 Sep 2004, 20:00
Location: Dehradun, India

Re: Natwarlal v0.10

Postby Pallav Nawani » 28 Feb 2005, 14:13

New version with the proper natwarlal.ini file uploaded. If you download now, all should be well.

Pallav
User avatar
Pallav Nawani
 
Posts: 147
Joined: 26 Sep 2004, 20:00
Location: Dehradun, India

Re: Natwarlal v0.10

Postby David Weller » 28 Feb 2005, 14:59

Pallav,

What sort of 'speed-ups' did our 'friendly neighborhood gurus' give?

GES needs as many of those as it can get - :)

Or, maybe they were very specific to your code ...
User avatar
David Weller
 
Posts: 135
Joined: 26 Sep 2004, 20:30
Location: USA

Re: Natwarlal v0.10

Postby Charles Roberson » 28 Feb 2005, 15:43

David,

We gave him two simple pieces of advice.
1) Don't do anything until you profile your code.
2) Do algorithmic improvements before simple code opts.

He had troubles profiling his code, so I did it for him.

Charles
The toughest bug to find is the one that doesn't exist. (CR -1988)
Charles Roberson
 
Posts: 23
Joined: 22 Dec 2004, 20:07
Location: North Carolina, USA

Re: Natwarlal v0.10

Postby Pallav Nawani » 28 Feb 2005, 17:28

David Weller wrote:Pallav,
What sort of 'speed-ups' did our 'friendly neighborhood gurus' give?
GES needs as many of those as it can get - :)
Or, maybe they were very specific to your code ...


Not at all. The speed ups were gained by implementing some things. They were common things every engine uses, but Natwarlal didn't.

(a) Fast legality check
Before, whenever I was checking that a move was legal, I did a simple isattacked(). Now I have implemented a faster function to check move legality, which just looks at the previous move. I have not seen this in any other (open source) program, but it is a safe bet that engines which do 1 Million+ NPS are using it.

See the function
Code: Select all
int quick_illegal_check(Game_info &gi)

in attacks.cc

I also have a similar fast check counting function (also in attacks.cc)

(b) Generate check evasions
I now generate check evasions, which I didn't do before. As a result, I don't have to call isattacked() to check move legality at all, since when in check, I generate only legal moves, and only time quick_illegal_check() can fail is when the king is already in check. I took a lot of 'inspiration' from Tord's code here :mrgreen:

(c) New move generator.
Although its not a lot faster than the previous one (maybe 10%) when generating normal moves, it still contributed to NPS increase, because the most of the move generation time is taken in generating captures, and here the new one was much faster.

(d) New compiler flags.
I got about 3K NPS increase by messing around with compiler flags :D

I also move instructions here and there, up and down, but in the end it scarcely resulted in more NPS :( One thing though, if you have something that is frequently accessed, make it a local variable - much faster than globals. Of course, if it requires a lot of initialization you cant make it local as it will consume too much time to initialize it every time.

Hope these things speed up you engine as well.
Best regards,
Pallav
User avatar
Pallav Nawani
 
Posts: 147
Joined: 26 Sep 2004, 20:00
Location: Dehradun, India


Return to Winboard and related Topics

Who is online

Users browsing this forum: No registered users and 18 guests