aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2021-01-23 11:11:26 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commit3f919c40804f024737bcf4da85027a980db6eb23 (patch)
tree8d5aba947c61bd810143418ebabc289c4890f77f
parente6a5b63bbeb36ff9d9d5f2c002395012a0d41fdf (diff)
no speed increase ...
-rw-r--r--include/negamax_cnn1986.c6
-rw-r--r--src/ctaklm.c17
2 files changed, 19 insertions, 4 deletions
diff --git a/include/negamax_cnn1986.c b/include/negamax_cnn1986.c
index b9d618d..6c834f1 100644
--- a/include/negamax_cnn1986.c
+++ b/include/negamax_cnn1986.c
@@ -194,7 +194,11 @@ float
negamax_cnn1986(const uint8_t cur_depth, float alpha, float beta,
const float colour) {
- if (cnn1986_cache_seek(&alpha)) {
+ int sought = EXIT_FAILURE;
+ if (cur_depth < negamax_cnn1986_cache_threshold) {
+ sought = cnn1986_cache_seek(&alpha);
+ }
+ if (sought) {
const uint8_t black = (ply & 1),
material = (black) ? black_count : white_count,
flat = material & 127,
diff --git a/src/ctaklm.c b/src/ctaklm.c
index 44428c8..aaeddde 100644
--- a/src/ctaklm.c
+++ b/src/ctaklm.c
@@ -416,10 +416,21 @@ main(int argc, char **argv) {
(void)(argc);
(void)(argv);
- cnn1986_max_num_cached = 500;
- negamax_cnn1986_search_depth = 3;
- negamax_cnn1986_cache_threshold = 3;
+ /*
+ * cnn1986_max_num_cached = 500;
+ * negamax_cnn1986_search_depth = 3;
+ * negamax_cnn1986_cache_threshold = 3;
+ * new_game(5);
+ */
+
+ // Test harness
+ negamax_cnn1986_cache_threshold = atoi(argv[1]);
+ cnn1986_max_num_cached = atoi(argv[2]);
+ negamax_cnn1986_search_depth = 4;
new_game(5);
+ for (int k=0; k<8; k++) negamax_cnn1986_turn();
+ return 0;
+ // Test harness
char *line = NULL;
ssize_t read = -1;