Repository navigation
langtons_highway: SAT catalogue of every highway up to period 104 - #17
Conversation
…eriod highway_catalogue.py encodes "a period-P walk whose reads are consistent with its own trail translated by d" as SAT (CaDiCaL via python-sat) and enumerates every solution for each (P, d). Each solution is re-verified independently of the encoding: the walk alone determines the only consistent starting configuration, and the plain ant must replay the reads from it. Two search scopes: an unrestricted window (any walk that returns to d after P steps) and an anchored box window (footprint bounding box at most (R+1) x (R+1)), which is what makes P ~ 100 feasible. catalogue_summary.py aggregates runs, checks completeness of the (P, d) grid for the stated scope, and groups highways by canonical read sequence. data/catalogue/instances_unrestricted.jsonl: every even P <= 50 with |d|_1 <= 6, unrestricted window: no highway. Tests: verifier accepts the classic highway and rejects a corrupted copy; a small instance is unsatisfiable. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Snapshot of the running sweep; the file is append-only and will be replaced by the complete run. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
|
CI status: Same traceback as every run on This PR does not touch This PR's own checks: Generated by Claude Code |
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Append-only snapshot of the running sweep. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Radius-8 sweep done: every even period <= 104, every drift that fits a 9x9 footprint box, 1,754 instances, 2.4 h. Exactly one highway exists in that scope and it is the classic one (P=104, d=(2,2), 41 cells), found where it must be and verified independently. Unrestricted-window scope (P <= 50, |d|_1 <= 6): none. data/catalogue/summary.json records both runs, grid completeness and verification status. README gains a catalogue section stating the result and its exact scope. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b50885a5d7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for dx in range(1, radius + 1): | ||
| for dy in range(0, radius + 1): |
There was a problem hiding this comment.
Include drifts ending just beyond the footprint
For a radius R search, the footprint consists of the P cells read at positions p0..p(P-1), while d=pP is the first position of the next period. The final move can therefore place d at coordinate R+1 even though every cell in the footprint remains within 0..R; for example, the advertised 9×9 scope can contain a candidate ending with drift (9, 1). Restricting both drift components to <= R means those candidates are never submitted, so the README's conclusion that every period-≤104 highway fitting a 9×9 box was searched is not established.
Useful? React with 👍 / 👎.
| tag = f"r{a.radius}" if a.radius else "unrestricted" | ||
| log = open(a.out / f"instances_{tag}.jsonl", "a") |
There was a problem hiding this comment.
Avoid appending a full rerun to the existing catalogue
The documented reproduction command uses the default output directory, which already contains the committed instances_r8.jsonl, so running it appends another complete set of 1,754 instances rather than regenerating the catalogue. catalogue_summary.py then counts both copies, doubling instance counts and solve time and duplicating each highway's found_in entry. The sweep should overwrite the output for a fresh run or explicitly deduplicate/resume by (P, d).
Useful? React with 👍 / 👎.
| prim = [s for s in res["solutions"] if s["primitive_period"] == res["P"]] | ||
| found += len(prim) |
There was a problem hiding this comment.
Exclude unverified SAT models from highway counts
If the SAT encoding produces a model that the independent verifier rejects, it is still included in prim and reported as a primitive highway; the generated summary likewise consumes every stored solution. This is precisely the failure mode the verifier is intended to catch, and future scopes containing any false-positive model would therefore publish an incorrect highway count. Filter on s["verified"] or fail the run when verification is false.
Useful? React with 👍 / 👎.
What this is
The follow-up to #14 that goes after the conjecture from a different direction than brute-forcing seeds: enumerate every possible highway shape, i.e. every periodic-with-drift orbit of the ant on a white background, up to a given period.
A highway with period P and drift d is a configuration C and a P-step walk such that running the ant on C for P steps yields C translated by d. For fixed (P, d) that is a finite SAT problem.
highway_catalogue.py: builds the SAT instance (one-hot ant position and heading per step, per-cell colour epochs, the read/flip/move rules, and the periodicity constraint "colour of q+d after the period = colour of q before it, white beyond the window"), enumerates all solutions with CaDiCaL, blocking every cyclic shift of each one found.ant.pymust replay the reads and end at d with the same heading. Convexity of the window then guarantees the cycle repeats forever.catalogue_summary.py: aggregates runs, checks the (P, d) grid is complete for the stated scope, groups highways by canonical read sequence.Result
Within the searched scope there is exactly one highway, and it is the classic one.
The (P, d) grid is complete for both scopes, no solution failed verification, and the classic highway appears exactly where it must (P=104, d=(2,2)), which is the encoding's end-to-end check. Consequence: any counterexample to the strong conjecture ("the 104-highway is the unique attractor") must have period > 104, or a one-period footprint wider than 9 cells, or both.
Data:
data/catalogue/instances_r8.jsonl,instances_unrestricted.jsonl,summary.json. README has a new section stating the result and its exact scope.Testing
pytest langtons_highway/tests -o addopts=""→ 8 passed (two new: verifier accepts the classic highway and rejects a corrupted copy; a small instance is unsatisfiable).flake8 --isolated --max-line-length=127 langtons_highwayclean.buildCI fails for the pre-existing.flake8reason documented on #14.Note on the commit history
The many "sweep snapshot" commits are append-only checkpoints of the results file taken while the 2.4 h sweep ran; the final commit supersedes them. Squash-merge recommended.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F