Questions for the Stockfish team

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

bhlangonijr
Posts: 482
Joined: Thu Oct 16, 2008 4:23 am
Location: Milky Way

Re: Are we missing something?

Post by bhlangonijr »

BubbaTough wrote:
bhlangonijr wrote: Dr Bob, doesn't it require a full-width search tree to actually occur any "Beal effect"? You are still using alpha beta in your dumbed down Crafty, right? I guess the original experiment conducted by Don Beal requires full width search trees, by using the minmax in its "pure form" - correct me if I am mistaken - which completely makes sense if we consider the stochastic nature of the approach. Otherwise, I think we are not getting any Beal effect at all...

Am I missing something?
Alpha-beta is equivalent to mini-max in terms of the move chosen regardless of what evaluation function you use (random or otherwise). The only effect of using Alpha-beta instead of mini-max is that it calculates faster.

-Sam
If we are talking about independent position random evaluation, what it has to do with equivalence of algorithms in terms of move selection?? I think you actually didn't get how it works.
The basic idea we are playing here is about creating a huge sampling of random values in the leaf nodes so that the more possibilities side-to-move of a given node has, the greater is the probability to it get a high score.
bhlangonijr
Posts: 482
Joined: Thu Oct 16, 2008 4:23 am
Location: Milky Way

Re: Are we missing something?

Post by bhlangonijr »

Gerd Isenberg wrote:
BubbaTough wrote:
bhlangonijr wrote: Dr Bob, doesn't it require a full-width search tree to actually occur any "Beal effect"? You are still using alpha beta in your dumbed down Crafty, right? I guess the original experiment conducted by Don Beal requires full width search trees, by using the minmax in its "pure form" - correct me if I am mistaken - which completely makes sense if we consider the stochastic nature of the approach. Otherwise, I think we are not getting any Beal effect at all...

Am I missing something?
Alpha-beta is equivalent to mini-max in terms of the move chosen regardless of what evaluation function you use (random or otherwise). The only effect of using Alpha-beta instead of mini-max is that it calculates faster.

-Sam
I guess not, with position independent random eval.

http://www.talkchess.com/forum/viewtopi ... 95&t=35455

Very pertinent observation Gerd. I am sorry for repeating you.

I strongly believe all of these tests made here are flawed regarding the Beal effect. The alpha-beta cut-offs will totally screw up with the sampling required by the experiment. It's not clear to me whether Skill < 100 Crafty is playing well due to the Beal effect.

In order to make a genuine test I think we also should not use hashtable scores for pruning, and do not use a staged move generation - good captures, killers, etc. I may be wrong though...

Will try to do some other tests...
UncombedCoconut
Posts: 319
Joined: Fri Dec 18, 2009 11:40 am
Location: Naperville, IL

Re: Are we missing something?

Post by UncombedCoconut »

If PRNG results were truly i.i.d. random variables, minimax and plain alpha-beta from the same root position give the same probability distribution for score / root move. What's less clear is what happens when aspiration windows and re-searches are used, if searching a subtree twice can give different results.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Are we missing something?

Post by bob »

BubbaTough wrote:
bhlangonijr wrote: Dr Bob, doesn't it require a full-width search tree to actually occur any "Beal effect"? You are still using alpha beta in your dumbed down Crafty, right? I guess the original experiment conducted by Don Beal requires full width search trees, by using the minmax in its "pure form" - correct me if I am mistaken - which completely makes sense if we consider the stochastic nature of the approach. Otherwise, I think we are not getting any Beal effect at all...

Am I missing something?
Alpha-beta is equivalent to mini-max in terms of the move chosen regardless of what evaluation function you use (random or otherwise). The only effect of using Alpha-beta instead of mini-max is that it calculates faster.

-Sam
Not quite true here... Since the evaluations are random, the same search can produce two different results... the more evaluations that are done, the more random chances there are to get better numbers.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Are we missing something?

Post by bob »

bhlangonijr wrote:
Gerd Isenberg wrote:
BubbaTough wrote:
bhlangonijr wrote: Dr Bob, doesn't it require a full-width search tree to actually occur any "Beal effect"? You are still using alpha beta in your dumbed down Crafty, right? I guess the original experiment conducted by Don Beal requires full width search trees, by using the minmax in its "pure form" - correct me if I am mistaken - which completely makes sense if we consider the stochastic nature of the approach. Otherwise, I think we are not getting any Beal effect at all...

Am I missing something?
Alpha-beta is equivalent to mini-max in terms of the move chosen regardless of what evaluation function you use (random or otherwise). The only effect of using Alpha-beta instead of mini-max is that it calculates faster.

-Sam
I guess not, with position independent random eval.

http://www.talkchess.com/forum/viewtopi ... 95&t=35455

Very pertinent observation Gerd. I am sorry for repeating you.

I strongly believe all of these tests made here are flawed regarding the Beal effect. The alpha-beta cut-offs will totally screw up with the sampling required by the experiment. It's not clear to me whether Skill < 100 Crafty is playing well due to the Beal effect.

In order to make a genuine test I think we also should not use hashtable scores for pruning, and do not use a staged move generation - good captures, killers, etc. I may be wrong though...

Will try to do some other tests...
It doesn't screw it up that much. Along the PV you get good random scores. And at every other ply everywhere else you do full-width which gives that side a chance to find a better score. I believe it might play even better using pure minimax which would give a really decent approximation to mobility evaluation, but it actually does work reasonably well using alpha/beta, from testing...

And don't forget, we essentially have no move ordering since everything is random, so that this is way closer to minimax than to perfect alpha/beta trees already...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Attention : Possible Crafty problem.

Post by bob »

Gerd Isenberg wrote:
AlvaroBegue wrote:
Uri Blass wrote:If it means positive for white then it means that the search may encourage black to force a draw in case of seeing no mate but seeing a forced draw.
I already pointed this out, but I am afraid nobody was listening.
It was not only you, but Daniel, me and others as well. As Bob elaborated somewhere in this enormous thread, and "proved" by Daniel empirically, symmetric eval seems not that important as we originally thought.

I mean even without random eval search appears often counter intuitive ;-)
This is correct. I thought about my "return (wtm) ? score : -score;" for a while, and was not sure whether that was reasonable or not (easy fix would be to bias the random number down by 50 as suggested.) But when I tested just plain random, it didn't seem to matter with respect to final Elo. What it does inside the tree I have not investigated, and at the moment, have not thought about it any further. This is an interesting thing to play with, if one has nothing else to do. I may well try to write some of this stuff up, and do some more testing, to see if there is a better way to do this. But that happens after a current (long) list of ideas have been tested and dispatched. :)

I think the best thing to take from this so far is that a pure random evaluation plays far better than expected. Something tells me this becomes more of an issue in endgames where that "bushiness" of the tree evaporates. But by going deeper on all branches, that may be compensation, I am not sure. So many questions, so few answers, other than "Yes, Virginia, there is a Santa Clause.." :)
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: Attention : Possible Crafty problem.

Post by Desperado »

hi Bob,

what do you think ?

1:

iterating,researching will enforce/weaken the _highMobility_ effect ?!

2:

pruning techniques will enforce/weaken the _highMobility_ effect ?!

3:

the choice of the random function will influence the _highMobility_ effect?!

4: qSearch issues

a:

the role of qsSearch is a very important difference (imho), because
mobility will not only be added(sampled) on a fixed depth
but over the plies. (the longer the line, the higher the collected mobility?!) ?!
b:

strongly different search depths are reached with the different
random evaluation types because of the standpat condition.
that may lead to significant change in strength ?!
(see some posts before if you like)

c:

there is no constant ratio between tactical moves and
quiet moves (or is there ?) , so mobility/tacticalmobility
is sth. different ?!

5:

all these questions let me think we are talking of a _craftyEffect_ but
_not_ of the _BealEffect_, because the (pre)conditions are _completly_ different.

- no standard minimax (alphaBeta _can_ sample in another way?!)
- no measurement of mobility but tacticalMobility
- collecting "mobility" over the plies (no fixed depth comparison
of the mobility (qsearch),which is simply different way to sample
the mobility quantity)
- iteration,researching,extension,pruning issues

do you agree ?

regards

ps: although i am asking directly bob, of course everyones statement is very welcome. thx
BubbaTough
Posts: 1154
Joined: Fri Jun 23, 2006 5:18 am

Re: Are we missing something?

Post by BubbaTough »

I looked back through the thread a bit, and see this has already been rehashed. I have not looked through all of it though, so must have missed some I am sure (the thread is kind of long at this point).

OK, it is a good point many have made...different numbers are indeed generated. However, it seems like the same properties should hold right? I don't see any reason for alpha-beta to detract from the effects aimed for in any way...the nodes not expanded are known to have no effect if they are expanded, and while they change what number will be generated next by causing the pseudo-number generator to use a different seed...why would that be a bad thing? It just doesn't make sense to me that skipping superfluous random number generations should fundamentally effect the properties of the tree.

I apologize if this has already been covered and I am rehashing old areas. Feel free to ignore me, reference me to old posts, or call me stupid if desired.

-Sam
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Attention : Possible Crafty problem.

Post by bob »

Desperado wrote:hi Bob,

what do you think ?

1:

iterating,researching will enforce/weaken the _highMobility_ effect ?!
I suspect "no effect." If you re-search, you search a different tree with different evals anyway, even if the moves are the same.

2:

pruning techniques will enforce/weaken the _highMobility_ effect ?!
Have to weaken it. Trivial case is a search with branching factor of 1, so that at every ply you only look at one move. No way for this to emulate mobility there.

3:

the choice of the random function will influence the _highMobility_ effect?!
I think all that is needed is decent randomness with a uniform distribution.

4: qSearch issues

a:

the role of qsSearch is a very important difference (imho), because
mobility will not only be added(sampled) on a fixed depth
but over the plies. (the longer the line, the higher the collected mobility?!) ?!
b:
We are not really "collecting" mobility. we are just backing up a probability that one branch has higher mobility for us and less for the opponent, because of how the random numbers are sampled and backed up as if they were scores. You don't want narrow, deep branches. That will break the basic concept of more branches at a node = greater probability of getting a good random number.

strongly different search depths are reached with the different
random evaluation types because of the standpat condition.
that may lead to significant change in strength ?!
(see some posts before if you like)
Good question. But I'm not an expert in this topic (I doubt there is an expert, in fact, since it not particularly useful for high strength applications.) I tried two approaches, 0-99, -99 to 99, and did not find any statistical difference in strength.


c:

there is no constant ratio between tactical moves and
quiet moves (or is there ?) , so mobility/tacticalmobility
is sth. different ?!
I'm not quite sure what "tactical mobility" means.


5:

all these questions let me think we are talking of a _craftyEffect_ but
_not_ of the _BealEffect_, because the (pre)conditions are _completly_ different.
Different how? Crafty's search and Beal's search are quite similar when you use skill=1 in crafty, since all the selective stuff goes away. The tree becomes fixed depth with no extensions or reductions, and no pruning. I am not quite sure what you mean by "completely different."


- no standard minimax (alphaBeta _can_ sample in another way?!)
Simple idea: if you order trees worst-first, alpha/beta and minimax search the _same_ tree exactly. Alpha/beta depends on good ordering to beat minimax. With a random evaluation, there is no way to produce "good ordering" so I do not see this as a significant difference.
- no measurement of mobility but tacticalMobility
- collecting "mobility" over the plies (no fixed depth comparison
of the mobility (qsearch),which is simply different way to sample
the mobility quantity)
The term "tactical mobility" doesn't mean anything to me. But in crafty, there _is_ a fixed depth search, since skill=1 turns all pruning, reductions and extensions completely off...

- iteration,researching,extension,pruning issues

do you agree ?

regards

ps: although i am asking directly bob, of course everyones statement is very welcome. thx
Clearly with a random search, the concept of a "re-search" is not quite the same, but the effect can be. A fail high could mean you found a path that leads to greater mobility. A research won't produce the same values, but you should see a similar result since there really is more mobility. Iterative search does have an effect, since you will always search the move with greatest mobility first, because of the previous iteration. Whether it pays off or not is unknown. Since pruning (except for alpha/beta) is disabled at skill=1, that isn't an issue for the case I have been looking at.
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: Attention : Possible Crafty problem.

Post by Desperado »

1. you mentioned:

skill=1 turns all pruning, reductions and extensions completely off...

does this include that qs will stop when depth = -x (-1) ?

2. if not...

well, emulating mobility works better the higher the branching factor is.

qsSearch-subtree has by its nature a smaller bf than a simple mm-tree(or ab).

And because emulating mobility is sensitive to the bf, i see at least
two reasons not to compare emulating-mm(ab)-mobility with emulating-qs-mobility.

- the bf
- and the undefined search depth.

(so, qs is _only_ sampling,measuring tactical moves, and will give a probability to
have a capture,promotion.Thats what i meant with _tacticalMobility_, and i think
it is just another subject which the sampling is based on, than it was researched
by Beal (?!y/n this is a question) )

maybe the quintessence of sampling/emulating mobility vs. _tacticalMobility_
is the same, but maybe not.

Anyway, thx for response

regards, Michael