ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Evaluation speedup or (dynamic evaluation)
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Robert Hyatt



Joined: 27 Feb 2006
Posts: 15870
Location: Birmingham, AL

PostPost subject: Re: Evaluation speedup ; dynamic evaluation    Posted: Sun Apr 08, 2012 1:51 am Reply to topic Reply with quote

MikeGL wrote:
bob wrote:

Did you look at multiple engines? Mine, for example, does not check for bishop pair or bad bishops if there are no bishops on the board... I simply call EvaluateBishops() which promptly returns if there are none...


I have downloaded crafty's source and checked from your official site just now.
crafty's has indeed a straighforward and simple check for B. The for loop checks if
there are Bishops on the board and majority of the code are disregarded if there are none.

But there still seems to be some overhead, even a single call on EvaluateBishops() has
many instructions including push and pops of a couple of registers plus the push and pop of parameters.
Plus the following, which is just outside the for loop:
int score_eg = 0, score_mg = 0, enemy = Flip(side);
tree->score_mg += sign[side] * score_mg;
tree->score_eg += sign[side] * score_eg;

I don't imply the above eval is lousy, I know that the majority of
chess programmers already noticed your obvious C wizardry in crafty.

But there must be some ways to disable or replace that function once there
are no bishops on board, with eval that's more usefull and which can be
effectively applied on the current position and the 'near future' position, as
GMs don't keep on asking himself, "ok how's my bishops or how's my minor pieces",
if he already knew those were swapped 20 moves ago.
It's a waste of time for GMs to keep on asking such a question,
and hence will also be a waste of cpu cycles for machines.


I don't see how to avoid it without a test. How can you determine whether to call the function or not without testing. And if you test, you may as well do it in the place where it makes the most sense. In Crafty, I tested the idea of seeing if I had a piece before calling the piece evaluation. But I STILL need the test in the function to determine when all have been processed. When you think about it, what I do is actually pretty efficient.

One could possibly do N evaluations, each with one or more piece types missing for a specific color. But again, you have to decide somewhere which one of those to call. I've run across one or two machines over the past 45 years or so that could do this pretty well. One could have an array of function addresses to jump to, and when a piece type no longer exists, you could set the address in the array to zero. On those machines, a "branch and link" to address zero was an effective noop... But not today that I know of.
Back to top
View user's profile Send private message
Display posts from previous:   
Subject Author Date/Time
Evaluation speedup or (dynamic evaluation) Mike Libanan Thu Apr 05, 2012 12:27 am
      Re: Evaluation speedup or (dynamic evaluation) Robert Hyatt Thu Apr 05, 2012 7:06 pm
            Re: Evaluation speedup ; dynamic evaluation Mike Libanan Thu Apr 05, 2012 11:10 pm
                  Re: Evaluation speedup ; dynamic evaluation Marco Costalba Fri Apr 06, 2012 5:39 am
                        Re: Evaluation speedup ; dynamic evaluation Sven Schüle Fri Apr 06, 2012 12:01 pm
                  Re: Evaluation speedup ; dynamic evaluation Robert Hyatt Sun Apr 08, 2012 1:51 am
                        Re: Evaluation speedup ; dynamic evaluation Mike Libanan Sun Apr 08, 2012 12:47 pm
                              Re: Evaluation speedup ; dynamic evaluation Ronald de Man Sun Apr 08, 2012 1:23 pm
                                    Re: Evaluation speedup ; dynamic evaluation Robert Hyatt Mon Apr 09, 2012 5:10 pm
                                          Re: Evaluation speedup ; dynamic evaluation Ronald de Man Mon Apr 09, 2012 7:29 pm
      Re: Evaluation speedup or (dynamic evaluation) Ricardo Barreira Thu Apr 05, 2012 8:26 pm
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads