aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/h48 (unfollow)
Commit message (Collapse)AuthorFilesLines
2026-04-06Make the project build with Microsoft's broken C compiler.Sebastiano Tronto8-119/+120
MSVC is not fully C11-compliant, even when compiling with /std:c11. Some changes were needed to make the codebase compatible. Notably, the notation a[static N] and a[n] for function parameters of array type is not supported, so that had to be hidden behind a macro. Atomic types are also an experimental feature, apparently, but at least they work with the correct compiler flag. One thing that MSVC does well, however, is warning on integer conversions on /W4 level. I am not sure if Clang and GCC have something similar, so I took this chance to fix some of these.
2026-03-01Improve solver name checkSebastiano Tronto1-1/+8
2026-03-01Improve Windows build support.Sebastiano Tronto3-18/+18
- Use multithreading (works with a sufficiently recent version of the Microsoft developer tools / C SDK). - Detect CPU architecture and use AVX2 or NEON when appropriate. - Automatically detect python installation path.
2026-01-12Improve performance of H48 solver with prefetchingSebastiano Tronto1-133/+242
With this commit we re-structure how the node expansion in the H48 solution search works to allow prefetching of pruning values, showing performance improvements in the range of 30-45% on x86, depending on table size and solution length. A small bug fix related to appending solutions is included in this commit.
2025-12-19Minor improvementSebastiano Tronto1-2/+7
Add a trivial check to H48 solver. The benchmarks show, surprisingly, a more noticeable improvement for larger solvers (h10, h11). I was expecting it to be more noticeable for smaller solvers. It is likely that this change is irrelevant to performance and all changes in the benchmark results are just random chance.
2025-12-17Improve pruning value fetching and re-do benchmarksSebastiano Tronto2-20/+37
2025-12-17Move some checks around, small improvementSebastiano Tronto1-11/+9
2025-12-16Swap bit pairs in pval_minSebastiano Tronto1-5/+4
2025-12-14Update commentsSebastiano Tronto2-5/+7
2025-12-14Cleanup, update documentation, fix examplesSebastiano Tronto5-234/+156
2025-12-14Bye bye h0k4Sebastiano Tronto5-310/+27
2025-12-14Intertwined table seems to workSebastiano Tronto7-27/+177
2025-11-24Fix duplicate solutions, overflow in maxsols and improve symmetry reduction ↵Sebastiano Tronto1-37/+41
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.
2025-08-11Made H48 solver safer for 32bit size_tSebastiano Tronto1-2/+9
2025-08-11Wrapped pthread use in custom APISebastiano Tronto3-56/+65
2025-07-29All coordinates unsignedSebastiano Tronto8-74/+74
2025-07-29Cleanup some TODOsSebastiano Tronto3-8/+5
2025-07-28Make failed assert exit immediatelySebastiano Tronto2-6/+4
2025-06-19Small fixesSebastiano Tronto1-2/+2
2025-06-18Trick fixSebastiano Tronto1-6/+21
2025-06-18Change min depth for H48 tasks heuristic sortSebastiano Tronto1-1/+1
2025-06-18Big speedup for H48 solver (heuristic sort of tasks)Sebastiano Tronto1-19/+46
2025-05-30More improvements to web solverSebastiano Tronto1-8/+8
2025-05-28Fix small build error with clangSebastiano Tronto1-1/+2
2025-05-27Removed VLA notation from function parameters.Sebastiano Tronto2-8/+8
I found out that this gives undefined behavior when then size is 0. Better not to have it at all, it is confusing for other developers anyway.
2025-05-26Avoid pausing for logging only if poll_status() is null (h48 solver).Sebastiano Tronto1-10/+7
This is a small amendment to c6a77f30f64be73a5e55e06336975f2ecfbb2324, which changed the way we log solutions while the h48 solver is running. With the method recently introduced, the main thread checks for solutions to log every 0.5 seconds, resulting in a possible slowdown of at most 0.5s per solve. The solutions are also logged when all worker threads are completed. With this new method, when the poll_status() callback function is NULL, which likely means nissy is not run interactively, we rely only on the final log on completion of the worker threads. This means less frequent logging, but at no performance cost.
2025-05-25CleanupSebastiano Tronto1-1/+2
2025-05-25Quick fix for bugSebastiano Tronto1-9/+8
2025-05-23Do all loggin in main threadSebastiano Tronto3-67/+113
Before this committ, the solver (via the generic solution-appender routines in src/solve/solutions.h) and the H48 data generator did some logging in the worker threads, without using any locks. This was not nice, but in practice it did not cause any problem, because the log messages were rare. However, this turned out to be a problem when building to WASM, because web workers do not have access to the main JS memory, and therefore they cannot call functions from the main JS. This includes not only the callback functions for logging, but also those for polling the status of the solver (run / pause / stop). This commit fixes this at the cost or being somewhat inelegant: the solutions are not logged as they are found, but only every 500ms.
2025-05-19Refactored checkdataSebastiano Tronto4-92/+237
Relevant changes include: - Changed the signature of nissy_checkdata(). - Removed expected_distribution.h from tools; this data is now included in each solver's src/ code. - Removed distribution check for cocsep; may add back later.
2025-05-18Refactor solver dispatch and checkdataSebastiano Tronto6-86/+125
2025-05-07Added build scriptSebastiano Tronto1-1/+1
2025-04-29Added stop / pause / resume solve to APISebastiano Tronto1-5/+64
2025-04-25NISSSebastiano Tronto1-16/+15
2025-04-23Adjusted solvers, fixed bugSebastiano Tronto1-7/+8
2025-04-22Update tests for oriented_cube_tSebastiano Tronto1-2/+2
2025-04-21Always use unsigned char * for data buffersSebastiano Tronto5-73/+76
Before this commit I was inconsistently using one of void *, char * and uint8_t *.
2025-04-19Improved logging, especially for solveSebastiano Tronto3-32/+41
2025-04-17Sped up checkdata for H48 tablesSebastiano Tronto2-9/+57
2025-04-17Small rework of optimal vs maxsolsSebastiano Tronto1-10/+12
I wanted to make the "optimal" and "maxsolutions" options mutually exclusive, but in the end I decided there is value in keeping both (e.g. for specifying a limit to the number of solutions when asking for "all" optimal"). Now optimal cannot be negative anymore, for the same reason of maxsolutions. The interface user (shell, UI) will have to take care of handling this in a way that makes sense for the user. Usually this means setting the maximum number of solutions to UINT_MAX (or a similar very high number) when the user wants "all optimal".
2025-04-15Log solutions as they are foundSebastiano Tronto1-3/+3
2025-04-08Some minor changes to the interface.Sebastiano Tronto1-1/+1
- Simplified logger to accept only a string, not a variadic list of args like printf(). This can still use some improvement, but now it is easier to use from other languages. - Fixed some misuses of the logger (wrong types etc) - Renamed some constants - Fixed some typos in comments.
2025-04-01simplified allowedmoves logicSebastiano Tronto2-7/+18
2025-03-25More safety with pointers using VLA function parametersSebastiano Tronto9-91/+102
2025-03-24Big cleanup for appendsolution()Sebastiano Tronto1-163/+74
With this PR the appendsolution routine is extracted from the h48 solver and the new coordinate solver and made generic. This has many advantages: - less repetition (even if the two versions are different enough that *for now* it was not a big deal) - smaller h48/solve.h file, which is already a big beast - easier to test the appendsolution() routine separately
2025-03-22Some safety with move arrays, small refactor appendcharSebastiano Tronto3-32/+21
2025-03-14Added checkdata for coord EOSebastiano Tronto1-0/+1
2025-03-09Working (?) version of coordinate solverSebastiano Tronto1-4/+3
2025-03-07More progress on coordinate solverSebastiano Tronto1-1/+1
2024-12-18Revert small errorSebastiano Tronto2-5/+4

Generated with cgit - Back to sebastiano.tronto.net