Skip to content

Prove the uniform query floor for the shared dirty BIT pair - #4179

Open
RossRichardson wants to merge 1 commit into
CrocSwap:mainfrom
RossRichardson:research/bit-joint-dirty-20261019T2104Z
Open

RossRichardson wants to merge 1 commit into
CrocSwap:mainfrom
RossRichardson:research/bit-joint-dirty-20261019T2104Z

Conversation

@RossRichardson

Copy link
Copy Markdown

Summary

Follow-up to #4068: jointly mixing the independent inputs of helpers413/444 cannot reduce the fixed pair's stipulated query tariff below 2 Phi_m(2), for 0 <= b <= 1, in the uniform unary-query model. The two original rank-two calls attain this bound even when scalar mixing and finite restored dirty or clean workspace are free.

The package supplies the written proof, an independent source binding, finite algebra controls, reviewed implementation, and explicit packing proposals with their missing costs. Proof · Scope and reproduction.

Scope and limits

Fixed finite rational address maps, the same word for all sufficiently large odd address primes, one VALUE stream per query, address-independent scalar mixing, and the complete endpoint before the same injective suffix. The proof includes clean ancillary columns; it does not use a fixed-field representation as a faithful group algebra.

Changed downstream compensation, modulus-dependent words, and newly priced tagged/packed primitives remain open. Query pricing is stipulated; no native supplier, formal-kernel proof, changed selected record or new kappa is claimed.

Test plan

  • Registered Python3.12 replay, normal and optimized:660 source columns, local retiming/inverse,32768 finite Sylvester controls and fixed-field representation controls.
  • All17 committed package files match the Git-free export; read-only normal/optimized replay passes with TMPDIR unset and unchanged bytes.
  • Source-byte corruption and a Boolean-to-integer receipt mutation are rejected for the expected reasons.
  • Clean merge-tree check against canonical 12fa8c5c844be21bfefb38a19503fbd867a11244; current task card unchanged at priority revision7.

Hosted CI is separate from these local checks.

Sources and credit

Pins PR4068 at 5a34918402ae2c0c683d8820ad832970e77f6382, retaining Ali Romman's, Sagar Thakrar's and the credited controller/hosting lineage. Jose Manuel's PR2108 and earlier group-algebra/cut bounds are antecedents, not claimed new here. Full attribution and overlap limits are in SOURCE-NOTES.md.

Ross Richardson, with substantial OpenAI Codex assistance and separate AI proof/source reviews. Apache-2.0; no independent human certification.

@rcfc-jreed

Copy link
Copy Markdown
Contributor

Independent finite-control audit of the joint dirty-pair floor at de9deae2: no defect found

Code-disjoint re-enumeration; does not import package check.py / verify.py. CLAIM.

Result (7/7): All 12 F_p address-permutation defect cases match; odd-prime gaps (q-2)/(2q²)>0 with char-2 gap 0; complete 32768 Sylvester pairs obey rank_UV ≥ rank_U+rank_V−3 with zero products when both ranks ≥ 2 (19404 such pairs); four-column UV=0 boundary control holds. Written tariff-reduction notes and 660-column source marker check out. The written all-parameter 2Φ_m(2) proof is not re-derived.

check_4179.py
#!/usr/bin/env python3
"""Independent finite controls for PR4179 (joint dirty-pair query floor).

Re-enumerates the F_p address-permutation defect cases and the complete
3x3/3x2 F2 Sylvester census. Does not import package check.py / verify.py.
The written all-parameter tariff proof is not re-derived.

James Reed (@rcfc-jreed), with substantial AI assistance (Claude, in Cursor).
Apache-2.0.
"""
import argparse, itertools, json, subprocess, sys
from fractions import Fraction as Q

HEAD = 'de9deae2b787'  # may need full; will resolve
PKG = 'research/bit-joint-dirty-pair/'
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 binary_rank(rows):
    pivots = {}
    for row in rows:
        while row:
            p = row.bit_length() - 1
            if p in pivots:
                row ^= pivots[p]
            else:
                pivots[p] = row
                break
    return len(pivots)


def multiply(a, b):
    out = []
    for row in a:
        value = 0
        for j, selected in enumerate(b):
            if row >> j & 1:
                value ^= selected
        out.append(value)
    return tuple(out)


def defect_cases():
    out = []
    for prime, half in ((3, 1), (3, 2), (3, 3), (5, 2)):
        dim = 2 * half
        addresses = list(itertools.product(range(prime), repeat=dim))
        index = {v: i for i, v in enumerate(addresses)}
        size = len(addresses)
        for rank in range(half + 1):
            action = []
            for point in addresses:
                moved = list(point)
                for i in range(rank):
                    moved[i], moved[half + i] = moved[half + i], moved[i]
                action.append(index[tuple(moved)])
            fixed = sum(i == j for i, j in enumerate(action))
            measured = binary_rank((1 << i) ^ (1 << j) for i, j in enumerate(action))
            predicted_fixed = prime ** (dim - rank)
            predicted_defect = (size - predicted_fixed) // 2
            assert fixed == predicted_fixed and measured == predicted_defect
            out.append(dict(prime=prime, address_dimension=dim, query_rank=rank,
                            fixed_addresses=fixed, boolean_defect_rank=measured))
    return out


def sylvester():
    cases = both = zero = 0
    for u in itertools.product(range(8), repeat=3):
        ru = binary_rank(u)
        for v in itertools.product(range(4), repeat=3):
            cases += 1
            rv = binary_rank(v)
            ruv = binary_rank(multiply(u, v))
            assert ruv >= ru + rv - 3
            if ru >= 2 and rv >= 2:
                both += 1
                zero += ruv == 0
    return cases, both, zero


def run(repo):
    head = subprocess.check_output(['git', '-C', repo, 'rev-parse', 'pr4179'], text=True).strip()
    global HEAD
    HEAD = head
    result = json.loads(subprocess.check_output(
        ['git', '-C', repo, 'show', f'{head}:{PKG}RESULT.json']))
    check('I1 RESULT scopes no_new_kappa and PASS finite controls',
          result['finite_controls']['no_new_kappa'] is True
          and result['finite_controls']['status'] == 'PASS_FINITE_JOINT_QUERY_CONTROLS'
          and result['source']['no_new_kappa'] is True)

    mine = defect_cases()
    theirs = result['finite_controls']['defect_rank']['actual_permutation_cases']
    check('D1 defect-rank cases match independent F_p enumeration (12 cases)',
          mine == theirs, f'mine={len(mine)} theirs={len(theirs)}')

    gaps = result['finite_controls']['defect_rank']['normalized_target_minus_relaxed_rank1_plus_any_rank']
    check('D2 strict positive gaps for odd primes 3,5,7,11; char-2 gap is 0',
          all(Q(gaps[str(q)]) > 0 for q in (3, 5, 7, 11))
          and Q(2 - 2, 2 * 2 * 2) == 0
          and gaps == {str(q): str(Q(q - 2, 2 * q * q)) for q in (3, 5, 7, 11)})

    cases, both, zero = sylvester()
    obst = result['finite_controls']['odd_call_rank_obstruction']
    check('S1 complete 32768 Sylvester pairs; zero products when both ranks ≥ 2',
          cases == 32768 == obst['complete_matrix_pairs']
          and zero == 0 == obst['zero_products_in_that_class']
          and both == obst['pairs_with_both_ranks_at_least_two'],
          f'cases={cases} both={both} zero={zero}')

    # four-column positive control
    u4 = (0b0101, 0b1010)
    v4 = (0b01, 0b10, 0b01, 0b10)
    check('S2 four-column boundary allows UV=0 with both ranks 2',
          binary_rank(u4) == binary_rank(v4) == 2 and multiply(u4, v4) == (0, 0)
          and obst['four_columns_allow_zero_product_with_two_directions'] is True)

    # written tariff reduction arithmetic
    w = result['finite_controls']['written_tariff_reduction']
    check('T1 written tariff reduction notes two-query / three-query / four+ cases',
          '2' in w['two_queries'] and '2+x' in w['three_queries'] and '4' in w['four_or_more_queries'])

    # source pin facts that are numeric
    src = result['source']
    check('W1 source word has 660 ordinary independent columns; query profile present',
          src['ordinary_independent_input_columns'] == 660
          and isinstance(src['query_rank_profile'], dict))


def main():
    ap = argparse.ArgumentParser()
    ap.add_argument('--repo', required=True)
    a = ap.parse_args()
    run(a.repo)
    ok = all(r[1] for r in results)
    print(('PASS' if ok else 'FAIL'), f'{sum(r[1] for r in results)}/{len(results)} checks', flush=True)
    sys.exit(0 if ok else 1)


if __name__ == '__main__':
    main()

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

@rcfc-jreed

Copy link
Copy Markdown
Contributor

Independent scoped audit of #4179 joint dirty BIT pair query floor at de9deae2: 12/12

Code-disjoint checks; package-local verify.py / check.py / source_check.py in clean worktrees. Head de9deae2b787143923c0a504fbcc3871d01cff0b. TASK outcome is negative-result. CLAIM.

No packaging defect in SOURCES / MANIFEST scope. Both SOURCES digests match; 16 MANIFEST digests match.

What passes: verify.py prints PASS_JOINT_DIRTY_PAIR … no_new_kappa; check.py and source_check.py also PASS.

Not covered here: Lean; new κ; merge/close.

Finite pin/seal/control replay ≠ formal proof.

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

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.

2 participants