transposition table 見てみるか。
transosition table 比較
typedef struct { uint64_t word1, word2; } trans_entry_t; typedef struct { trans_entry_t prefer, always[2]; } trans_table_t; /* name bits shifts word1 depth 8 56 value 16 40 move 19 21 hand 21 0 word2 key 57 7 turn 1 6 threat 1 5 type 2 3 age 3 0 */
れさぴょん
class HashEntry { public: uint64 HashVal; // ハッシュ値 Te Best; // 前回の反復深化での最善手 Te Second; // 前々回以前の反復深化での最善手 int value; // αβ探索で得た局面の評価値 int flag; // αβ探索で得た値が、局面の評価値そのものか、上限値か下限値か int Tesu; // αβ探索を行った際の手数 short depth; // αβ探索を行った際の深さ short remainDepth; // αβ探索を行った際の残り深さ };
Stockfish
/// The TTEntry is the class of transposition table entries /// /// A TTEntry needs 128 bits to be stored /// /// bit 0-31: key /// bit 32-63: data /// bit 64-79: value /// bit 80-95: depth /// bit 96-111: static value /// bit 112-127: margin of static value /// /// the 32 bits of the data field are so defined /// /// bit 0-15: move /// bit 16-20: not used /// bit 21-22: value type /// bit 23-31: generation
Fruit
struct entry_t { uint32 lock; uint16 move; sint8 depth; uint8 date; sint8 move_depth; uint8 flags; sint8 min_depth; sint8 max_depth; sint16 min_value; sint16 max_value; }; struct trans { // HACK: typedef'ed in trans.h entry_t * table; uint32 size; uint32 mask; int date; int age[DateSize]; uint32 used; sint64 read_nb; sint64 read_hit; sint64 write_nb; sint64 write_hit; sint64 write_collision; };
何を保存すべきかは、局面のデータ構造や探索アルゴに依存すると思うんだけど、
とりあえず Bonanza がビットをケチケチしまくってる印象。
詰むときの評価値が 30000 位なのは、評価値を 16bit にする必要があったからか。