Worst advice

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

lauriet
Posts: 199
Joined: Sun Nov 03, 2013 9:32 am

Re: Worst advice

Post by lauriet »

Hi Bob,

I think I have found a boolean logic error in your post. :lol:
In your last paragraph, you say "no nothing" !!!
But False(False) = True.

Did you mean you had everything ?

As a computer scientist I know you appreciated correctness, as you argue in the post.

Humble regards
Laurie :wink:
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Worst advice

Post by bob »

lauriet wrote:Hi Bob,

I think I have found a boolean logic error in your post. :lol:
In your last paragraph, you say "no nothing" !!!
But False(False) = True.

Did you mean you had everything ?

As a computer scientist I know you appreciated correctness, as you argue in the post.

Humble regards
Laurie :wink:
:)
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Worst advice

Post by Henk »

Actually I would like to know how search would look like if only highest level efficiency rules would be implemented. Would it be simple or not ?
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Worst advice

Post by hgm »

What do you mean by 'highest efficiency rules'?

Search is normally simple enough. You need a way to sort generated moves, which is usually done by MVV/LVA and SEE for the captures, which also distinguishes good and bad captures, and killer (and possibly history) for the non-captures. You need a mechanism to put the hash move in front of all that, or do internal iterative deepening when you have none. Then you need null move pruning and a general mechanism for LMR, which can be tuned through tables that decide how much you should reduce as a function of remaining depth and move number. You should have in-check detection and the possibility to extend (overruling any reductions) the evasions. And you should of course do a QS where stand-pat is possible as a proxy for all non-captures, and good captures are 'extended' indefinitely.

That covers about it. Things like PVS or aspiration windows only have minor impact. Futility pruning would probably have a bit larger impact, but is is also something that (like raw nps speed) is just a one-time gain, and which would not change the effective branching ratio of your search. The key issue is to get that branching ratio low without overlooking too much.

King Slayer is a practical example of a very basic engine that beats Fairy-Max by ~85%, despite the fact that it does have the same extensions and reductions (null-move R=2, and 1 ply reduction of non-captures. Although I think Fairy-Max exempts all Pawn moves from LMR, while King Slayer does not do that. But it exempts killers, which Fairy-Max does not have at all.) King Slayer and Fairy-Max also have roughly the same, 'knowledgeless' evalution: PST that draw minors and Kings to the center, and push Pawns forward (especially to 6th and 7th rank). The reason King Slayer beats Fairy-Max is purely due to the larger depth it achieves through better move ordering (MVV/LVA + killers).
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Worst advice

Post by Henk »

hgm wrote:What do you mean by 'highest efficiency rules'?
A search that only contains statements that cause relative maximum ELO increments. Don't know it that would be 200, 100, 50 or 30 ELO.

Is King Slayer simple but complete enough ?
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Worst advice

Post by hgm »

Well, I suppose the King Slayer search is an example of that. It has QS, IID, null move, hash move, MVV/LVA, killer, LMR, check extension.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Worst advice

Post by Henk »

Perhaps iterative deepening is not simple enough.
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Worst advice

Post by hgm »

What do you think is not simple about it? It is just a loop over depth, starting at 1. The best move of the iteration becomes hash move of the next (i.e. it is placed in front of the move list) at the end of the iteration. That is all.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Worst advice

Post by Henk »

Actually search will never be simple. For at least it should be possible to cancel search in a proper way.
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Worst advice

Post by hgm »

I guess it depends on what your threshold is for calling something complex. Search will obviously never be as simple as a "hello world" program.

Aborting the search never struck me as a problem. I just have a global 'abortFlag', and I test it directly after UnMake() to do an instant return when it is set. In King Slayer/Simple the abortFlag is only set if the search time exceeds the 'panic' limit, which is probed every 1024 nodes to not loose too much time on clock reading.