aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-07-15 11:15:35 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-07-15 11:15:35 +0200
commit3d060c348fdfff074a9b902d56f539664789d831 (patch)
tree12705ad2896be47961fab55735ec68e13abad4bc
parent67c35b638c04ab7a860aac0c166936e9481633c9 (diff)
downloadnissy-core-3d060c348fdfff074a9b902d56f539664789d831.tar.gz
nissy-core-3d060c348fdfff074a9b902d56f539664789d831.zip
Solved bug in cocsep generation
-rw-r--r--TODO.txt30
-rw-r--r--src/solve_h48.h29
-rw-r--r--test/103_cocsep_selfsim_distribution/00_all.out22
-rw-r--r--test/111_gendata_h48_h0/00_h_0.out4
4 files changed, 24 insertions, 61 deletions
diff --git a/TODO.txt b/TODO.txt
index 6ca924a..6175672 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,30 +1,14 @@
1Bug in cocsepdata 1Bug in esep table generation
2 - Add tests for ttrep
3 - check that ttrep indeed brings to representative
4 - Fix?
5 - Once fixed, fix other tests
6 - maybe add longtest, e.g. as a tool?
7 - Clean up mixed bfs fromdone / fromnew, use as new for h0k4
8 - Re-do stats 2 - Re-do stats
9 3 - Add long-running test for h0k4 (maybe as a tool?)
10Check stats for all tables using H48stats solver
11 - try DFS for h0 solver 4 - try DFS for h0 solver
12 - compare results, the bfs method could be wrong 5 - use dfs for computing big table, save distance %3 until the last two steps,
13 - if faster: remove bfs 6 then clean the table and double loop over moves to fill the value
14 - if slower: why do I get different results with the new bfs? 7 - dfs for tables with h=1 to 10?
15 8
16Bug in esep table generation
17 - Fails for UFRUFU, try command 9 - Fails for UFRUFU, try command
18 ./run solve -solver H48 -options "2;20" -n 1 -M 10 -cube \ 10 ./run solve -solver H48 -options "2;20" -n 1 -M 10 -cube \
19 "$(./run frommoves -moves "UFRUFU")" 11 "$(./run frommoves -moves "UFRUFU")"
20 - Fundamental error in how tables are generated, each coordinate has too
21 many representative. I need to use the big table with the full coordinate
22 first (h=11, ~241 billion positions, 60Gb with k=2). From this the smaller
23 tables can be easily deduced.
24 - Investigate the possibility of computing smaller tables directly in some
25 other way, even if slow.
26 - use dfs for computing big table, save distance %3 until the last two steps,
27 then clean the table and double loop over moves to fill the value
28 12
29Solver 13Solver
30 - cleanup h48 solver 14 - cleanup h48 solver
@@ -118,6 +102,10 @@ switch. Here NISS may be useful.
118* see if vcube's method to flip all corners is better 102* see if vcube's method to flip all corners is better
119* find a better way for computing the inverse? 103* find a better way for computing the inverse?
120* Transform with big table: make static cube actually static (how?) 104* Transform with big table: make static cube actually static (how?)
105* Use selfsim: in generating some tables, it is in thery possible to only check
106 the few transformations that give self-similarity instead of all 48.
107 The performance drop is almost insignificant, but I would like to figure out
108 the mistake I made previously.
121 109
122## Improvements and other things 110## Improvements and other things
123 111
diff --git a/src/solve_h48.h b/src/solve_h48.h
index 5054605..ed63209 100644
--- a/src/solve_h48.h
+++ b/src/solve_h48.h
@@ -422,16 +422,10 @@ gendata_h48h0k4_return_size:
422_static int64_t 422_static int64_t
423gendata_h48h0k4_bfs(bfsarg_esep_t *arg) 423gendata_h48h0k4_bfs(bfsarg_esep_t *arg)
424{ 424{
425/*
426TODO: the new method gives a slightly different answer. If the new
427method is correct, then the old bfs method is wrong. Which one is it?
428Try also DFS and compare results (it could be faster).
429*/
430 if (2 * arg->done < (int64_t)ESEP_MAX(0)) 425 if (2 * arg->done < (int64_t)ESEP_MAX(0))
431 return gendata_h48h0k4_bfs_fromdone(arg); 426 return gendata_h48h0k4_bfs_fromdone(arg);
432 else 427 else
433 return gendata_h48h0k4_bfs_fromnew(arg); 428 return gendata_h48h0k4_bfs_fromnew(arg);
434// return gendata_h48h0k4_bfs_fromnew(arg);
435} 429}
436 430
437_static int64_t 431_static int64_t
@@ -464,22 +458,7 @@ gendata_h48h0k4_bfs_fromdone(bfsarg_esep_t *arg)
464 cocsep_coord = j / H48_ESIZE(0); 458 cocsep_coord = j / H48_ESIZE(0);
465 sim = arg->selfsim[cocsep_coord] >> UINT64_C(1); 459 sim = arg->selfsim[cocsep_coord] >> UINT64_C(1);
466 for (t = 1; t < 48 && sim; t++, sim >>= UINT64_C(1)) { 460 for (t = 1; t < 48 && sim; t++, sim >>= UINT64_C(1)) {
467 if (!(sim & UINT64_C(1))) { 461 /* TODO: use only selfsim */
468 transd = transform(moved, t);
469 k = coord_h48(transd, arg->cocsepdata, 0);
470 if (k != j) {
471/*
472LOG("t=%" PRId64 ", tinv=%" PRIu8 "\n", t, inverse_trans(t));
473int64_t ccm = coord_cocsep(moved);
474int64_t repm = coord_cocsep(arg->crep[j/H48_ESIZE(0)]);
475LOG("moved: full %" PRId64 ", cocsep %" PRId64 ", rep %" PRId64 ", ttrep %" PRId32 "\n", j, ccm, repm, TTREP(arg->cocsepdata[ccm]));
476int64_t cct = coord_cocsep(transd);
477int64_t rept = coord_cocsep(arg->crep[k/H48_ESIZE(0)]);
478LOG("moved: full %" PRId64 ", cocsep %" PRId64 ", rep %" PRId64 ", ttrep %" PRId32 "\n", j, cct, rept, TTREP(arg->cocsepdata[cct]));
479*/
480 }
481 continue;
482 }
483 transd = transform(moved, t); 462 transd = transform(moved, t);
484 k = coord_h48(transd, arg->cocsepdata, 0); 463 k = coord_h48(transd, arg->cocsepdata, 0);
485 x = get_esep_pval(arg->buf32, k); 464 x = get_esep_pval(arg->buf32, k);
@@ -512,10 +491,7 @@ gendata_h48h0k4_bfs_fromnew(bfsarg_esep_t *arg)
512 j = coord_h48(moved, arg->cocsepdata, 0); 491 j = coord_h48(moved, arg->cocsepdata, 0);
513 x = get_esep_pval(arg->buf32, j); 492 x = get_esep_pval(arg->buf32, j);
514 if (x < arg->depth) 493 if (x < arg->depth)
515{
516if (x < arg->depth -1) LOG("WAT %" PRIu8 " while scanning %" PRIu8 "\n",x, arg->depth);
517 goto neighbor_found; 494 goto neighbor_found;
518}
519 } 495 }
520 continue; 496 continue;
521neighbor_found: 497neighbor_found:
@@ -524,8 +500,7 @@ neighbor_found:
524 cocsep_coord = i / H48_ESIZE(0); 500 cocsep_coord = i / H48_ESIZE(0);
525 sim = arg->selfsim[cocsep_coord] >> 1; 501 sim = arg->selfsim[cocsep_coord] >> 1;
526 for (t = 1; t < 48 && sim; t++, sim >>= 1) { 502 for (t = 1; t < 48 && sim; t++, sim >>= 1) {
527 if (!(sim & 1)) 503 /* TODO: use only selfsim */
528 continue;
529 transd = transform(cube, t); 504 transd = transform(cube, t);
530 j = coord_h48(transd, arg->cocsepdata, 0); 505 j = coord_h48(transd, arg->cocsepdata, 0);
531 x = get_esep_pval(arg->buf32, j); 506 x = get_esep_pval(arg->buf32, j);
diff --git a/test/103_cocsep_selfsim_distribution/00_all.out b/test/103_cocsep_selfsim_distribution/00_all.out
index 94e17a5..e58bfe1 100644
--- a/test/103_cocsep_selfsim_distribution/00_all.out
+++ b/test/103_cocsep_selfsim_distribution/00_all.out
@@ -1,12 +1,12 @@
1373 self-similar positions out of 3393 1373 self-similar positions out of 3393
2Size number of groups 2Size number of groups
31 3020 31 3020
42 311 42 311
53 8 53 8
64 35 64 35
76 9 76 9
88 6 88 6
912 1 912 1
1016 1 1016 1
1124 1 1124 1
1248 1 1248 1
diff --git a/test/111_gendata_h48_h0/00_h_0.out b/test/111_gendata_h48_h0/00_h_0.out
index cc5cf9b..04e8bf6 100644
--- a/test/111_gendata_h48_h0/00_h_0.out
+++ b/test/111_gendata_h48_h0/00_h_0.out
@@ -19,5 +19,5 @@ h48:
191: 1 191: 1
202: 4 202: 4
213: 34 213: 34
224: 329 224: 331
235: 3587 235: 3612

Generated with cgit - Back to sebastiano.tronto.net