Page 1 of 1

Exhaustive lifespan search on small tori (OpenCL) and an FPGA agar hunter

Posted: November 8th, 2026, 5:10 pm
by Phnx
I have written up two search programs, with full source, on my own forum. Both are about small tori, so I'm posting them together here.

1. torus7: exhaustive maximum lifespan on the n x n torus (n = 3..7), OpenCL
Write-up and code: https://forum.phnx.zip/posts/14
- Goes through all 2^49 states of the 7x7 torus in about 17 minutes on an RTX 4070 SUPER (about 2*10^9 start states per second).
- Symmetry reduction: a state is simulated only if its first row is the smallest row/column necklace of the state and it is the smallest image under the few symmetries that keep that row fixed. That leaves about 1.46 simulations per class of the 392 torus symmetries, and every class is covered. This was checked against Burnside's count for n = 3..6.
- The Life step is a 10-line bit-parallel function on one 64-bit word; lifespans are found with a last-two-states check (periods 1 and 2) plus Brent for everything else.
- Results: reproduces vilc's 2, 9, 51, 90 for 3x3..6x6; 7x7 gives 223 (Bert Dobbelaere's pattern from OEIS A294241), unique up to symmetry, and nothing that ends in an oscillator does better. Details in the "Maximum lifespan on torus" thread.

2. agar16: a 24/7 hunter for new agars with spatial period 16, on a Kintex UltraScale+ FPGA
Write-ups: https://forum.phnx.zip/posts/15 (the agars found so far and the checker) and https://forum.phnx.zip/posts/16 (the pipeline)
- The FPGA runs random symmetric soups on the 16x16 torus at about 429 M soups/s and reports rare final-cycle lengths.
- A small C program re-simulates each candidate, drops cycles that are just two independent objects side by side (an lcm of their periods), and keeps a hash table of every phase of every known cycle in canonical form, so the same agar is never reported twice.
- Found so far: single-object cycles of period 352, 400, 512 and 1152 (posted in the Agar discussion thread), besides the known p5024.

The C, OpenCL and Python sources are in the posts as plain listings under the MIT license, so feel free to use or adapt them. They need nothing beyond the C standard library and an OpenCL driver. Questions and bug reports are welcome, here or there.