|
34 | 34 | using namespace CTSL; |
35 | 35 |
|
36 | 36 | #ifdef HASH_MAP_ENABLE |
37 | | -static constexpr int hashsize = 0x4000000; // 8-128M:102s, 4-64M:93s 2-32M:91s 1-16M: 冲突 |
| 37 | +static constexpr int hashsize = 0x2000000; // 8-128M:102s, 4-64M:93s 2-32M:91s 1-16M: 冲突 |
38 | 38 | HashMap<uint64_t, NineChessAi_ab::HashValue> hashmap(hashsize); |
39 | 39 | #endif // HASH_MAP_ENABLE |
40 | 40 |
|
@@ -1026,20 +1026,20 @@ int NineChessAi_ab::probeHash(uint64_t hash, int depth, int alpha, int beta, int |
1026 | 1026 |
|
1027 | 1027 | type = hashValue.type; |
1028 | 1028 |
|
1029 | | - if (hashValue.type == hashfEXACT) { |
1030 | | - return hashValue.value; |
1031 | | - } |
1032 | | - if ((hashValue.type == hashfALPHA) && // 最多是 hashValue.value |
1033 | | - (hashValue.value <= alpha)) { |
1034 | | - return alpha; |
1035 | | - } |
1036 | | - if ((hashValue.type == hashfBETA) && // 至少是 hashValue.value |
1037 | | - (hashValue.value >= beta)) { |
1038 | | - return beta; |
| 1029 | + if (hashValue.type == hashfEXACT) { |
| 1030 | + return hashValue.value; |
| 1031 | + } |
| 1032 | + if ((hashValue.type == hashfALPHA) && // 最多是 hashValue.value |
| 1033 | + (hashValue.value <= alpha)) { |
| 1034 | + return alpha; |
| 1035 | + } |
| 1036 | + if ((hashValue.type == hashfBETA) && // 至少是 hashValue.value |
| 1037 | + (hashValue.value >= beta)) { |
| 1038 | + return beta; |
1039 | 1039 | } |
1040 | 1040 |
|
1041 | | -out: |
1042 | | - bestMove = hashValue.bestMove; |
| 1041 | +out: |
| 1042 | + bestMove = hashValue.bestMove; |
1043 | 1043 | return valUNKNOWN; |
1044 | 1044 | } |
1045 | 1045 |
|
@@ -1081,13 +1081,13 @@ int NineChessAi_ab::recordHash(int value, int depth, HashType type, uint64_t has |
1081 | 1081 | HashValue hashValue; |
1082 | 1082 | memset(&hashValue, 0, sizeof(HashValue)); |
1083 | 1083 |
|
1084 | | - if (findHash(hash, hashValue) && |
1085 | | - hashValue.type != hashfEMPTY && |
1086 | | - hashValue.depth > depth) { |
1087 | | -#ifdef DEBUG_MODE |
1088 | | - qDebug() << "Skip recordHash coz depth"; |
1089 | | -#endif |
1090 | | - return -1; |
| 1084 | + if (findHash(hash, hashValue) && |
| 1085 | + hashValue.type != hashfEMPTY && |
| 1086 | + hashValue.depth > depth) { |
| 1087 | +#ifdef DEBUG_MODE |
| 1088 | + qDebug() << "Skip recordHash coz depth"; |
| 1089 | +#endif |
| 1090 | + return -1; |
1091 | 1091 | } |
1092 | 1092 |
|
1093 | 1093 | hashValue.value = value; |
|
0 commit comments