library/src/solve_board.cpp
Cursor reports:
The solve_all_boards_n function uses std::memory_order_relaxed for the first_error atomic variable. On weakly-ordered memory architectures (like ARM/Apple Silicon), one thread setting an error may not be visible to other threads checking the error due to lack of acquire-release semantics. This allows threads to continue solving boards after an error has already occurred in another thread, violating the intended behavior of stopping all work on first error.
I can submit a PR with Cursor's proposed fix. I'm raising the issue first since I have no idea what this code is doing! I have not looked at the DD algorithms at all.
library/src/solve_board.cpp
Cursor reports:
The solve_all_boards_n function uses std::memory_order_relaxed for the first_error atomic variable. On weakly-ordered memory architectures (like ARM/Apple Silicon), one thread setting an error may not be visible to other threads checking the error due to lack of acquire-release semantics. This allows threads to continue solving boards after an error has already occurred in another thread, violating the intended behavior of stopping all work on first error.
I can submit a PR with Cursor's proposed fix. I'm raising the issue first since I have no idea what this code is doing! I have not looked at the DD algorithms at all.