solver: check completion before probing square #19

Merged
mcp merged 2 commits from codex/issue-14-completion-check into main 2026-07-30 16:54:09 +01:00
2 Commits
Author SHA1 Message Date
Codex instance ce39d0a4d0 solver: check completion before probing square
next_pos() returns the grid end sentinel when a placement completes the board. Avoid passing that sentinel to largest_square(), which requires an in-range position and otherwise reads past the grid.

Tests: Debug, Release, ASan, and UBSan CTest suites

Refs: #14
2026-07-30 16:50:19 +01:00
Codex instance ccdcf03fa8 test: cover completed solver boards
Exercise both the trivial order-1 solution and the feasible order-8 solution through the independent placement validator.

With the existing completion ordering, the focused test reports a heap-buffer-overflow under AddressSanitizer before validation can run.

Refs: #14
2026-07-30 16:49:21 +01:00