From a 9×9×9 Hydraulic-Magnetic Cube to Box-Major AVX2 Search: A Controlled Eight-Generation Ablation (V1–V8) Surpassing State-of-the-Art Exact Sudoku Solving

Physically inspired formulations of the 9×9 Sudoku constraint satisfaction problem—such as a three-dimensional 9×9×9 Hydraulic-Magnetic Cube with compact 4-bit binary state encoding—offer an intuitive geometric view of exact cover constraints, yet rarely undergo rigorous same-hardware comparison against state-of-the-art SIMD exact solvers. In this paper, we formalize, audit, and systematically evolve the Hydraulic-Magnetic Cube from its original 4-bit cell-oriented baseline (V1) and 27-internal-sub-cube (3×3×3) physical model through eight controlled architectural generations (V1–V8) in Rust, benchmarked inside the official tdoku C++ harness across 199,764 puzzles spanning five canonical difficulty suites on a pinned Intel Core i7-12700 P-core. We report five primary findings. First, we identify and correct physical and combinatorial inconsistencies in naive volumetric and stochastic-annealing formulations: we derive the exact piston-and-rod hydrostatic invariants (Vktarget = Ap(3 + (21 − 9k)ρ) for unit-thick heads), proving that non-zero rod ratio ρ > 0 is necessary for height sensing, and prove that unconstrained intra-block stratum partitioning preserves all 9! = 362,880 permutations. Second, transposing the 3D cube into 9 digit-oriented Z-slices (V3) and a 120-byte AVX2 band-slice layout with exact S3 (6-permutation) horizontal/vertical projection and band-configuration branching (V5) yields a 6.87× speedup over V1 on hardest_11+ (3,894 → 26,773 puzzles/s; 37.4 μs/puzzle), surpassing C++ SIMD fsss2 on three of five suites. Third, formalizing the 27-sub-cube volume conservation law as exact Hydraulic Confinement and Overpressure Expulsion rules (V6) reduces average guesses across every non-trivial suite (by 8.1%–17.6%, down to 42.77 guesses on hardest_11+), while a 650-puzzle audit shows that incremental ΔH bitmask annealing (X1) improves easy-suite convergence (72.5% → 96.5%) yet collapses to 0%–0.5% on hard suites (1,526× slower than V5). Fourth, extending V5 with a branchless AVX2 operator for generic Positive and Negative Triads (C(9,3) = 84 triples in a single ymm register, ~16 cycles on the negative fast path; V7) achieves 100% exact deductive parity with tdoku (78.671% zero-guess on sudoku17 with 5,000/5,000 zero-divergence audit; 7.922% on top1465; 35.85 vs. 35.75 guesses on hardest_11+), isolating the remaining 1.88× per-node gap strictly to the digit-major vs. box-major memory-layout boundary. Fifth, directly confirming this hypothesis, V8 (cubo_v8_boxmajor_avx2) transposes the solver to a 480-byte, 32-byte-aligned box-major AVX2 state (9 ymm blocks uniting 9 cells and 6 negative triads + 6 xmm S3 bands, native limit = 1 and arbitrary solution counting / limit = 2 uniqueness proving) and introduces four assembly-guided and algebraic optimizations: inline 15-vector AVX2 state copying (eliminating GLIBC memcpy PLT calls) with zero hot-path bounds checks and shrink-wrapping, 5-instruction branchless XMM clear_low_bit with parallel DPLL rotations and lazy four evaluation, a 4-cycle popcounts9 replacing 5-cycle vpmaddubsw, and an algebraic binary-tree reduction for 4-element triad assertions. While compiling C++ tdoku with Clang 21.1.8 (LLVM) instead of GCC 15.2.0 exposes an +8.2%–+8.8% compiler-backend confounder on hard suites, the optimized Rust V8 outperforms even Clang/LLVM-compiled tdoku on all 5/5 official suites under both limit = 1 (+2.4% to +10.8%; 53,340 p/s and 0.524 μs/guess on hardest_11+, 13.70× over V1) and limit = 2 uniqueness proving (+0.7% to +10.6%; 28,311 vs. 27,853 p/s on hardest_11+)—a 10/10 clean sweep in reversed-order counterproofs, and +9.9% to +13.6% ahead of GCC-compiled tdoku. Companion Artifacts (hydro_sudoku_v8_avx2_artifacts.zip): Includes the zero-dependency standalone Rust V8 AVX2 crate (v8_standalone/ with C-FFI symbol CuboSolverV8), the Clang/LLVM tdoku benchmark reproduction script (reproduce_tdoku_clang.sh), all four benchmark CSV datasets (data/), README.md, and MIT LICENSE.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-12-02
DOI
https://doi.org/10.5281/zenodo.24756695
Primary Topic
Constraint Satisfaction and Optimization
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

From a 9×9×9 Hydraulic-Magnetic Cube to Box-Major AVX2 Search: A Controlled Eight-Generation Ablation (V1–V8) Surpassing State-of-the-Art Exact Sudoku Solving

Antunes.T
Zenodo (CERN European Organization for Nuclear Research)
Constraint Satisfaction and Optimization
preprint

From a 9×9×9 Hydraulic-Magnetic Cube to Box-Major AVX2 Search: A Controlled Eight-Generation Ablation (V1–V8) Surpassing State-of-the-Art Exact Sudoku Solving

Antunes.T
preprint en

Abstract

Physically inspired formulations of the 9×9 Sudoku constraint satisfaction problem—such as a three-dimensional 9×9×9 Hydraulic-Magnetic Cube with compact 4-bit binary state encoding—offer an intuitive geometric view of exact cover constraints, yet rarely undergo rigorous same-hardware comparison against state-of-the-art SIMD exact solvers. In this paper, we formalize, audit, and systematically evolve the Hydraulic-Magnetic Cube from its original 4-bit cell-oriented baseline (V1) and 27-internal-sub-cube (3×3×3) physical model through eight controlled architectural generations (V1–V8) in Rust, benchmarked inside the official tdoku C++ harness across 199,764 puzzles spanning five canonical difficulty suites on a pinned Intel Core i7-12700 P-core. We report five primary findings. First, we identify and correct physical and combinatorial inconsistencies in naive volumetric and stochastic-annealing formulations: we derive the exact piston-and-rod hydrostatic invariants (Vktarget = Ap(3 + (21 − 9k)ρ) for unit-thick heads), proving that non-zero rod ratio ρ > 0 is necessary for height sensing, and prove that unconstrained intra-block stratum partitioning preserves all 9! = 362,880 permutations. Second, transposing the 3D cube into 9 digit-oriented Z-slices (V3) and a 120-byte AVX2 band-slice layout with exact S3 (6-permutation) horizontal/vertical projection and band-configuration branching (V5) yields a 6.87× speedup over V1 on hardest_11+ (3,894 → 26,773 puzzles/s; 37.4 μs/puzzle), surpassing C++ SIMD fsss2 on three of five suites. Third, formalizing the 27-sub-cube volume conservation law as exact Hydraulic Confinement and Overpressure Expulsion rules (V6) reduces average guesses across every non-trivial suite (by 8.1%–17.6%, down to 42.77 guesses on hardest_11+), while a 650-puzzle audit shows that incremental ΔH bitmask annealing (X1) improves easy-suite convergence (72.5% → 96.5%) yet collapses to 0%–0.5% on hard suites (1,526× slower than V5). Fourth, extending V5 with a branchless AVX2 operator for generic Positive and Negative Triads (C(9,3) = 84 triples in a single ymm register, ~16 cycles on the negative fast path; V7) achieves 100% exact deductive parity with tdoku (78.671% zero-guess on sudoku17 with 5,000/5,000 zero-divergence audit; 7.922% on top1465; 35.85 vs. 35.75 guesses on hardest_11+), isolating the remaining 1.88× per-node gap strictly to the digit-major vs. box-major memory-layout boundary. Fifth, directly confirming this hypothesis, V8 (cubo_v8_boxmajor_avx2) transposes the solver to a 480-byte, 32-byte-aligned box-major AVX2 state (9 ymm blocks uniting 9 cells and 6 negative triads + 6 xmm S3 bands, native limit = 1 and arbitrary solution counting / limit = 2 uniqueness proving) and introduces four assembly-guided and algebraic optimizations: inline 15-vector AVX2 state copying (eliminating GLIBC memcpy PLT calls) with zero hot-path bounds checks and shrink-wrapping, 5-instruction branchless XMM clear_low_bit with parallel DPLL rotations and lazy four evaluation, a 4-cycle popcounts9 replacing 5-cycle vpmaddubsw, and an algebraic binary-tree reduction for 4-element triad assertions. While compiling C++ tdoku with Clang 21.1.8 (LLVM) instead of GCC 15.2.0 exposes an +8.2%–+8.8% compiler-backend confounder on hard suites, the optimized Rust V8 outperforms even Clang/LLVM-compiled tdoku on all 5/5 official suites under both limit = 1 (+2.4% to +10.8%; 53,340 p/s and 0.524 μs/guess on hardest_11+, 13.70× over V1) and limit = 2 uniqueness proving (+0.7% to +10.6%; 28,311 vs. 27,853 p/s on hardest_11+)—a 10/10 clean sweep in reversed-order counterproofs, and +9.9% to +13.6% ahead of GCC-compiled tdoku. Companion Artifacts (hydro_sudoku_v8_avx2_artifacts.zip): Includes the zero-dependency standalone Rust V8 AVX2 crate (v8_standalone/ with C-FFI symbol CuboSolverV8), the Clang/LLVM tdoku benchmark reproduction script (reproduce_tdoku_clang.sh), all four benchmark CSV datasets (data/), README.md, and MIT LICENSE.

Zenodo (CERN European Organization for Nuclear Research)
Constraint Satisfaction and Optimization
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon