Repository navigation
Compose 25 exact frame retimings with PR254 (conditional κ = 7.1046804825911e-4) - #258
amanforindia wants to merge 1 commit into
Conversation
Independent replay: PASS at
|
| Head | cf82ca09322d1327ab887cfd1cce97591b8d3cfa |
| OS | ubuntu:24.04 container (Docker on a Windows host) |
| Toolchain | g++ 13.3.0, Boost 1.83 headers, no --cxx or --boost-include override |
| Python | 3.12.3, assertions enabled, sympy==1.14.0 |
| Network | disabled (--network none), so the replay is offline as described |
| Command | python3 -B research/cohort-kernel-retiming25/verify.py --output /tmp/retiming25-replay |
| Wall time | 2 min 4 s |
What this run does not cover
- The retiming argument. I did not read
RETIMING-PROOF.mdor check that the 25 frame changes preserve the scalar/COPY sequence beyond what the native checkers assert. - The Response-kernel entrance gauges: 132 helper-pair rewrites, κ = 7.1046520063283e-4 #254 pin. I did not compare the bundled inner package against Dugongue's Response-kernel entrance gauges: 132 helper-pair rewrites, κ = 7.1046520063283e-4 #254 at
9ce32efbyte for byte. The run confirms the package is self-consistent with its own manifests. - Inherited hypotheses. The Response-kernel entrance gauges: 132 helper-pair rewrites, κ = 7.1046520063283e-4 #254 / κ = 7.10392186446856e-4: transport dirty compensations to 21 entrance frames #249 / source527 construction and the Weighted dual-suffix carriers: conditional κ = 7.9961717358e-5 #109 framework assumptions are outside this replay.
One small observation
Several fields in the emitted RETIMING-CERTIFICATE.json are literals written by the wrapper (verify.py lines 44–49), for example native_checkers=7, strict_outer_constraints=47 and adjacent_coarse_and_kappa_rejected=True. They are not read back from the run. The underlying checks do execute: independent_price.py asserts the 47 constraints and both adjacent rejections, and a failure there stops the wrapper. A reader of the certificate alone should know those fields restate the design and are not measured counts.
Replay and report prepared with Anthropic Claude (Claude Code) assistance.
Follow-up audit at
|
| # | Check | Result |
|---|---|---|
| 1 | Parent and retimed words, instruction by instruction | 786,407 ADD/COPY/ERASE records identical in order, operands, coefficient and tag. Exactly 25 ADDs differ, in the frame field only |
| 2 | Every used frame: rank(B) = dim, rank(A) = 24 − dim, A·B = 0 | 27,005 frames pass, so each stored A is the full annihilator of its B |
| 3 | Chronological replay of both words (MOVE nesting and price, common-frame ADD, COPY/ERASE lifecycle, final frames) | Both pass. 98,713 MOVE, 786,359 ADD, 24 COPY, 24 ERASE. Rank mass 434,045 for both |
| 3b | Every distinct MOVE containment, by rational elimination on the bases alone (no annihilators) | 81,639 of 81,639 pass |
| 4 | The 25 changes | Each new frame strictly contains the old one. Dimensions 5→6 (24 gates) and 4→15 (1 gate). Bases and count equal the frozen selection |
| 4b | Local ledger delta | {2:−2, 4:24, 5:−48, 6:25, 11:−1, 13:2, 17:−1}; multiplicity −1, rank-weighted 0. ×5 stages ×40 replicas = 200 removed children |
| 5 | Cleared Gram determinant of 9·B·(I − J/9)·Bᵀ by rational elimination |
26,609 distinct nonempty bases: nonzero, max 118 bits, every prime factor below 2^80 |
| 6 | Normalised profile rebuilt from the word | Equals the histogram the native pricer consumed: W = 173,839, children = 3,935,040, rank mass = 20,825,480 |
| 7 | κ from the coarse point | Exact rational three-level chain and grid rule give 71046804825911/10^17 |
Counts differ from the PR text in two places for reasons of definition, not disagreement: I count distinct MOVE containment pairs (81,639) where the PR counts requirement pairs including repeats of the same frame (98,443), and I skip the empty basis of the zero frame (26,609 versus 26,610).
3. The retiming argument, read against the code
- Lower and upper frame bounds.
RETIMING-PROOF.mdrequiresspan(La ∪ Lb) ≤ F′ ≤ Ua ∩ Ub. The script does not test that sandwich directly. It rebuilds every MOVE and asserts no role ever retreats, which enforces both sides along each role's path. My replay in row 3 confirms the same property from the emitted word. - Scalar semantics. Row 1 confirms the claim that the scalar/COPY projection is unchanged, which is what lets the inherited F2 forward/inverse checks carry over.
- Concavity. The 24
(5,5) → (4,6)changes lower cost by strict concavity ofr^(1−a), as stated. The single read(2,2,11,17) → (13,13,6)is not decided by concavity alone, since it also merges four children into three. The PR prices the full profile exactly, so nothing depends on that.
4. One hardening note
Frame containment in cohort-legality-independent.cpp is decided as dim(a) ≤ dim(b) and B[a] ⟂ A[b]. That is sound only when A[b] spans the whole annihilator of B[b]. For the 25 new frames, extra-retiming.py asserts len(A) == 24 − len(C) and A·C = 0, but I found no assertion in this package that the rows of A are linearly independent. It relies on the vendored kernel() returning a basis. The same applies to inherited frames read from frames.json, whose checks live upstream.
This is not a defect in the result: row 2 shows every one of the 27,005 used annihilators has full rank, and row 3b re-derives every containment without annihilators. A one-line rank assertion on A would make the package self-contained on this point.
Still not covered
- Price rigor. Row 7's sign change at the coarse grid point is a 90-digit
Decimalevaluation (residuals −9.99e-19 and +1.38e-18), which is a sanity check and not interval arithmetic. The rigorous brackets remain the PR's native engine and two Python engines. I did not recheck the 47 outer inequalities independently. - Idle rows. In row 6 I take the four idle/bank rows
(4, 23, 46, 50) × 28,160as given from the inherited construction. - Stages I only replayed. The global F2 column replay, the bank charts and assignment, and the finite invoice ran and passed in the PR's own checkers. I did not re-derive them.
- Inherited hypotheses. The Response-kernel entrance gauges: 132 helper-pair rewrites, κ = 7.1046520063283e-4 #254 / κ = 7.10392186446856e-4: transport dirty compensations to 21 entrance frames #249 / source527 constructions and the Weighted dual-suffix carriers: conditional κ = 7.9961717358e-5 #109 framework assumptions are outside this audit.
audit258.py (independent checker, standard library only)
"""Independent audit of PR258's retimed word. Shares no code with the PR.
Reads a finished replay directory (RUN) and the regenerated PR254 parent
word (PARENT). Standard library only. Exact integer/rational arithmetic,
except section 7, which is a labelled high-precision sanity check.
python audit258.py RUN PARENT
"""
from array import array
from collections import Counter
from decimal import Decimal, getcontext
from fractions import Fraction as Q
from pathlib import Path
import hashlib, json, sys, time
RUN, PARENT = Path(sys.argv[1]), Path(sys.argv[2])
N = 24
P = (1 << 61) - 1 # Mersenne prime for rank lower bounds
load = lambda p: json.loads(Path(p).read_text())
sha = lambda b: hashlib.sha256(b).hexdigest()
t0 = time.time()
def say(*a): print(f'[{time.time()-t0:6.1f}s]', *a, flush=True)
def need(ok, msg):
if not ok: raise SystemExit('FAIL: ' + msg)
def rank_mod_p(rows):
"""Rank over GF(P). Always a lower bound for the rational rank."""
M = [[x % P for x in r] for r in rows]; rank = 0
for col in range(N):
piv = next((i for i in range(rank, len(M)) if M[i][col]), None)
if piv is None: continue
M[rank], M[piv] = M[piv], M[rank]
inv = pow(M[rank][col], P - 2, P)
M[rank] = [x * inv % P for x in M[rank]]
for i in range(len(M)):
if i != rank and M[i][col]:
f = M[i][col]; M[i] = [(x - f * y) % P for x, y in zip(M[i], M[rank])]
rank += 1
return rank
def rref_q(rows):
"""Reduced row echelon form over Q. Returns (pivot columns, rows)."""
M = [[Q(x) for x in r] for r in rows]; piv = []; rank = 0
for col in range(N):
p = next((i for i in range(rank, len(M)) if M[i][col]), None)
if p is None: continue
M[rank], M[p] = M[p], M[rank]
inv = 1 / M[rank][col]; M[rank] = [x * inv for x in M[rank]]
for i in range(len(M)):
if i != rank and M[i][col]:
f = M[i][col]; M[i] = [x - f * y for x, y in zip(M[i], M[rank])]
piv.append(col); rank += 1
return piv, M[:rank]
def in_span(vec, echelon):
piv, R = echelon; v = [Q(x) for x in vec]
for c, row in zip(piv, R):
if v[c]:
f = v[c]; v = [x - f * y for x, y in zip(v, row)]
return not any(v)
def det_q(A):
"""Determinant by rational elimination (not Bareiss, unlike the PR)."""
M = [[Q(x) for x in r] for r in A]; n = len(M); d = Q(1)
for k in range(n):
p = next((i for i in range(k, n) if M[i][k]), None)
if p is None: return 0
if p != k: M[k], M[p] = M[p], M[k]; d = -d
d *= M[k][k]
for i in range(k + 1, n):
if M[i][k]:
f = M[i][k] / M[k][k]; M[i] = [x - f * y for x, y in zip(M[i], M[k])]
need(d.denominator == 1, 'non-integer determinant'); return int(d)
def records(path):
raw = array('i'); raw.frombytes(Path(path).read_bytes())
need(raw.itemsize == 4 and len(raw) % 6 == 0, 'record layout')
return raw
# ---- 1. Words, hashes, projection --------------------------------------
X = RUN / 'temporal/CURRENT249-EXPORT'; L = RUN / 'lead'
new = records(L / 'COHORT249-RECORDS.bin'); old = records(PARENT / 'COHORT249-RECORDS.bin')
say('parent word sha256', sha(old.tobytes())); say('new word sha256', sha(new.tobytes()))
def nonmoves(w): return [tuple(w[k:k+6]) for k in range(0, len(w), 6) if w[k]]
nm_old, nm_new = nonmoves(old), nonmoves(new)
need(len(nm_old) == len(nm_new), 'non-MOVE instruction count changed')
changed = []
for i, (x, y) in enumerate(zip(nm_old, nm_new)):
need((x[0], x[1], x[2], x[3], x[5]) == (y[0], y[1], y[2], y[3], y[5]), f'scalar/COPY instruction {i} changed')
if x[4] != y[4]:
need(x[0] == 1, 'frame change on a non-ADD instruction'); changed.append((i, x[4], y[4]))
say(f'1. PASS {len(nm_new)} ADD/COPY/ERASE instructions identical in order, operands, coefficient and tag;',
f'{len(changed)} ADDs differ in frame only')
# ---- 2. Frames: independent annihilator and rank checks ----------------
frames = load(X / 'frames.json')['frames']; extra = load(L / 'COHORT249-FRAMES.json')
need(not set(frames) & set(extra), 'frame id collision'); frames.update(extra)
B = {int(k): v['B'] for k, v in frames.items()}; A = {int(k): v['A'] for k, v in frames.items()}
D = {int(k): v['dim'] for k, v in frames.items()}
st = load(X / '249-states.json'); n = st['n']; zero = st['ZERO']
initial = {int(k): v for k, v in load(L / 'COHORT249-INITIAL.json').items()}
final = {int(k): v for k, v in st['final'].items()}
used = set(initial.values()) | set(final.values()) | {zero}
for k in range(0, len(new), 6):
op, a, b, c, f, z = new[k:k+6]
if op == 0: used.update((b, c))
elif op == 1: used.add(f)
else: used.update((c, f))
dot = lambda x, y: sum(p * q for p, q in zip(x, y))
for f in sorted(used):
need(f in B, f'unknown frame {f}')
need(len(B[f]) == D[f] and len(A[f]) == N - D[f], f'frame {f} row counts')
need(all(len(r) == N for r in B[f] + A[f]), f'frame {f} width')
need(rank_mod_p(B[f]) == D[f], f'frame {f} basis not independent')
need(rank_mod_p(A[f]) == N - D[f], f'frame {f} annihilator rows not independent')
need(all(dot(x, y) == 0 for x in B[f] for y in A[f]), f'frame {f} annihilator not orthogonal')
say(f'2. PASS {len(used)} used frames: rank(B)=dim, rank(A)=24-dim, A.B=0 exactly, so every stored A is the full annihilator')
# ---- 3. Chronological replay with my own containment test ---------------
ech = {}
def contained(a, b):
"""B[a] inside span(B[b]), by rational elimination on bases only."""
if b not in ech: ech[b] = rref_q(B[b])
return all(in_span(v, ech[b]) for v in B[a])
pairs = {}
def sub(a, b):
if (a, b) not in pairs:
by_ann = D[a] <= D[b] and all(dot(x, y) == 0 for x in B[a] for y in A[b])
pairs[a, b] = by_ann
return pairs[a, b]
def replay(word):
state = {s: zero for s in range(n + 1)}; state.update(initial)
H = Counter(); mass = 0; copied = None; counts = Counter()
for k in range(0, len(word), 6):
op, a, b, c, f, z = word[k:k+6]; counts[op] += 1
if op == 0:
need(a != n or copied, 'MOVE of inactive temporary')
need(state[a] == b and sub(b, c) and D[c] - D[b] == f and f >= 0, f'illegal MOVE at record {k//6}')
state[a] = c
if f: H[f] += 1; mass += f
elif op == 1:
need(a != b and state[a] == f and state[b] == f, f'ADD outside common frame at record {k//6}')
need((a != n and b != n) or copied, 'ADD on inactive temporary')
elif op == 2:
need(copied is None and b == n and state[a] == c and z == D[c], f'COPY at record {k//6}')
copied = (a, c, f); state[n] = f; H[z] += 1; mass += z
elif op == 3:
need(copied == (a, c, f) and b == n and state[a] == c and state[n] == f, f'ERASE at record {k//6}')
copied = None
else: need(False, 'unknown opcode')
need(copied is None, 'unclosed COPY')
need(all(state[s] == final[s] for s in range(n)), 'final frames')
return H, mass, counts
Hn, mass_n, cn = replay(new); used_pairs = dict(pairs)
Ho, mass_o, co = replay(old)
say(f'3. PASS new word replays: {cn[0]} MOVE, {cn[1]} ADD, {cn[2]} COPY, {cn[3]} ERASE; rank mass {mass_n};',
f'parent word also replays (rank mass {mass_o})')
need(all(used_pairs.values()), 'containment'); bad = 0
for (a, b) in used_pairs:
if not contained(a, b): bad += 1
need(bad == 0, f'{bad} containments fail the rational-elimination test')
say(f' PASS all {len(used_pairs)} distinct MOVE containments of the new word re-derived by rational elimination on the bases alone')
# ---- 4. The 25 changes --------------------------------------------------
plan = load(Path(sys.argv[3])) if len(sys.argv) > 3 else None
kinds = Counter()
for i, fo, fn in changed:
need(contained(fo, fn) and D[fn] > D[fo], f'changed ADD {i}: old frame not strictly inside new frame')
kinds[D[fo], D[fn]] += 1
say('4. PASS every changed ADD frame strictly contains its old frame; (old dim, new dim) counts:', dict(kinds))
delta = Counter(Hn); delta.subtract(Ho); delta = {r: v for r, v in sorted(delta.items()) if v}
say(' local histogram delta', delta, '| multiplicity', sum(delta.values()), '| rank-weighted', sum(r * v for r, v in delta.items()))
need(mass_n == mass_o and sum(delta.values()) == -1, 'ledger delta')
if plan:
need(delta == {int(r): v for r, v in sorted(plan['expected_local_histogram_delta'].items(), key=lambda t: int(t[0]))}, 'delta differs from frozen plan')
need(len(changed) == plan['selected_gate_count'], 'changed count differs from plan')
want = sorted(json.dumps(e['new_basis'], separators=(',', ':')) for e in plan['entries'])
got = sorted(json.dumps(B[fn], separators=(',', ':')) for _, _, fn in changed)
need(want == got, 'changed bases differ from frozen plan'); say(' PASS changes equal the frozen selection (count, bases, delta)')
# ---- 5. Nondegeneracy for G = I - J/9 -----------------------------------
small = [p for p in range(2, 1000) if all(p % d for d in range(2, int(p ** .5) + 1))]
seen = {}; worst = 0; strict31 = True
for f in sorted(used):
key = json.dumps(B[f], separators=(',', ':'))
if key in seen or not B[f]: continue
s = [sum(r) for r in B[f]]
g = [[9 * dot(x, y) - s[i] * s[j] for j, y in enumerate(B[f])] for i, x in enumerate(B[f])]
d = det_q(g); need(d != 0, f'frame {f}: degenerate cleared Gram determinant')
r = abs(d); r31 = r
for p in small:
while r % p == 0: r //= p
if p <= 31:
while r31 % p == 0: r31 //= p
need(r < 2 ** 80, f'frame {f}: cofactor above 2^80 after removing primes below 1000')
strict31 &= r31 < 2 ** 80; worst = max(worst, abs(d).bit_length()); seen[key] = d
say(f'5. PASS {len(seen)} distinct used bases: cleared Gram determinant nonzero, every prime factor below 2^80',
f'(max {worst} bits; PR rule "residual after primes<=31 is <2^80" also holds: {strict31})')
# ---- 6. Normalised profile versus the native price ----------------------
native = load(L / 'COHORT-EXACT-PRICE.json')['cohort_candidate']
bank = load(RUN / 'compiler/COHORT-BANK-REVIEW.json')
H = Counter({r: 40 * v for r, v in Hn.items()})
for r in (4, 23, 46, 50): H[r] += 16 * 1760 # inherited idle/bank rows, taken as given
W = bank['literal_stock'] // 5; m = 120
need(bank['literal_stock'] % 5 == 0 and W == native['stock'], 'stock')
need(dict(H) == {int(r): v for r, v in native['histogram'].items()}, 'histogram differs from native price input')
calls = sum(H.values()); mass = sum(r * v for r, v in H.items())
say(f'6. PASS profile rebuilt from the word equals the priced histogram: W={W}, children={calls}, rank mass={mass}, deficit={m*W-mass}')
# ---- 7. Price: high-precision sanity check (not interval arithmetic) -----
getcontext().prec = 90
def moment(a):
a = Decimal(a.numerator) / Decimal(a.denominator); tot = Decimal(0)
for r, v in H.items():
tot += Decimal(r * v) / Decimal(m * W) * ((Decimal(m) / Decimal(r)).ln() * a).exp()
return tot + Decimal(32 * m * calls) / Decimal(10 ** 16 * W) * (Decimal(m).ln() * a).exp()
c = Q(native['coarse']); step = Q(1, 10 ** 18)
lo, hi = moment(c) - 1, moment(c + step) - 1
need(lo < 0 < hi, 'coarse grid point is not the last admissible one')
say(f'7. coarse={c}: moment-1 = {lo:.3E} at coarse, {hi:.3E} at coarse+1e-18 (90-digit Decimal; sign change confirmed)')
chain = [Q(384599, 10 ** 10)]
for _ in range(3): chain.append((1 - c) * c + c * chain[-1])
eta = Q(1, 10 ** 12); q = chain[-1] * (1 - 2 * eta); bound = (1 - eta) * q / (1 + q)
t = bound * 10 ** 18; kappa = Q((t.numerator - 1) // t.denominator, 10 ** 18)
need(kappa == Q(native['kappa']) == Q(71046804825911, 10 ** 17), 'kappa')
need(kappa < bound < kappa + Q(1, 10 ** 18), 'kappa grid point')
say(f' PASS exact rational chain and grid point give kappa = {kappa} (bit saving {float(chain[-1]):.12e});',
'the 47 outer inequalities are NOT rechecked here')
say('ALL INDEPENDENT CHECKS PASS')Usage: python audit258.py RUN PARENT SELECTION, where RUN is a finished verify.py --output directory, PARENT is the output of RUN/bin/cohort-transform RUN/temporal/CURRENT249-EXPORT RUN/candidates.json PARENT, and SELECTION is source/extra-retiming-selection.json. Runtime about 3 minutes.
Audit, checker and report prepared with Anthropic Claude (Claude Code) assistance. Apache-2.0, same as the repository.
|
Thank you @amanforindia. This contribution is now retained on main in the scoped 100-PR review and contributor credits. Contribution: 25 exact frame retimings composed with PR254. Review and limits: Source-bound own Linux full replay. The same moves reappear in PR260/263 and must not be counted twice in compositions. The complete original source, notices and relevant execution evidence are retained through the pinned source archive. The review distinguishes fresh local runs, source-bound historical Linux CI and prior exact-head review; it does not claim 100 fresh full mathematical audits. Closing this historical PR as reconciled. This preserves parallel and cumulative credit without replacing the selected frontier or promoting priced research targets to completed constructions. Reviewed head: |
This composes 25 explicit rational gate-frame changes with PR254's 132 response-kernel entrance gauges. Twenty-four additions replace paid children
(5,5)by(4,6); one equal-response read replaces(2,2,11,17)by(13,13,6). The complete scalar/COPY sequence, initial/final frames, bank assignments, stock and rank mass are preserved. The literal 40-replica five-stage word removes 200 recursive calls.The complete combined conditional exponent is κ =
71046804825911/100000000000000000=0.000710468048259110, compared with PR254's0.000710465200632830. The exact increase is71190657/25000000000000000, approximately2.84762628e-9(0.0004008115%). This is a fresh price of the composed word, not a sum of separately estimated gains; no current leaderboard-record claim is made.Construction and dependency
research/cohort-kernel-retiming25/is self-contained againstmain. It pins Dugongue's PR254 at9ce32efb421132420242cfdb91ddd9eabe2c3795and preserves the exact verified inner source package, including the original PR249/source527 source archive and all licenses/notices. No pending PR needs to be merged first.The new top-level verifier regenerates the original sources, executes the kernel rewrite and frozen retiming, runs all seven native checkers, and makes two independent Python moment engines rederive the same price from the final physical word and bank receipt. Both manifests are checked before and after execution. The new path-filtered workflow runs this entry point on Python 3.11 and 3.13.
Reproduction and validation
Requires Python 3.11+, SymPy 1.14.0, C++17 and Boost headers. The output directory must be new and outside the package. Replay needs no network.
--cxxand--boost-includeselect nonstandard build locations.The fresh composed replay checks all 23,627 global formal F2 columns, arbitrary dirty restoration, the unchanged local forward/inverse scalar projection, 98,443 frame pairs and both reflected ledgers, 26,610 exact used-basis Gram determinants, all 3,317,400 bank assignments and 132 new entrance charts. Exact pricing checks all 47 strict outer inequalities, seven margins and adjacent coarse/kappa grid rejection. The actual-word finite invoice includes selectors, boundaries, routing and recursive children.
git diff --checkpasses.make entrance-bank-verify: PASS, including the selected record, complete complex/bit replay, all 47 constraints and the bank-scheduling diagnostic.make verify: ran in a separate clean checkout of pinnedmainand stopped in the skip-suffix producer because Apple clang rejects-fopenmp. This is a local toolchain limitation, not a full regression PASS. The dedicated new-package checks above are complete.action_required); no CI PASS is claimed. Local C++ checks used clang C++17 with a standard-header compatibility shim and Boost 1.76; CI uses GNU g++/Boost on Ubuntu.Scope and credit
The result retains the public all-size compiler, common weighted chart, restored-row/routing, prime supply, complex recovery, symbolic correctness and analytic-reduction interfaces; these general foundations are not independently reproved. F2 payload cancellation and odd-prime address algebra are separate. Admission uses PR254's native pipeline and the added exact Python checks, not a claimed verbatim replay of the public eight-stage Python command. No unconditional multiplication theorem, practical speed benchmark or new Lean certificate is claimed.
Predecessors include eumemic's source527 construction, PR244 common-frame retiming, PR249/251 transported entrances, and Dugongue's PR254 response-kernel construction. Original source attributions and licenses are preserved. New search, composition, verification wrapper, documentation and workflow were prepared with substantial OpenAI Codex assistance. The separate five-cube larger-bank global schedule remains open and is outside this PR.