aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/h48/solve.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-12-17 10:51:34 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2025-12-17 16:15:02 +0100
commitac3a91f4f173e7a38c70d5cd0caf5a025642312b (patch)
tree968d67099c406c53cf15185d40a09be1739878d6 /src/solvers/h48/solve.h
parent4a2e35f21b07a2abbeddc89c8eda5f1aed6bfb51 (diff)
downloadnissy-core-ac3a91f4f173e7a38c70d5cd0caf5a025642312b.tar.gz
nissy-core-ac3a91f4f173e7a38c70d5cd0caf5a025642312b.zip
Improve pruning value fetching and re-do benchmarks
Diffstat (limited to 'src/solvers/h48/solve.h')
-rw-r--r--src/solvers/h48/solve.h36
1 files changed, 16 insertions, 20 deletions
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h
index 5fd3dd9..2920fa7 100644
--- a/src/solvers/h48/solve.h
+++ b/src/solvers/h48/solve.h
@@ -108,9 +108,9 @@ STATIC_INLINE bool
108solve_h48_stop(dfsarg_solve_h48_t arg[static 1]) 108solve_h48_stop(dfsarg_solve_h48_t arg[static 1])
109{ 109{
110 uint32_t data, data_inv; 110 uint32_t data, data_inv;
111 int64_t coord, coordext, coordmin; 111 int64_t coord;
112 int8_t target, nh, n; 112 int8_t target, nh, n;
113 uint8_t pval_min, pval_eoesep; 113 uint8_t pval, pval_min, pval_eoesep;
114 114
115 arg->movemask_normal = arg->movemask_inverse = MM18_ALLMOVES; 115 arg->movemask_normal = arg->movemask_inverse = MM18_ALLMOVES;
116 arg->nodes_visited++; 116 arg->nodes_visited++;
@@ -132,25 +132,23 @@ solve_h48_stop(dfsarg_solve_h48_t arg[static 1])
132 /* Inverse probing */ 132 /* Inverse probing */
133 133
134 if (!arg->use_lb_inverse) { 134 if (!arg->use_lb_inverse) {
135 arg->table_lookups++;
136 arg->use_lb_inverse = true;
135 coord = coord_h48_edges( 137 coord = coord_h48_edges(
136 arg->inverse, COCLASS(data_inv), TTREP(data_inv), arg->h); 138 arg->inverse, COCLASS(data_inv), TTREP(data_inv), arg->h);
137 coordext = H48_LINE_EXT(coord); 139 pval = get_h48_pval_and_min(arg->h48data, coord, &pval_min);
138 arg->lb_inverse = get_h48_pval(arg->h48data, coordext);
139 arg->table_lookups++;
140 140
141 if (arg->lb_inverse == 0) { 141 if (pval == 0) {
142 arg->table_fallbacks++; 142 arg->table_fallbacks++;
143 143
144 coordmin = H48_LINE_MIN(coord);
145 pval_min = get_h48_pvalmin(arg->h48data, coordmin);
146 pval_eoesep = get_eoesep_pval_cube( 144 pval_eoesep = get_eoesep_pval_cube(
147 arg->h48data_fallback_eoesep, arg->inverse); 145 arg->h48data_fallback_eoesep, arg->inverse);
148 arg->lb_inverse = MAX(pval_min, pval_eoesep); 146 pval = MAX(pval_min, pval_eoesep);
149 } else { 147 } else {
150 arg->lb_inverse += arg->base; 148 pval += arg->base;
151 } 149 }
152 150
153 arg->use_lb_inverse = true; 151 arg->lb_inverse = pval;
154 } 152 }
155 153
156 if (arg->lb_inverse > target) 154 if (arg->lb_inverse > target)
@@ -161,25 +159,23 @@ solve_h48_stop(dfsarg_solve_h48_t arg[static 1])
161 /* Normal probing */ 159 /* Normal probing */
162 160
163 if (!arg->use_lb_normal) { 161 if (!arg->use_lb_normal) {
162 arg->table_lookups++;
163 arg->use_lb_normal = true;
164 coord = coord_h48_edges( 164 coord = coord_h48_edges(
165 arg->cube, COCLASS(data), TTREP(data), arg->h); 165 arg->cube, COCLASS(data), TTREP(data), arg->h);
166 coordext = H48_LINE_EXT(coord); 166 pval = get_h48_pval_and_min(arg->h48data, coord, &pval_min);
167 arg->lb_normal = get_h48_pval(arg->h48data, coordext);
168 arg->table_lookups++;
169 167
170 if (arg->lb_normal == 0) { 168 if (pval == 0) {
171 arg->table_fallbacks++; 169 arg->table_fallbacks++;
172 170
173 coordmin = H48_LINE_MIN(coord);
174 pval_min = get_h48_pval(arg->h48data, coordmin);
175 pval_eoesep = get_eoesep_pval_cube( 171 pval_eoesep = get_eoesep_pval_cube(
176 arg->h48data_fallback_eoesep, arg->cube); 172 arg->h48data_fallback_eoesep, arg->cube);
177 arg->lb_normal = MAX(pval_min, pval_eoesep); 173 pval = MAX(pval_min, pval_eoesep);
178 } else { 174 } else {
179 arg->lb_normal += arg->base; 175 pval += arg->base;
180 } 176 }
181 177
182 arg->use_lb_normal = true; 178 arg->lb_normal = pval;
183 } 179 }
184 180
185 if (arg->lb_normal > target) 181 if (arg->lb_normal > target)

Generated with cgit - Back to sebastiano.tronto.net