aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/h48
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-01-09 21:28:13 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2026-01-09 21:28:13 +0100
commit187b7314b4b8d1276dadb6de24a1c86ed9b5c072 (patch)
treea4ad3c72a602524527653aaad14b62e1c7bd0e82 /src/solvers/h48
parent925a4619633b68eef56eaab935a9a64460d819ad (diff)
parent87134421a671a0e26c281980285761aee403a425 (diff)
downloadnissy-core-187b7314b4b8d1276dadb6de24a1c86ed9b5c072.tar.gz
nissy-core-187b7314b4b8d1276dadb6de24a1c86ed9b5c072.zip
Merge branch 'h48-dfs-improvements' of tronto.net:nissy-core into h48-dfs-improvements
Diffstat (limited to 'src/solvers/h48')
-rw-r--r--src/solvers/h48/solve.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h
index fcd2762..ce9f4c4 100644
--- a/src/solvers/h48/solve.h
+++ b/src/solvers/h48/solve.h
@@ -68,6 +68,8 @@ STATIC_INLINE void h48_prune_pipeline(dfsarg_solve_h48_t [static 1],
68 h48_prune_t [static NMOVES], uint8_t, bool); 68 h48_prune_t [static NMOVES], uint8_t, bool);
69STATIC_INLINE uint8_t h48_prune_lookup( 69STATIC_INLINE uint8_t h48_prune_lookup(
70 uint64_t, cube_t, dfsarg_solve_h48_t [static 1]); 70 uint64_t, cube_t, dfsarg_solve_h48_t [static 1]);
71STATIC_INLINE uint8_t h48_prune_lookup_nocoord(
72 cube_t, dfsarg_solve_h48_t [static 1]);
71STATIC_INLINE void h48_prune_restore_normal(const h48_prune_t [static 1], 73STATIC_INLINE void h48_prune_restore_normal(const h48_prune_t [static 1],
72 dfsarg_solve_h48_t [static 1], uint8_t); 74 dfsarg_solve_h48_t [static 1], uint8_t);
73STATIC_INLINE void h48_prune_restore_inverse(const h48_prune_t [static 1], 75STATIC_INLINE void h48_prune_restore_inverse(const h48_prune_t [static 1],
@@ -132,6 +134,20 @@ h48_prune_lookup(
132 } 134 }
133} 135}
134 136
137STATIC_INLINE uint8_t
138h48_prune_lookup_nocoord(
139 cube_t cube,
140 dfsarg_solve_h48_t arg[static 1]
141)
142{
143 uint32_t cdata;
144 uint64_t coord;
145
146 get_h48_cdata(cube, arg->cocsepdata, &cdata);
147 coord = coord_h48_edges(cube, COCLASS(cdata), TTREP(cdata), arg->h);
148 return h48_prune_lookup(coord, cube, arg);
149}
150
135STATIC_INLINE void 151STATIC_INLINE void
136h48_prune_pipeline( 152h48_prune_pipeline(
137 dfsarg_solve_h48_t arg[static 1], 153 dfsarg_solve_h48_t arg[static 1],
@@ -371,7 +387,7 @@ STATIC void *
371solve_h48_runthread(void *arg) 387solve_h48_runthread(void *arg)
372{ 388{
373 int i, j; 389 int i, j;
374 uint8_t lastmove; 390 uint8_t lastmove, p;
375 int64_t d, f, nprev; 391 int64_t d, f, nprev;
376 dfsarg_solve_h48_t *dfsarg; 392 dfsarg_solve_h48_t *dfsarg;
377 393
@@ -395,6 +411,12 @@ solve_h48_runthread(void *arg)
395 move(dfsarg->cube, dfsarg->tasks[i].moves[j]); 411 move(dfsarg->cube, dfsarg->tasks[i].moves[j]);
396 dfsarg->inverse = inverse(dfsarg->cube); 412 dfsarg->inverse = inverse(dfsarg->cube);
397 413
414 dfsarg->nodes_visited++;
415 dfsarg->table_lookups++;
416 p = h48_prune_lookup_nocoord(dfsarg->cube, dfsarg);
417 if (p + H48_STARTING_MOVES > dfsarg->target_depth)
418 continue;
419
398 dfsarg->lb_normal = 0; 420 dfsarg->lb_normal = 0;
399 dfsarg->lb_inverse = 0; 421 dfsarg->lb_inverse = 0;
400 dfsarg->movemask_normal = allowedmask[ 422 dfsarg->movemask_normal = allowedmask[

Generated with cgit - Back to sebastiano.tronto.net