Skip to content

Bound coded R429 owner costs and alternating row sections - #4185

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
RossRichardson:research/r429-controller-accounting-20261020
Oct 21, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
RossRichardson:research/r429-controller-accounting-20261020

Conversation

@RossRichardson

@RossRichardson RossRichardson commented Oct 20, 2026 •

Copy link
Copy Markdown

Summary

Bind the coded R429 caller's local saving to its complete fixed owner allocation. Returning deleted helper capacity reduces the saving to 60 per call; the known two-N terminal bill leaves an 864-unit deficit. A separate row-section theorem explains why the nine-stage alternating caller cannot close its coded endpoint with three repaired rows per stage.

The package adds a uniform comparison for all nonnegative exponents, the strict 860-unit terminal allowance, and an exact classification of the 2,270 feasible three-row sections. See research/r429-controller-accounting/PROOF.md and EVIDENCE-INDEX.md.

Scope and limits

This is one fixed coded-controller accounting and endpoint boundary. The local 651-column VALUE identity is inherited from #3645. New checks cover every retained owner, the literal frame/COPY invoice and all changed pending ADDRESS operators. The 888 terminal and 444 gather counts price named constructions; neither is a universal lower bound. The section census uses its stated root-line/two-tier alphabet. No physical supplier, precision admission, selected-record change or new kappa is claimed.

Test plan

  • CPython 3.12 committed-byte/source-history preflight and all six registered commands.
  • Read-only Git-free export replay, with unchanged package bytes.
  • Separate AI reviews of owner accounting, section algebra/census and source/control integrity; findings resolved in the package.
  • Automatic registered-package CI passed on 86aa870336c05404855befe51bc0a5155cbc2252 (plan and package replay).

The scientific checks include 123,552 owner roles, 71,040 deadlines, 326,784 pending ADDRESS columns, all 70,626 admissible sections and 120 root lines, plus normal/optimized Python controls. Full receipts are compared with scalar types and event ordering preserved. AI reviews are distinct from human acceptance or formal proof.

Sources and credit

Retains Ali Romman/#1043, Sagar Thakrar/#2423, commdata2338/#2653 and #1307 geometry ancestry; #3645 supplies the local source-coded word. James Reed/#3672 independently recorded its local arithmetic. Exact inputs, prior notices, heads and adaptations are recorded in SOURCES.json, ORIGINS.json, RELATED-WORK.json and the frozen manifest. Original findings, further derivations and this package were prepared by Ross Richardson with substantial OpenAI Codex assistance. Apache-2.0.

@rcfc-jreed

Copy link
Copy Markdown
Contributor

Independent scoped audit of R429 owner costs at 86aa8703: no defect found in the finite accounting / section-census layer

Code-disjoint reimplementation over pinned receipts; does not import package verify.py / controls.py / review checkers. CLAIM.

What passes (45 of 45):

  1. Pins. SOURCES.base is 12fa8c5c. FROZEN-SHA256 matches HEAD for NATIVE / OWNER-REVIEW / CHECKS. no_new_kappa. New-owner physical roles 123552, factorization/owner SHAs, and idle histogram agree with NATIVE owner_audit.
  2. Net saving 60. Local masses 5121→4989 (gross 132); return 72 → net 60/call; 648 returned idle/replica (=72×9); 288×60=17280; signed Δ-profile mass −17280; NATIVE local_profile mass 4989.
  3. Terminal deficit 864. Baseline/pruned/completed masses 1808352 / 1791072 / 1819488; stock budget 28416×64=1818624; excess over stock 864; excess over old baseline 11136; two-N terminal 888×32=28416; strict zero-exponent allowance 860 (<888) finishes at 1818592≤budget.
  4. Moment comparison. (C_\Delta(0)=-17280); (C_\Delta(1)\le -17280\cdot 8) (observed −774144); completed mass >64×stock.
  5. Row sections. J has 111 zero diagonals; max 3-row×9-stage union 27 ⇒ ≥84 mismatches ⇒ ≥37 odd stages (sufficiency not claimed). Census: 70626 sections, 2270 positive, sole block mask 32 on row 80. GL₂(F₂) 127968 cases; retained rank≠diag counterexample. All-odd ledger identity holds for sampled ((B,n)).

Not covered: re-enumeration of the 70,626 sections; continuous all-α proof beyond α∈{0,1} spot-checks; arbitrary-field section theorem as formal-kernel proof; physical supplier / κ.

This is a finite replay of committed receipts, not a formal proof.

check_4185.py
#!/usr/bin/env python3
"""Independent finite controls for PR4185 (R429 owner costs / row sections).

Recomputes owner-allocation and terminal-deficit arithmetic from pinned receipts,
checks the net-saving 60 / excess-864 identities, and verifies the stated finite
row-section census counts and diagonal-mismatch consequences in CHECKS.json.
Does not import package verify.py / controls.py / check_*.py, and does not
re-enumerate the 70,626 sections.

James Reed (@rcfc-jreed), with substantial AI assistance (Claude, in Cursor).
Apache-2.0.
"""
import argparse, gzip, hashlib, json, subprocess, sys
from collections import Counter

HEAD = '86aa870336c05404855befe51bc0a5155cbc2252'
BASE = '12fa8c5c844be21bfefb38a19503fbd867a11244'
PKG = 'research/r429-controller-accounting/'
results = []


def check(name, ok, detail=''):
    results.append((name, bool(ok), detail))
    print(('PASS ' if ok else 'FAIL ') + name + ((': ' + str(detail)) if detail else ''), flush=True)
    return bool(ok)


def show(repo, path, rev=HEAD):
    return subprocess.run(['git', '-C', repo, 'show', f'{rev}:{path}'],
                          capture_output=True, check=True).stdout


def js(b):
    if b[:2] == b'\x1f\x8b':
        b = gzip.decompress(b)
    return json.loads(b)


def mass(h):
    return sum(int(r) * int(c) for r, c in h.items())


def as_int(h):
    return {int(k): int(v) for k, v in h.items()}


def load(repo):
    g = lambda p: show(repo, PKG + p)
    return dict(
        sources=js(g('SOURCES.json')),
        core=js(g('CORE-SNAPSHOT.json')),
        frozen=js(g('FROZEN-SHA256.json')),
        controls=js(g('CONTROLS.json')),
        native=js(g('NATIVE-REMAINDERS.json')),
        owner=js(g('frozen/reviews/owner/OWNER-REVIEW.json')),
        sections=js(g('frozen/reviews/sections/CHECKS.json')),
        verify=js(g('VERIFY.json')),
    )


def run(d, repo):
    o, n, s, c = d['owner'], d['native'], d['sections'], d['controls']

    # --- Pins ---
    check('I1 SOURCES base pin is canonical main', d['sources']['base_commit'] == BASE)
    check('I2 OWNER status PASS_INDEPENDENT_B02_OWNER_RETURN_AND_TWO_N_MOMENT_BOUNDARY',
          o['status'] == 'PASS_INDEPENDENT_B02_OWNER_RETURN_AND_TWO_N_MOMENT_BOUNDARY')
    check('I3 NATIVE status PASS_PRUNED_OWNER_NATIVE_REMAINDERS',
          n['status'] == 'PASS_PRUNED_OWNER_NATIVE_REMAINDERS')
    check('I4 SECTIONS status PASS_INDEPENDENT_ROW_SECTIONS_AND_ROOT_LINE_CENSUS',
          s['status'] == 'PASS_INDEPENDENT_ROW_SECTIONS_AND_ROOT_LINE_CENSUS')
    check('I5 no_new_kappa on NATIVE + CONTROLS',
          n['no_new_kappa'] is True and c['no_new_kappa'] is True)

    # Authenticate FROZEN-SHA256 entries that name review receipts.
    bad = []
    for rel in ('NATIVE-REMAINDERS.json',
                'frozen/reviews/owner/OWNER-REVIEW.json',
                'frozen/reviews/sections/CHECKS.json'):
        want = d['frozen'][rel]
        got = hashlib.sha256(show(repo, PKG + rel)).hexdigest()
        if want != got:
            bad.append((rel, want[:12], got[:12]))
    check('I6 FROZEN-SHA256 matches HEAD for NATIVE/OWNER/CHECKS', not bad, bad)

    # OWNER source pins vs frozen upstream bytes when present in package.
    for path, digest in o['sources'].items():
        if path.startswith('source/'):
            # mapped under frozen/old/recursive/
            name = path.split('/', 1)[1]
            rel = 'frozen/old/recursive/' + name
            if rel in d['frozen']:
                got = hashlib.sha256(show(repo, PKG + rel)).hexdigest()
                if got != digest and d['frozen'][rel] != digest:
                    # accept either the OWNER-declared digest or FROZEN pin
                    if got != d['frozen'][rel]:
                        bad.append(('owner_src', path, digest[:12], got[:12]))
        elif path.startswith('repo/'):
            # frozen/upstream/...
            rel = 'frozen/upstream/' + path[len('repo/'):]
            try:
                got = hashlib.sha256(show(repo, PKG + rel)).hexdigest()
                if got != digest:
                    bad.append(('repo_src', path, digest[:12], got[:12]))
            except subprocess.CalledProcessError:
                pass  # optional if path not vendored identically
    check('I7 OWNER-declared source digests match frozen package bytes where present',
          not [b for b in bad if b[0] in ('owner_src', 'repo_src')],
          [b for b in bad if b[0] in ('owner_src', 'repo_src')][:4])

    # Cross-pin new_owner ↔ NATIVE owner_audit
    check('I8 new_owner physical_roles == NATIVE physical_helpers == 123552',
          o['new_owner']['physical_roles'] == 123552
          and n['owner_audit']['physical_helpers'] == 123552)
    check('I9 new_owner factorization/owner SHA match NATIVE owner_audit',
          o['new_owner']['factorization_sha256'] == n['owner_audit']['factorization_sha256']
          and o['new_owner']['owner_sha256'] == n['owner_audit']['owner_projector_sha256'])
    check('I10 new_owner idle histogram matches NATIVE idle_per_replica',
          as_int(o['new_owner']['idle']) == as_int(n['owner_audit']['idle_per_replica_including_zero']))

    # --- Local saving arithmetic ---
    before, after = o['local_mass_before_after']
    check('L1 local masses 5121 → 4989 (gross save 132)',
          before == 5121 and after == 4989 and before - after == 132)
    # Net save 60 = 132 - 72 returned helper capacity
    check('L2 net saving per call is 60 (=132−72 returned)',
          132 - 72 == 60)
    check('L3 returned idle rank per replica is 648 (=72×9 stages)',
          o['returned_idle_rank_per_replica'] == 648 == 72 * 9)
    # 111 ports × 9 stages? README: 288 local calls; 111*...? 32 replicas?
    # Net saving across 288 calls = 17280 = 288*60
    check('L4 net saving across 288 local calls is 17280',
          288 * 60 == 17280
          and mass(as_int(o['signed_pruned_minus_baseline_profile'])) == -17280)

    # Local profile mass from NATIVE
    local_mass = mass(as_int(n['local_profile']))
    check('L5 NATIVE local_profile mass equals pruned local 4989',
          local_mass == 4989, local_mass)

    # --- Terminal / stock ---
    base_m, pruned_m, done_m = o['complete_mass_before_after_terminal']
    check('T1 complete masses baseline/pruned/completed = 1808352/1791072/1819488',
          [base_m, pruned_m, done_m] == [1808352, 1791072, 1819488])
    check('T2 profile masses match those three figures',
          mass(as_int(o['baseline_profile'])) == 1808352
          and mass(as_int(o['pruned_profile'])) == 1791072
          and mass(as_int(o['pruned_plus_two_N_profile'])) == 1819488)
    check('T3 pruned = baseline − 17280',
          1808352 - 17280 == 1791072 == pruned_m)
    check('T4 stock=28416, ambient=64, stock_rank_budget=28416×64=1818624',
          o['stock'] == 28416 and o['ambient'] == 64
          and o['stock_rank_budget'] == 28416 * 64 == 1818624)
    check('T5 excess over stock is 864 (=1819488−1818624)',
          done_m - o['stock_rank_budget'] == 864 == o['terminal_excess_over_stock_budget'])
    check('T6 excess over old baseline is 11136 (=1819488−1808352)',
          done_m - base_m == 11136 == o['terminal_excess_over_old_baseline'])
    # Two-N terminal: 888 rank-one children × 32 replicas = 28416? 
    # completed - pruned = 1819488 - 1791072 = 28416 = 888 * 32
    check('T7 two-N terminal charge: completed−pruned = 888×32 = 28416',
          done_m - pruned_m == 888 * 32 == 28416)
    check('T8 strict zero-exponent terminal allowance is 860 (<888)',
          o['zero_exponent_terminal_integer_budget_for_strict_pass'] == 860
          and 860 < 888)
    # For strict stock pass need terminal mass ≤ stock_budget - pruned = 1818624 - 1791072 = 25552
    # per replica: 25552/32 = 798.5? README says 860 rank-one units per replica.
    # 860*32 = 27520; pruned+27520 = 1791072+27520 = 1818592 ≤ 1818624 (margin 32).
    check('T9 860×32 terminal would finish at 1818592 ≤ stock budget (margin 32)',
          1791072 + 860 * 32 == 1818592 and 1818592 <= 1818624
          and 1818624 - 1818592 == 32)

    # Physical role deletion
    check('T10 old−new physical roles = 126144−123552 = 2592',
          o['old_owner']['physical_roles'] - o['new_owner']['physical_roles'] == 2592)

    # Uniform prefix comparison string presence (finite claim recorded)
    check('T11 uniform_prefix_comparison claims ≤ −17280·8^α for all α≥0',
          '17280' in o['uniform_prefix_comparison'] and '8^alpha' in o['uniform_prefix_comparison'].replace(' ', ''))

    # Spot-check α=0 and α=1 on the signed delta histogram
    delta = as_int(o['signed_pruned_minus_baseline_profile'])
    c0 = sum(r * cnt for r, cnt in delta.items())  # α=0: sum r*ΔH[r] ... wait C uses H[r]*r*(64/r)^α
    # C_delta(α) = sum ΔH[r] * r * (64/r)^α = sum ΔH[r] * r^{1-α} * 64^α
    def c_delta(alpha):
        total = 0
        for r, cnt in delta.items():
            total += cnt * r * ((64 / r) ** alpha)
        return total
    check('T12 C_delta(0) == −17280', abs(c_delta(0) + 17280) < 1e-9, c_delta(0))
    # Bound is ≤ −17280·8^α (at-least saving); α=1 is strict, not equality.
    check('T13 C_delta(1) ≤ −17280·8 (= −138240)',
          c_delta(1) <= -17280 * 8, c_delta(1))
    check('T14 C_completed(0) = 1819488 > 64*28416',
          done_m == 1819488 and done_m > 64 * 28416)

    # --- Row-section finite consequences ---
    cons = s['nine_three_row_stage_consequences']
    sc = s['scalar_matrices']
    check('S1 J has 111 zero diagonal entries; rank_J=108, rank_K=rank_R=9',
          sc['zero_diagonal_entries_J'] == 111
          and sc['rank_J'] == 108 and sc['rank_K'] == 9 and sc['rank_R'] == 9)
    check('S2 nine stages × ≤3 repaired rows ⇒ max union 27, min mismatches 84',
          cons['maximum_repair_union'] == 27 == 9 * 3
          and cons['minimum_diagonal_mismatches'] == 84 == 111 - 27)
    check('S3 necessary odd-stage count at 3 rows/stage is 37; sufficiency not claimed',
          cons['necessary_odd_stage_count_at_three_rows_per_stage'] == 37
          and cons['stage_count_sufficiency_claimed'] is False)
    check('S4 defect rank bounds [9,36]; common-reader conditional rank 9',
          cons['defect_rank_lower'] == 9 and cons['defect_rank_upper'] == 36
          and cons['conditional_common_reader_defect_rank'] == 9)

    rc = s['root_line_census']
    check('S5 root-line census: 70626 sections, 2270 positive, 120 candidate lines',
          rc['sections'] == 70626 and rc['positive_count'] == 2270
          and rc['candidate_return_lines'] == 120)
    check('S6 eligible direction rank histogram is all-rank-3 on 70626 sections',
          as_int(rc['eligible_direction_rank_histogram']) == {3: 70626})
    ex = rc['explicit_singleton']
    check('S7 sole positive block is mask 32 requiring deleted row 80, selected [1,2,80]',
          ex['block_mask'] == 32 and ex['required_deleted_row'] == 80
          and ex['selected'] == [1, 2, 80])

    th = s['theorem_finite_checks']
    check('S8 theorem finite checks: 127968 GL2_F2 cases; singular inverse rejected',
          th['GL2_F2_cases'] == 127968
          and th['premise_controls']['singular_inverse_rejected'] is True)
    check('S9 rank counterexample retained (diag mismatches ≠ rank lower bound)',
          th['rank_counterexample']['defect_rank'] == 1
          and th['rank_counterexample']['diagonal_mismatches'] == 2
          and th['rank_counterexample']['stages'] == 9)

    # All-odd ledger identity: (L-1)n - 3L - 2Bn = -3L for L=2B+1
    # Spot-check a few B
    odd_ok = True
    for B in range(0, 20):
        L = 2 * B + 1
        for n in (111, 32, 9, 1):
            lhs = (L - 1) * n - 3 * L - 2 * B * n
            if lhs != -3 * L:
                odd_ok = False
    check('S10 all-odd ledger identity (L−1)n−3L−2Bn=−3L for L=2B+1', odd_ok)
    check('S11 OWNER records 2048 all_odd_identity_sanity_cases',
          o['all_odd_identity_sanity_cases'] == 2048)

    # --- CONTROLS ---
    check('C1 CONTROLS status present and no_new_kappa',
          c['no_new_kappa'] is True and 'PASS' in str(c.get('status', '')))

    # --- Negative controls ---
    check('NEG1 claiming net save 132 (ignoring 72 return) contradicts 60',
          132 != 60)
    check('NEG2 terminal 888×32 finishes above stock (864 excess)',
          1791072 + 888 * 32 - 1818624 == 864)
    check('NEG3 max repair union 26 would leave mismatches 85≠84',
          111 - 26 != 84)

    failed = [name for name, ok, _ in results if not ok]
    print(f'\n{len(results) - len(failed)}/{len(results)} PASS', flush=True)
    if failed:
        print('FAILED:', ', '.join(failed), flush=True)
        return 1
    return 0


def main():
    ap = argparse.ArgumentParser()
    ap.add_argument('--repo', required=True)
    args = ap.parse_args()
    head = subprocess.run(['git', '-C', args.repo, 'rev-parse', 'HEAD'],
                          capture_output=True, text=True, check=True).stdout.strip()
    check('HEAD is PR4185 tip 86aa8703…', head == HEAD, head)
    return run(load(args.repo), args.repo)


if __name__ == '__main__':
    sys.exit(main())

James Reed (@rcfc-jreed), with substantial AI assistance (Claude, in Cursor).

@Mister-Meeseeks
Mister-Meeseeks merged commit e51227b into CrocSwap:main Oct 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants