Repository navigation
langtons_highway: four follow-up experiments, two of which correct earlier claims - #19
Merged
Merged
Conversation
Adds the code and data for four experiments that probe the conjecture from
angles the brute-force survey cannot reach.
turmite_core.c / turmite_survey.py: generalise the ant and its highway
certificate to any n-colour turmite rule ("RL" is Langton's). Sweeps all
4,095 rules up to length 12 and classifies each. Bounded behaviour is now
proved rather than guessed: Brent cycle detection over an incremental
grid hash replaces an unsound "stopped growing" heuristic.
backward.py: the forward map is a bijection, so the ant has a unique past.
Iterating the inverse step from an empty grid shows the time-reversed ant
is exactly the forward ant rotated 180 degrees, so the past holds no new
information and the conjecture is time-symmetric.
trap.py: lets the ant build its highway, drops obstacles in the road and
measures whether it recovers, how long it takes and which way it leaves.
Obstacles are added only after widening the visited bounding box, since
the certificate treats everything outside that box as background and
would otherwise be unsound.
data/: rule classifications, trapping trials, and equal-sample-size onset
histograms for boxes 4x4 through 8x8.
Tests cover the inverse step, the 180-degree time-reversal correspondence,
the bounding-box widening, and that the generalised core reproduces
Langton's onset of 9,977 and period 104 exactly.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
Records what each experiment found, including the two results that correct earlier claims in this README. - Langton's rule is not special: 468 of 4,095 turmite rules certify a highway, a fraction steady near 11% at every rule length, across 135 distinct periods. Period 104 is shared by 11 rules and 65% of highway rules are faster than Langton's. A control reruns 150 timed-out rules at ten times the budget; none convert. - The highway cannot be destroyed at this scale: all 188 struck obstacles were absorbed, every recovery returning to period 104, though most left in a new direction. - The past is the future rotated 180 degrees, so the backward dynamics holds no new information and the conjecture is time-symmetric. Reversibility also rules out any proof that argues by shrinking basins. - The maximum onset does NOT grow with box size. At equal sample size it is flat; the earlier apparent growth tracked sample size. Only the typical onset grows, and only mildly. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
CrazyDubya
marked this pull request as ready for review
September 20, 2026 15:51
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50a5e68b61
ℹ️ 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".
All three were mine, and one of them had reached the README. - turmite_survey.py dropped the core's onset_exact flag. Six of the 468 highway rows are bounds, not measurements: the backward scan that finds an onset can only see as far as the ring buffer reaches, and stops at that wall. The largest reported onset, 19,171,329, was one of them, and the README quoted it as if measured. Every highway entry now carries its own onset_exact, the six rules are named under onset_inexact_rules, and the README quotes the largest exact onset, 18,962,907, instead. - turmite_survey.py labelled column 7 "cells_per_period" when it is the cumulative count of distinct cells visited by certification time. RRL has period 18 but was emitted with cells_per_period 286. Renamed to visited_at_certification. - backward.py's onset scan began at the last index, so its first partner lookup was already past the end of the array and it always reported the run length instead of the onset. It now starts a full period earlier and recovers 9,977, which is what the 180-degree time-reversal symmetry predicts it must. summarize() is now a separate function, so --summarize-only rebuilds summary.json from an existing rules.csv without repeating the sweep. Three regression tests added; 14 pass. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
Four experiments that probe the Langton's Ant highway conjecture from angles the brute-force survey (#14) and the SAT catalogue (#17) cannot reach. Two of them correct claims this README previously made, and a review round corrected a third.
1. Is Langton's rule special? No. (
turmite_core.c,turmite_survey.py)The ant and its highway certificate are generalised to any n-colour turmite rule (a string of L/R;
RLis Langton's). The certificate carries over unchanged with "white" becoming "colour 0", because a cell's colour is still its visit count mod n.All 4,095 rules of length 1–12, 20M steps each:
The highway fraction holds near 11% at every rule length from 6 to 12. There are 135 distinct periods, longest 1,968; period 104 is shared by only 11 rules and the most common is 18. 65% of highway rules reach their highway faster than Langton's 9,977 steps, the quickest (
RRL) in 39. Drifts are usually diagonal but not always: (16,0), (8,0), (0,2), (12,−8), (−3,11) all occur.Soundness fix along the way: an initial "stopped visiting new cells" heuristic wrongly called
LRRRRRLLRbounded after it had densely filled a 1468×1468 region and was still growing. Bounded behaviour is now proved via Brent cycle detection over an incremental grid hash.Budget caveat, tested rather than asserted. The largest exactly-measured onset is 18,962,907 against a 20,000,000 budget, so the cutoff is inside the onset distribution. I reran 150 randomly chosen timed-out rules at ten times the budget: none converted. The figure looks stable, but it is a sample and remains an upper bound in principle.
Six of the 468 onsets are bounds rather than measurements, each stopping exactly at the ring-buffer wall. They are flagged per-entry with
onset_exactand named underonset_inexact_rules, and never counted toward the exact maximum.2. The highway cannot be destroyed at this scale (
trap.py)Obstacles dropped in the road of a running highway. Of 245 trials, 188 actually struck:
A 21-cell wall across the road is absorbed in a few thousand steps. The highway is easy to deflect and impossible to destroy here, the dynamical counterpart of #17's uniqueness result.
Soundness detail: the certificate treats everything outside the visited bounding box as background, so obstacles are placed only after widening that box. Otherwise it would certify a highway about to hit a wall. There is a test for this.
3. The past is the future rotated 180° (
backward.py)The forward map is a bijection, so the ant has a unique past. Iterating the inverse step from an empty grid yields no new system:
Zero mismatches over 50,000 steps, grids agreeing at every checkpoint. Same onset 9,977, same period 104, drift negated. So the conjecture is time-symmetric, and reversibility independently rules out any proof that argues by shrinking basins — distinct configurations never merge, and the highway is not an attractor in the contracting sense.
4. Correction: the maximum onset does NOT grow with box size
The exhaustive maxima (43,264 / 119,673 / 233,232 for 3×3, 4×4, 5×5) drew 512, 65,536 and 33,554,432 patterns. They differ in sample size as much as in box size. At an equal 50,000 samples each:
The maximum is flat. Only the typical onset grows, and mildly (median +55% from 4×4 to 8×8). The earlier reading was a sample-size artifact. All 250,000 samples reached a certified highway, extending the evidence to 6×6, 7×7 and 8×8, never covered exhaustively.
Review round
Three P2 findings from the Codex bot, all correct, all mine, fixed in ec3fe27 with a regression test each:
onset_exactflag, presenting six truncation bounds as measurements. The largest of them, 19,171,329, had reached the README; it now quotes the largest exact onset instead.cells_per_periodwas actually the cumulative visited count (RRL: period 18, value 286). Renamed tovisited_at_certification.backward.py's onset scan started past the end of its array, so it always printed the run length instead of the onset. It now recovers 9,977, as the time-reversal symmetry requires.summarize()was split out so--summarize-onlyrebuilds the summary from an existingrules.csvwithout repeating the sweep.Testing
pytest langtons_highway/tests -o addopts=""→ 14 passed.flake8 . --select=E9,F63,F7,F82→ 0.🤖 Generated with Claude Code
https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F