We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b8f713 commit 38ec0b3Copy full SHA for 38ec0b3
board.cpp
@@ -562,7 +562,7 @@ void board_t::mirror() {
562
// Mirror en-passant
563
if (record.back().ep_square != 0) {
564
record.back().hash ^= zobrist::ep[record.back().ep_square];
565
- record.back().ep_square = MIRROR_TABLE[record.back().ep_square];
+ record.back().ep_square = rel_sq(BLACK, record.back().ep_square);
566
567
}
568
@@ -585,7 +585,7 @@ void board_t::mirror() {
585
if(old_data[sq].occupied()) switch_piece<true>(old_data[sq].team(), old_data[sq].piece(), sq);
586
587
for (uint8_t sq = 0; sq < 64; sq++) {
588
- if(old_data[sq].occupied()) switch_piece<true>(Team(!old_data[sq].team()), old_data[sq].piece(), MIRROR_TABLE[sq]);
+ if(old_data[sq].occupied()) switch_piece<true>(Team(!old_data[sq].team()), old_data[sq].piece(), rel_sq(BLACK, sq));
589
590
591
eval.cpp
@@ -81,7 +81,7 @@ processed_params_t::processed_params_t(const eval_params_t ¶ms)
81
// Mirror PST for black
82
for (int piece = 0; piece < 6; piece++) {
83
for (int square = 0; square < 64; square++) {
84
- pst[BLACK][piece][MIRROR_TABLE[square]] = pst[WHITE][piece][square];
+ pst[BLACK][piece][rel_sq(BLACK, square)] = pst[WHITE][piece][square];
85
86
87
movesort.cpp
@@ -10,6 +10,18 @@ movesort_t::movesort_t(GenMode mode, const heuristic_set_t &heuristics, const b
10
killer_1 = heur.killers.primary(ply);
11
killer_2 = heur.killers.secondary(ply);
12
killer_3 = ply > 2 ? heur.killers.primary(ply - 2) : EMPTY_MOVE;
13
+
14
+ if(killer_1 == hash_move) {
15
+ killer_1 = EMPTY_MOVE;
16
+ }
17
18
+ if(killer_2 == killer_1 || killer_2 == hash_move) {
19
+ killer_2 = EMPTY_MOVE;
20
21
22
+ if(killer_3 == killer_2 || killer_3 == killer_1 || killer_3 == hash_move) {
23
+ killer_3 = EMPTY_MOVE;
24
25
26
27
// Pray that the compiler optimises tail recursion here - this is a very hot method
@@ -61,9 +73,7 @@ move_t movesort_t::next(GenStage &stage, int &score, bool skip_quiets) {
61
73
62
74
// Score quiets
63
75
for (int i = 0; i < main_buf_size; i++) {
64
- if (main_buf[i] == hash_move) {
65
- main_scores[i] = -1000000000;
66
- } else if (main_buf[i] == killer_1) {
76
+ if (main_buf[i] == killer_1) {
67
77
main_scores[i] = 1000000003;
68
78
} else if (main_buf[i] == killer_2) {
69
79
main_scores[i] = 1000000002;
types.h
@@ -63,17 +63,6 @@ enum Square {
A8, B8, C8, D8, E8, F8, G8, H8,
};
-constexpr uint8_t MIRROR_TABLE[64] = {
- 56, 57, 58, 59, 60, 61, 62, 63,
- 48, 49, 50, 51, 52, 53, 54, 55,
- 40, 41, 42, 43, 44, 45, 46, 47,
70
- 32, 33, 34, 35, 36, 37, 38, 39,
71
- 24, 25, 26, 27, 28, 29, 30, 31,
72
- 16, 17, 18, 19, 20, 21, 22, 23,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 0, 1, 2, 3, 4, 5, 6, 7
-};
-
enum Direction {
D_SW = -9, D_S = -8, D_SE = -7, D_W = -1, D_X = 0, D_E = 1, D_NW = 7, D_N = 8, D_NE = 9
@@ -83,7 +72,7 @@ constexpr Direction rel_offset(Team side, Direction dir) {
constexpr uint8_t rel_sq(Team side, uint8_t square) {
- return side ? MIRROR_TABLE[square] : square;
+ return side ? square ^ 56 : square;
88
89
constexpr uint8_t rel_rank(Team side, uint8_t rank) {
0 commit comments