cleanup
This commit is contained in:
@@ -35,10 +35,9 @@ struct fentest {
|
||||
""
|
||||
},
|
||||
*/
|
||||
/* tests rank movegen bug - FIXED
|
||||
*/
|
||||
//"4k3/pppppppp/8/8/8/8/PPPPPPPP/2BRK3 w - - 0 1",
|
||||
//"4k3/pppppppp/8/8/8/8/PPPPPPPP/1B1R1K2 w - - 0 1",
|
||||
|
||||
/* ***************** TEMP TESTS ABOVE ************************** */
|
||||
|
||||
{ __LINE__, MOVEGEN | MOVEDO | PERFT,
|
||||
"illegal white e.p.",
|
||||
"3k4/8/5K2/3pP3/8/2b5/8/8 w - d6 0 1",
|
||||
@@ -92,43 +91,43 @@ struct fentest {
|
||||
* },
|
||||
*/
|
||||
{ __LINE__, ATTACK,
|
||||
"checkers: a1 h1",
|
||||
"1k6/8/8/8/8/8/8/r2K3r w - - 1 1"
|
||||
"only 3 K moves (but impossible situation)",
|
||||
"1k6/8/8/8/8/8/8/r2K3r w - - 0 1"
|
||||
},
|
||||
{ __LINE__, ATTACK,
|
||||
"checkers: a8 h8",
|
||||
"R2k3R/8/8/8/8/8/8/1K6 b - - 1 1"
|
||||
"R2k3R/8/8/8/8/8/8/1K6 b - - 0 1"
|
||||
},
|
||||
{ __LINE__, ATTACK,
|
||||
"checkers: b3 g3",
|
||||
"1k6/8/8/8/8/1r1K2r1/8/8 w - - 1 1"
|
||||
"1k6/8/8/8/8/1r1K2r1/8/8 w - - 0 1"
|
||||
},
|
||||
|
||||
{ __LINE__, ATTACK,
|
||||
"checkers: b6 g6",
|
||||
"8/8/1R1k2R1/8/8/8/8/1K6 b - - 1 1"
|
||||
"8/8/1R1k2R1/8/8/8/8/1K6 b - - 0 1"
|
||||
},
|
||||
|
||||
{ __LINE__, ATTACK,
|
||||
"checkers: g2 g7",
|
||||
"8/k5r1/8/8/6K1/8/6r1/8 w - - 1 1"
|
||||
"8/k5r1/8/8/6K1/8/6r1/8 w - - 0 1"
|
||||
},
|
||||
{ __LINE__, ATTACK,
|
||||
"checkers: g2 g7",
|
||||
"8/6R1/8/6k1/8/8/K5R1/8 b - - 1 1"
|
||||
"8/6R1/8/6k1/8/8/K5R1/8 b - - 0 1"
|
||||
},
|
||||
{ __LINE__, ATTACK,
|
||||
"checkers: d5 e3, pinners: none (2 pieces between attacker & K)",
|
||||
"3k4/8/8/3r3b/b7/1N2nn2/2n1B3/rNBK1Rbr w - - 1 1"
|
||||
"3k4/8/8/3r3b/b7/1N2nn2/2n1B3/rNBK1Rbr w - - 0 1"
|
||||
},
|
||||
|
||||
{ __LINE__, ATTACK,
|
||||
"checkers: d4 e6 pinners: h4 a5 a8 h8",
|
||||
"Rn1k1r1R/4b3/1n2N3/B7/3R3B/8/8/3K4 b - - 1 1"
|
||||
"Rn1k1r1R/4b3/1n2N3/B7/3R3B/8/8/3K4 b - - 0 1"
|
||||
},
|
||||
{ __LINE__, ATTACK,
|
||||
"checkers: d5 e3, pinners: a1 h1 a4 h5",
|
||||
"3k4/8/8/3r3b/b7/1N2n3/4B3/rN1K1R1r w - - 1 0"
|
||||
"3k4/8/8/3r3b/b7/1N2n3/4B3/rN1K1R1r w - - 0 1"
|
||||
},
|
||||
|
||||
{ __LINE__, MOVEGEN | MOVEDO | PERFT,
|
||||
|
@@ -232,16 +232,15 @@ int main(int __unused ac, __unused char**av)
|
||||
movelist_t fishmoves;
|
||||
//move_t move;
|
||||
FILE *outfd;
|
||||
int depth = 6;
|
||||
s64 ms1 = 0, ms1_total = 0;
|
||||
s64 ms2 = 0, ms2_total = 0;
|
||||
s64 ms3 = 0, ms3_total = 0;
|
||||
int run = 7;
|
||||
|
||||
int depth = 6, run = 3;
|
||||
|
||||
if (ac > 1)
|
||||
depth = atoi(av[1]);
|
||||
if (ac > 2)
|
||||
run = atoi(av[2]);
|
||||
run = atoi(av[2]) & 3;
|
||||
printf("depth = %d run=%d\n", depth, run);
|
||||
|
||||
if (!run)
|
||||
@@ -253,7 +252,6 @@ int main(int __unused ac, __unused char**av)
|
||||
bitboard_init();
|
||||
hyperbola_init();
|
||||
|
||||
|
||||
CLOCK_DEFINE(clock, CLOCK_PROCESS);
|
||||
while ((fen = next_fen(PERFT | MOVEDO))) {
|
||||
test_line = cur_line();
|
||||
@@ -271,46 +269,29 @@ int main(int __unused ac, __unused char**av)
|
||||
ms1_total += ms1;
|
||||
|
||||
if (sf_count == my_count) {
|
||||
printf("pt1 OK : line=%3d perft=%lu %'ldms lps=%'lu \"%s\"\n",
|
||||
printf("pt1 OK : line=%3d perft=%'lu %'ldms lps=%'lu \"%s\"\n",
|
||||
test_line, my_count, ms1,
|
||||
ms1? my_count*1000l/ms1: 0,
|
||||
fen);
|
||||
} else {
|
||||
printf("pt1 ERR: line=%3d sf=%lu me=%lu \"%s\"\n",
|
||||
printf("pt1 ERR: line=%3d sf=%'lu me=%'lu \"%s\"\n",
|
||||
test_line, sf_count, my_count, fen);
|
||||
}
|
||||
}
|
||||
|
||||
if (run & 2) {
|
||||
clock_start(&clock);
|
||||
my_count = perft2(pos, depth, 1);
|
||||
my_count = perft_new_pinners(pos, depth, 1);
|
||||
ms2 = clock_elapsed_ms(&clock);
|
||||
ms2_total += ms2;
|
||||
|
||||
if (sf_count == my_count) {
|
||||
printf("pt2 OK : line=%3d perft=%lu %'ldms lps=%'lu \"%s\"\n",
|
||||
printf("pt2 OK : line=%3d perft=%'lu %'ldms lps=%'lu \"%s\"\n",
|
||||
test_line, my_count, ms2,
|
||||
ms2? my_count*1000l/ms2: 0,
|
||||
fen);
|
||||
} else {
|
||||
printf("pt2 ERR: line=%3d sf=%lu me=%lu \"%s\"\n",
|
||||
test_line, sf_count, my_count, fen);
|
||||
}
|
||||
}
|
||||
|
||||
if (run & 4) {
|
||||
clock_start(&clock);
|
||||
my_count = perft_new_pinners(pos, depth, 1);
|
||||
ms3 = clock_elapsed_ms(&clock);
|
||||
ms3_total += ms3;
|
||||
|
||||
if (sf_count == my_count) {
|
||||
printf("pt3 OK : line=%3d perft=%lu %'ldms lps=%'lu \"%s\"\n",
|
||||
test_line, my_count, ms3,
|
||||
ms3? my_count*1000l/ms3: 0,
|
||||
fen);
|
||||
} else {
|
||||
printf("pt3 ERR: line=%3d sf=%lu me=%lu \"%s\"\n",
|
||||
printf("pt2 ERR: line=%3d sf=%'lu me=%'lu \"%s\"\n",
|
||||
test_line, sf_count, my_count, fen);
|
||||
}
|
||||
}
|
||||
@@ -323,7 +304,5 @@ int main(int __unused ac, __unused char**av)
|
||||
printf("total perft %'ldms\n", ms1_total);
|
||||
if (run & 2)
|
||||
printf("total perft2 %'ldms\n", ms2_total);
|
||||
if (run & 4)
|
||||
printf("total perft3 %'ldms\n", ms3_total);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user