Retire eval margin and gains

1/ eval margin and gains removed:
 - gains removed by Value(128): search() and qsearch() now behave consistently!

2/ futility_margin()
 - testing showed that there is no added value in this weird (log(depth), movecount)
   formula, and a much simpler linear formula is just as good. In fact, it is most
   likely better, as it is not yet optimally tuned.
 - the new simplified formula also means we get rid of FutilityMargins[], its
   initialization code, and more importantly ss->futilityMoveCount, and the hacky
   code that updates it throughout the search().
 - the current formula gives negative futility margins, and there is a hidden interaction
   between the move coutn pruning formula and the futility margin one: what happens is
   that MCP is supposed to be triggered before we use the non-sensical negative futility
   margins.

3/ unify pre & post futility pruning
 - pre futility pruning (what SF calls value based pruning) used depth < 7 plies,
   while post futility pruning (what SF calls static null move pruning) used depth < 4 plies.
 - also the condition depth < 7 in pre futility pruning was not obvious, and it seemd
   to be depth < 16 (futility_margin() returns an infinite value when depth >= 7).

Tested with fixed number of games both at short TC:
ELO: 0.82 +-2.1 (95%) LOS: 77.3%
Total: 40000 W: 7939 L: 7845 D: 24216

And long TC
ELO: 0.59 +-2.0 (95%) LOS: 71.9%
Total: 40000 W: 6876 L: 6808 D: 26316

bench: 10206576
This commit is contained in:
Lucas Braesch
2013-10-30 11:22:42 +08:00
committed by Marco Costalba
parent 52ae0efccf
commit ecd07e51d0
7 changed files with 47 additions and 112 deletions

View File

@@ -36,7 +36,7 @@
struct TTEntry {
void save(uint32_t k, Value v, Bound b, Depth d, Move m, int g, Value ev, Value em) {
void save(uint32_t k, Value v, Bound b, Depth d, Move m, int g, Value ev) {
key32 = (uint32_t)k;
move16 = (uint16_t)m;
@@ -45,7 +45,6 @@ struct TTEntry {
value16 = (int16_t)v;
depth16 = (int16_t)d;
evalValue = (int16_t)ev;
evalMargin = (int16_t)em;
}
void set_generation(uint8_t g) { generation8 = g; }
@@ -56,13 +55,12 @@ struct TTEntry {
Bound bound() const { return (Bound)bound8; }
int generation() const { return (int)generation8; }
Value eval_value() const { return (Value)evalValue; }
Value eval_margin() const { return (Value)evalMargin; }
private:
uint32_t key32;
uint16_t move16;
uint8_t bound8, generation8;
int16_t value16, depth16, evalValue, evalMargin;
int16_t value16, depth16, evalValue;
};
@@ -85,7 +83,7 @@ public:
void refresh(const TTEntry* tte) const;
void set_size(size_t mbSize);
void clear();
void store(const Key key, Value v, Bound type, Depth d, Move m, Value statV, Value kingD);
void store(const Key key, Value v, Bound type, Depth d, Move m, Value statV);
private:
uint32_t hashMask;