"""The autoconvolution f*f of the current verified record, Together AI's 30,000-step function (README: "a step function published by Together AI in 2026, recorded on the source as 1.502862"), with int f = 1. Optimising pushes the peak of f*f down until about a third of it presses flat against one ceiling: that ceiling is the bound. The record is 700 kB, so record.json keeps what the figure needs, made from it exactly by python3 figure.py --reduce ours_2026.json with ours_2026.json from https://github.com/togethercomputer/EinsteinArena-new-SOTA/blob/main/first-autocorrelation/solutions/ours_2026.json f*f is computed in exact integer arithmetic, as checks/judge does; record.json keeps f*f / (int f)^2 at 1201 evenly spaced breakpoints (to 6 decimals) and the exact peak over all 60,001 breakpoints, rounded up to 12 decimals.""" import json import sys from fractions import Fraction from math import gcd from pathlib import Path import kit DATA = Path(__file__).resolve().parent / 'record.json' SAMPLES = 1200 def reduce(src): hs = [Fraction(v) for v in json.loads(Path(src).read_text())['values']] q = 1 for x in hs: q = q * x.denominator // gcd(q, x.denominator) a = [x.numerator * (q // x.denominator) for x in hs] n, total = len(a), sum(a) w = (2 * max(a).bit_length() + n.bit_length()) // 8 + 1 # Kronecker substitution, as in checks/judge y = (int.from_bytes(b''.join(v.to_bytes(w, 'little') for v in a), 'little') ** 2).to_bytes(w * (2 * n - 1), 'little') c = [0] + [int.from_bytes(y[k * w:(k + 1) * w], 'little') for k in range(2 * n - 1)] + [0] # f*f at t = -1/2 + k/(2n) peak = Fraction(2 * n * max(c), total * total) assert (2 * n) % SAMPLES == 0 DATA.write_text(json.dumps({ 'source': 'https://github.com/togethercomputer/EinsteinArena-new-SOTA/blob/main/first-autocorrelation/solutions/ours_2026.json', 'steps': n, 'peak': str(-(-peak.numerator * 10 ** 12 // peak.denominator) / 10 ** 12), 'ff': [round(2 * n * c[k] / total ** 2, 6) for k in range(0, 2 * n + 1, 2 * n // SAMPLES)], }) + '\n') if sys.argv[1:2] == ['--reduce']: reduce(sys.argv[2]) rec = json.loads(DATA.read_text()) peak, ff = float(rec['peak']), rec['ff'] assert rec['peak'].startswith('1.502862') # the README's record assert abs(max(ff) - peak) < 2e-6 and abs(sum(ff[1:-1]) / SAMPLES - 1) < 1e-3 # the samples reach the peak; int f*f = 1 x0, x1, base, top = 24, 616, 252, 60 # t from -1/2 to 1/2; the peak at the top curve = [(x0 + (x1 - x0) * j / SAMPLES, base - (base - top) * v / peak) for j, v in enumerate(ff)] body = kit.polygon([(x0, base)] + curve + [(x1, base)], 'ink', ' fill-opacity=".28"') # a silhouette: f*f swings fast body += kit.line(x0, top, x1, top, 'f-s', 3) # the peak, where the record presses f*f flat kit.write(__file__, 'mathematics', body, label=f'f∗f of the record f, flat at its peak {rec["peak"][:8]}')