From 147b0c3c4615c32478a4923242909b8ae5a30d03 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 23 Nov 2025 16:16:31 +0100 Subject: Fix duplicate solutions, overflow in maxsols and improve symmetry reduction for H48. This commit fixes two bugs: - A bug that caused duplicates solutions for symmetric scrambles. - An overflow in the maxsols parameter for the H48 solver, which caused it to find much fewer solutions than existed. Moreover, the H48 solvers has been improved by reducing by symmetry not only from the starting position, but also up to the first 4 moves. --- src/solvers/coord/solve.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/solvers/coord/solve.h') diff --git a/src/solvers/coord/solve.h b/src/solvers/coord/solve.h index 54309b1..9ea6d1a 100644 --- a/src/solvers/coord/solve.h +++ b/src/solvers/coord/solve.h @@ -3,6 +3,7 @@ typedef struct { cube_t inverse; uint8_t target_depth; solution_moves_t *solution_moves; + uint64_t tmask; solution_settings_t *solution_settings; solution_list_t *solution_list; uint8_t nissflag; @@ -163,7 +164,7 @@ solve_coord_dfs(dfsarg_solve_coord_t arg[static 1]) if (coord_is_solved(arg->coord, coord, arg->coord_data)) { if (!coord_solution_admissible(arg)) return 0; - return appendsolution(arg->solution_moves, + return appendsolution(arg->solution_moves, 1, &arg->tmask, arg->solution_settings, arg->solution_list); } @@ -339,7 +340,6 @@ solve_coord( solution_moves_reset(&solution_moves); solution_settings = (solution_settings_t) { - .tmask = TM_SINGLE(inverse_trans(trans)), .unniss = false, .maxmoves = maxmoves, .maxsolutions = maxsolutions, @@ -355,14 +355,15 @@ solve_coord( .ptable = ptable, .solution_moves = &solution_moves, .solution_settings = &solution_settings, + .tmask = TM_SINGLE(inverse_trans(trans)), .solution_list = &solution_list, .nissflag = nissflag, }; i = coord->coord(c, coord_data); if (coord_is_solved(coord, i, coord_data)) { - if (minmoves == 0 && !appendsolution(&solution_moves, - &solution_settings, &solution_list)) + if (minmoves == 0 && !appendsolution(&solution_moves, 1, + &arg.tmask, &solution_settings, &solution_list)) goto solve_coord_error_buffer; goto solve_coord_done; } -- cgit v1.3