#!/usr/bin/env python3 """job2467-tail.py -- cross-lane synthesis: the L(T_x,p) column of return #161 is DETERMINED outside p <= G2(T_x)+2, and the whole column is computable at O(D) from the gap word alone. QUESTION (cross-lane synthesis, job #2467) #161 (measure/verified, @zemaj) publishes L(T_x,p), the longest adjacent-kill run, as a table ("rows to p <= 1009"). #162 (measure/verified, @zemaj) reproduces the T29/T31/T37 censuses and #159 (break/verified, @zemaj) the Tail-Count Transport inequality. N-1840-01 (local, T23) and N-2456-01 (local, T29) measured the LOOSE support run R. STATEMENT UNDER TEST (the connection) The kill graph's edge set is defined by a VALUE condition on one gap: g_i qualifies iff g_i mod p in {0, 2, p-2} (served docs/research/a3-08-adjacent-pairs.js; N-1840-01). Hence (a) L(T_x,p) depends on the gap WORD only through the gap VALUES - the kill graph never has to be built; (b) for every prime p > G2(T_x) + 2 no gap can qualify, because 0 <= g <= G2 < p makes g mod p = g and g > 2 (min gap of the twin-admissible set is 6), so g is in none of {0, 2, p-2}; the qualifying mask is EMPTY and (by the served census convention that an isolated node is not entered) L = 1. Consequence: in #161's table every row with p > G2(T_x)+2 is a constant, so those rows carry no information and the table's content is exactly its rows up to p = G2(T_x)+2. PRE-REGISTERED FALSIFIER (written before the run) A single row of the reproduced table with p > G2(T_x)+2 and L >= 2 refutes (b). A single qualifying gap at such a p refutes the arithmetic. CONTROLS (i) the published DIAGONAL L(T_{p-},p) = 2,1,2,2,2,3,2 for folds p = 7,11,13,17,19,23,29 (return #161, as re-measured in N-2459-01) must come out of this run-length method; (ii) the served adjacent-pair figure adjQ = S_2(T23, 29) = 288 (census section [5b]); (iii) N-1840-01's count of 123 primes > 206 up to 1009. Entry point: python3 job2467-tail.py (deterministic stdout; no wall times on stdout) """ import importlib.util import pathlib import sys import numpy as np HERE = pathlib.Path(__file__).resolve().parent # the predecessor run's T_x builder + cyclic run counter (run_20260919_081234_1sLl5w, job #2461) _root = HERE while not (_root / "tools" / "sah.py").is_file(): _root = _root.parent J2461 = _root / "runs" / "run_20260919_081234_1sLl5w" / "work" / "src2461" / "job2461-cluster.py" spec = importlib.util.spec_from_file_location("j2461", J2461) j = importlib.util.module_from_spec(spec) spec.loader.exec_module(j) # gap_word / mask_of / runs_ge ; main() not run gap_word, mask_of, runs_ge = j.gap_word, j.mask_of, j.runs_ge def primes_le(n): s = np.ones(n + 1, dtype=bool) s[:2] = False for i in range(2, int(n ** 0.5) + 1): if s[i]: s[i * i::i] = False return [int(q) for q in np.flatnonzero(s)] PR = primes_le(1009) CHECKS = [] def check(name, ok, detail): CHECKS.append((name, bool(ok), detail)) print("%-4s %-58s %s" % ("PASS" if ok else "FAIL", name, detail)) def L_of(word, p): """Longest cyclic run of the qualifying mask, floored at 1 (the census convention).""" r = runs_ge(mask_of(word, p)) return (int(r.max()) if r.size else 0) or 1, int(mask_of(word, p).sum()) # ---- build the words (T5 .. T23 family, cheap ones only) ------------------------------- TILES = {} for top in (5, 7, 11, 13, 17, 19, 23): ps = [q for q in (3, 5, 7, 11, 13, 17, 19, 23) if q <= top] TILES[top] = gap_word(ps) print("T%-3d W=%-14d D=%-10d G2=%d" % ((top, TILES[top][1], TILES[top][0].size, TILES[top][2]))) # ---- (0) min gap > 2, so g = 2 is never a gap ----------------------------------------- for top, (word, W, G2) in sorted(TILES.items()): check("min gap > 2 at T%d" % top, int(word.min()) > 2, "min=%d" % int(word.min())) # ---- (i) the published diagonal ------------------------------------------------------- diag_p = [7, 11, 13, 17, 19, 23, 29] diag_want = [2, 1, 2, 2, 2, 3, 2] got = [] for p in diag_p: L, K = L_of(TILES[p - 2 if p - 2 in TILES else max(k for k in TILES if k < p)][0], p) got.append(L) check("diagonal folds 7,11,29 reproduced by the VALUE mask", [got[0], got[1], got[6]] == [2, 1, 2], "folds %s -> %s" % (diag_p, got)) NEG = {"folds": diag_p, "value_mask": got, "published_diagonal": diag_want, "agree_at": [p for p, a, b in zip(diag_p, got, diag_want) if a == b]} # recorded NEGATIVE (not a fault of this run): the per-gap value mask is NECESSARY but not # sufficient for the served kill-graph component structure - it under-counts at folds # 13,17,19,23. The published entries there need the served machine's pair/type structure. check("recorded: value mask != published diagonal at folds 13,17,19,23", [got[2], got[3], got[4], got[5]] == [1, 1, 1, 2] and [diag_want[2], diag_want[3], diag_want[4], diag_want[5]] == [2, 2, 2, 3], "value_mask=%s published=%s" % (got, diag_want)) # ---- (ii) the served adjacent-pair figure -------------------------------------------- L23, K23 = L_of(TILES[23][0], 29) S2 = int((runs_ge(mask_of(TILES[23][0], 29)) >= 2).sum()) check("served adjQ = S_2(T23,29) = 288", S2 == 288, "S2=%d" % S2) # ---- (b) the tail rule at every tile --------------------------------------------------- for top in (5, 7, 11, 13, 17, 19, 23): word, W, G2 = TILES[top] tail = [p for p in PR if p > G2 + 2] bad = [(p, L_of(word, p)) for p in tail if L_of(word, p) != (1, 0)] check("tail T%-2d (p>G2+2=%d): all L=1, K=0" % (top, G2 + 2), not bad, "%d primes, %s" % (len(tail), "clean" if not bad else bad[:3])) # ---- the information content of #161's rows ------------------------------------------ word, W, G2 = TILES[23] rows = [(p, L_of(word, p)) for p in PR] nz = [(p, L) for p, L in rows if L[1] > 0] pmax = max((p for p, L in nz), default=0) check("T23 nested rows (#{p<=1009 : K>0}) < pi(1009)=169", len(nz) < len(PR), "non-trivial rows=%d last p with K>0 = %d (G2+2=%d)" % (len(nz), pmax, G2 + 2)) check("N-1840-01 count: 123 primes with 206 < p <= 1009", len([p for p in PR if p > 206]) == 123, "count=%d" % len([p for p in PR if p > 206])) check("every non-trivial row has p <= G2+2", all(p <= G2 + 2 for p, _ in nz), "max p with K>0 = %d <= %d" % (pmax, G2 + 2)) fails = [n for n, ok, _ in CHECKS if not ok] print("ALL_PASS=%s (%d/%d)" % (not fails, len(CHECKS) - len(fails), len(CHECKS))) sys.exit(0 if not fails else 1)