Rewrite virtual loss support
commit37280b1ae1f740532a4c78618391f4c2346d16ba
authorPetr Baudis <pasky@ucw.cz>
Sat, 17 Aug 2013 20:18:47 +0000 (17 22:18 +0200)
committerPetr Baudis <pasky@ucw.cz>
Sat, 17 Aug 2013 20:18:47 +0000 (17 22:18 +0200)
tree36bfd74d4c3d7ce6e71a364855668bea0576c40a
parent7d861d23e9ac7626cd011d814852731102c37fee
Rewrite virtual loss support

Instead of directly manipulating the u stats, track the number
of parallel descents separately and use during node evaluation.
Also, manipulate the counter atomically.

On highly parallel machines, the amount of inconsistency introduced by
virtual loss was just too huge - mostly, there would be a tendency of
"forgetting" the virtual loss addition, but performing the removal,
therefore swinging the results off balance, an effect that would be
self-reinforcing (a funny consequence of how the search works) and
cause the tree to quickly deteriorate into very long, not particulary
wise branches.

The change makes virtual loss support reliable (though I did not test
*too* rigorously if it still works so well, game performance wise)
and doesn't seem to introduce any noticeable performance degradation.
uct/policy/ucb1.c
uct/policy/ucb1amaf.c
uct/tree.c
uct/tree.h
uct/walk.c