aboutsummaryrefslogtreecommitdiff
path: root/TODO/2.1.md
diff options
context:
space:
mode:
Diffstat (limited to 'TODO/2.1.md')
-rw-r--r--TODO/2.1.md63
1 files changed, 47 insertions, 16 deletions
diff --git a/TODO/2.1.md b/TODO/2.1.md
index 6cdd946..92e4555 100644
--- a/TODO/2.1.md
+++ b/TODO/2.1.md
@@ -2,26 +2,57 @@
2 2
3## Rework solver 3## Rework solver
4 4
5### Architecture 5* The architecture is the following: solve.h contains a solve() public
6function that takes as parameters a set of solver methods (see below)
7and a thread manager (basically, multithreaded or single threaded).
8It also has a dfs() public function with the same parameters.
9* The solve() function, looping over the allowed depths, calls
10the dispatcher provided by the thread manager, which takes care of
11instantiating the threads. Each thread calls back to dfs(). The
12thread manager then takes case of re-assembling the solutions, and
13finally returns a list of solutions for the given depth.
14* The specifics of how dfs() works are implemented in a specific solver
15module.
6 16
7* Nail down the theory first 17### solve.h
8* One generic solve module that does not depend on anything else, 18
9 not even on cube if possible 19* Interface: define solve(), dfs() and the types dfsdata, solvermethods and
10* The generic file includes the logic for branching and calls functions 20threadmanager. solve.h is included by specific thread managers and solvers.
11 provided as parameters to move the cube and check the status etc... 21* DfsData: remove Cube *, Movable, Step and extra. Add Void * (containing
12* This includes the logic for single/multithreading (simplify if compiled 22either cube, indexes or whatnot) and a moveset (extracted from step,
13 with N_THREADS = 1 or whatever this option is going to be) 23necessary). Maybe cleanup solveoptions too (e.g. threads not necessary).
14* The data representing the cube is a void pointer 24* solve.h depends only on moves (dependency on step and trans is removed).
25* preparation step should be reworked, maybe removed or delegated to the
26specific implementations.
27* allowed_moves and cancel_niss are moved to move.h.
28* All dfs stuff in the same function. Maybe remove also solvestop.
15* Move two-step solve to a different module 29* Move two-step solve to a different module
16* Each other solver (solve coord, solve fst, solve multistep)
17 should go in a separate module
18 30
19### Other practicalities 31### Specific thread managers
32
33* Single thread. Useful in low-resources environments or when solving multiple
34scrambles at the same time, or simply when asked to solve with one thread.
35* Lazy multithread: threads are as independent as possible and only
36merged at the end. Ideal when all solutions of a certain length are requested.
37* Eager multithread: current implementation, branches communicate the number
38and list of solutions to stop as soon as possible. Good when only one solution
39of a certain depth is required.
40
41### Solver methods
20 42
21* remove cube from dfsarg? (i still need to save the scramble somewhere, 43* bool move_check_stop(DfsArg *, Move): applies the given move (possibly
22 but I really only use it in dfs_niss) 44recovered from DfsData, but we avoid checking for niss by passing it
23* Re-work prepare_step process for solve_generic (nxopt table is special). 45directly) and at the same time checks if the branch should be pruned. Not
24* is_valid should also unnis and / or cleanup the alg. 46elegant, but it is much more efficient to do the two things at the same time
47(e.g. when moving a fst_cube we can move one "orientation" at the time, check
48the pruning table and stop if possible).
49* void add_solution(DfsArg *, ThreadManager): add the solution to the list.
50Also checks if the solution is valid / acceptable (e.g. EO does not finish
51with F' instead of F and such) and cleans it up (rotation, cleanup, unniss).
52* void copy(void * src, void * dst): copy the cube-part of dfs_data. To be
53called by copy_dfsdata, which remains in solve.h (but merged into dfs).
54* void * invert_cube(void *): in preparation for niss.
55* bool niss_makes_sense(DfsArg *): maybe can be done generically in solve.h?
25 56
26## New optimal solver (use fst) 57## New optimal solver (use fst)
27 58

Generated with cgit - Back to sebastiano.tronto.net