This repo is the live work surface for finding a Hadamard matrix of order
668.
A Hadamard matrix is a square ±1 matrix whose rows are mutually orthogonal.
This repo exists to produce an exact matrix, not just a good-looking search
state.
The main goal is to construct and verify a real Hadamard matrix of order
668.
The target split is:
428is the validation rung668is the active frontier rung- the final deliverable is a square CSV matrix with entries in
{+1, -1}
If a candidate does not pass exact verification, it does not count.
The repo already has:
- a runnable search lane
- a second widened GS/SDS search lane
- an exact verifier
- saved run states
- defect-report tooling
- continuity files so the work can be resumed without rebuilding from zero
Current preserved artifact ladder:
- order
428runs/order_428_lane01_upgrade_seed67_final.jsonbest_score = 5536max_shift_violation = 20
- order
668- Williamson lane baseline
runs/order_668_lane01_upgrade_seed67_long_final.jsonbest_score = 13216periodic_score = 13152row_sum_penalty = 64max_shift_violation = 24
- GS/SDS signature
(17,17,9,3)baselineruns/order_668_gs_17-17-9-3_baseline_5440_final.jsonbest_score = 5440max_shift_violation = 16
- exact polish
runs/order_668_gs_17-17-9-3_exact_polish_4032_final.jsonbest_score = 4032max_shift_violation = 12
- coupled capped repair
runs/order_668_gs_17-17-9-3_coupled_cap_3456_final.jsonbest_score = 3456max_shift_violation = 12
- heavier coupled capped repair
runs/order_668_gs_17-17-9-3_coupled_cap_3456_repair_3328_final.jsonbest_score = 3328max_shift_violation = 12
- bounded PB/ILP exporter rung from the
3328basinruns/order_668_gs_17-17-9-3_coupled_cap_3456_repair_3328_final_pb_ilp.jsonruns/order_668_gs_17-17-9-3_coupled_cap_3456_repair_3328_final_pb_ilp_cpsat.pyruns/order_668_gs_17-17-9-3_coupled_cap_3456_repair_3328_final_pb_ilp_tier1.lpruns/order_668_gs_17-17-9-3_coupled_cap_3456_repair_3328_final_pb_ilp_tier1.opbruns/order_668_gs_17-17-9-3_coupled_cap_3456_repair_3328_final_pb_ilp_tier2.lpruns/order_668_gs_17-17-9-3_coupled_cap_3456_repair_3328_final_pb_ilp_tier2.opbruns/order_668_gs_17-17-9-3_coupled_cap_3456_repair_3328_final_pb_ilp_tier3.lpruns/order_668_gs_17-17-9-3_coupled_cap_3456_repair_3328_final_pb_ilp_tier3.opb
- corrected PB/ILP ring and hybrid descent
runs/order_668_gs_17-17-9-3_pb_ilp_ring2.jsonruns/order_668_gs_17-17-9-3_pb_ilp_ring2_cpsat.pyruns/order_668_gs_17-17-9-3_pb_ilp_ring2_sqcap_4928_final.jsonruns/order_668_gs_17-17-9-3_pb_ilp_ring2_sqcap_bestscore_3392_final.jsonruns/order_668_gs_17-17-9-3_pb_ilp_ring2_sqcap_bestscore_2880_final.json
- root-
2880ring-2 continuationruns/order_668_gs_17-17-9-3_root2880_ring2_pb_ilp.jsonruns/order_668_gs_17-17-9-3_root2880_ring2_pb_ilp_cpsat.pyruns/order_668_gs_17-17-9-3_root2880_ring2_sqcap_K4_4032_final.jsonruns/order_668_gs_17-17-9-3_root2880_ring2_sqcap_bestscore_2752_final.jsonbest_score = 2752max_shift_violation = 8
- root-
2752blended surrogate continuationruns/order_668_gs_17-17-9-3_root2752_portfolio_v5_summary.json- blended floor escape from that floor:
runs/order_668_gs_17-17-9-3_root2752_v5blend_floor_bestscore_2688_final.json
best_score = 2688max_shift_violation = 12
- root-
2688meta-blended continuationruns/order_668_gs_17-17-9-3_root2688_portfolio_v2_summary.json- meta-blended floor escape from that floor:
runs/order_668_gs_17-17-9-3_root2688_metablend_floor_bestscore_2496_512slack_final.json
best_score = 2496max_shift_violation = 8
- root-
2496portfolio harness validationrun_ring_portfolio.pyruns/order_668_gs_17-17-9-3_root2496_portfolio_v1_summary.json- portfolio winner:
mixed_18_18 - promoted winner touches the
2496floor but does not beat itruns/order_668_gs_17-17-9-3_root2496_portfolio_v1_mixed_18_18_sqcap_K4_4736_bestscore_2496_final.json
- Williamson lane baseline
So the current state is:
- the widened GS/SDS lane is now the active frontier surface
- the search is improving through exact defect repair, not just generic annealing
- the corrected PB/ILP ring plus exact-local hybrid has now pushed the local
basin from
3328down to2880 - the root-
2880ring-2 exact-to-local continuation has now pushed the local floor from2880down to2752 - the blended surrogate upgrade then pushed the local floor from
2752down to2688 - the next meta-blended floor escape pushed the local floor from
2688down to2496 - the portfolio winner has widened with the floor:
mixed_6_6at2752mixed_12_12at2688mixed_18_18at2496
- the work is not solved
- the main remaining obstruction is still coupled SDS defect cancellation on the
668frontier rung
Right now the build is working inside an order-4n construction surface:
428 = 4 * 107668 = 4 * 167
The repo now carries two frontier lanes:
- Williamson / four-circulant lane
- useful as a preserved baseline and defect reference
- Goethals-Seidel / SDS lane
- four length-
n±1sequences with exact row sums - current active signature for
668:(17,17,9,3) - equivalent SDS parameters:
(167; 75,75,79,82; 144) - uses checkpoint resume, exact one-swap polish, and coupled capped repair
- now exports bounded PB/ILP instances over compressed monitored shift expressions
- now supports exporter-time hard-capped guard shifts so seed quality can be shaped before late local repair
- now uses a second-ring exact model plus hybrid handoff back into bounded exact local repair
- now supports a fixed-floor ring portfolio harness so multiple exact ring families can be tested from the same basin and ranked globally before promotion
- now supports blended promotion and floor escapes that combine SDS shift focus with explicit indicator-Fourier frequencies
- measures both periodic defect and SDS defect structure
- keeps exact CSV verification as the final gate
- four length-
This is the current live constructive surface, not a claim that the whole problem is exhausted by one family.
The next movement for this repo is:
- validate the toolchain cleanly on
428 - keep the stronger
668GS/SDS basin as the active live lane - push coupled defect cancellation on the dominant SDS shift pairs
- keep the exact repair layer under a hard score cap, but allow blended floor-escape slack when a frozen floor has clearly formed
- use staged guard-cap seed shaping at the PB/ILP export level before forcing square-drop on the active winner family
- use the corrected PB/ILP ring and hybrid exact-local cycle as the current exact rung
- keep iterating from the
2496floor instead of restarting from the older2752,2880, or3328surfaces - use the ring portfolio harness from the same frozen floor, then promote only
the top
1-2candidates into hybrid/local repair - treat
mixed_18_18as the current default portfolio winner until another ring family beats it on true global score - widen or tighten that exact export schedule before broadening the family
- tune staged guard-cap schedules at the exporter/portfolio layer so leakage is blocked before the seed shape is already wrong
- widen to broader construction families if this one stalls
The repo is therefore meant to show:
- what the target is
- what the current live state is
- what the present construction process is
- what the next mathematical step should be
Every real candidate has to survive:
python3 verify_hadamard.py path/to/candidate.csvThat verifier is the final acceptance condition for this repo.
williamson_search.pypreserved Williamson baseline lanegoethals_seidel_search.pyactive GS/SDS construction laneexact_sds_local_repair.pybounded coupled exact repair over selected SDS shift setsexport_bounded_pb_ilp.pybounded PB/ILP exporter for the live GS/SDS basin, with CP-SAT plus install-free LP/OPB output and optional hard-capped guard shiftssolve_bounded_pb_sqcap.pymonitored square-sum exact solver for bounded PB/ILP rings, including guard-shift capsrun_ring_portfolio.pyfixed-floor portfolio runner that exports4ring families, ranks them globally, and promotes the top1-2HADAMARD_EXACT_MODEL_TEST_MAP.mdvisual rung map for the exact-model and hybrid test ladderHADAMARD_EXACT_MODEL_PROTOCOL.mdstable scan protocol plus the adaptive branching rulesverify_hadamard.pyexact verifier for any candidate CSVreport_williamson_defects.pydefect report for the Williamson lanereport_goethals_seidel_defects.pydefect report for the GS/SDS lane, including SDS and indicator-Fourier readsStart_Search.commandlaunches background search runsHADAMARD_GS_SDS_PROGRESS_NOTE.mdshort public progress note for the active668ladderHADAMARD_CONTINUITY_AND_SEARCH_PLAN.mdcurrent search ladder and widening planHADAMARD_SEARCH_MATRIX.mdlane map and current postureHADAMARD_RESONANCE_KEY_FOR_RICK.mdhandoff file for the next dedicated Hadamard threadHADAMARD_CHATLOG_RECOVERY.mdwhat the recovered thread file did and did not actually contribute
Validation rung:
python3 williamson_search.py --order 428Frontier GS rung:
python3 goethals_seidel_search.py --order 668 --target-signature 17,17,9,3Inspect a stored GS defect state:
python3 report_goethals_seidel_defects.py runs/order_668_gs_17-17-9-3_coupled_cap_3456_repair_3328_final.jsonRun a coupled capped repair:
python3 exact_sds_local_repair.py runs/order_668_gs_17-17-9-3_coupled_cap_3456_final.json --focus-top-unique 12 --depth 6 --beam-width 128 --endpoint-limit 20 --swap-pool-limit 256 --score-slack 0Export a bounded PB/ILP instance from the live 3328 basin:
python3 export_bounded_pb_ilp.py runs/order_668_gs_17-17-9-3_coupled_cap_3456_repair_3328_final.json --focus-top-unique 12 --endpoint-limit 12Run the default ring portfolio from the 2496 floor:
python3 run_ring_portfolio.py runs/order_668_gs_17-17-9-3_root2688_metablend_floor_bestscore_2496_512slack_final.json --output-prefix runs/order_668_gs_17-17-9-3_root2496_portfolioRun the monitored square-sum exact rung on a bounded PB/ILP export:
python3 solve_bounded_pb_sqcap.py runs/order_668_gs_17-17-9-3_root2880_ring2_pb_ilp.json --output-prefix runs/order_668_gs_17-17-9-3_root2880_ring2_sqcap --K-values 4,6,8 --translation-fixRead the exact-model workflow and protocol:
open HADAMARD_EXACT_MODEL_TEST_MAP.md
open HADAMARD_EXACT_MODEL_PROTOCOL.mdIf another node needs the cleanest boot block, use this:
This repo is the live work surface for the Hadamard order 668 problem. 428 is the validation rung. 668 is the frontier rung. The repo carries a runnable Williamson baseline plus a widened GS/SDS construction lane, exact CSV verification, stored run states, and continuity files so the work can continue without amnesia. The live 668 ladder is now 13216 -> 5440 -> 4032 -> 3456 -> 3328 -> 2880 -> 2752, with the active GS signature (17,17,9,3). A result only counts if verify_hadamard.py accepts the final matrix.