Skip to content

Tighten the conditional selected BIT parent-stock bound - #2120

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/selected-bit-ceiling-free-stock
Oct 15, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/selected-bit-ceiling-free-stock

Conversation

@petalas

@petalas petalas commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Add research/selected-bit-ceiling-free-stock/, a conditional all-width stock-bound refinement for the selected ordinary BIT producer. No new kappa, supplier admission or frontier change.

The sufficient bound changes as follows, not the production invoice:

- parent-stock coefficient sigma = 8194; ceil(log2(8*sigma)) = 17
+ parent-stock coefficient sigma = 6748; ceil(log2(8*sigma)) = 16

The exact certificate 2^17*42^28 < 64^28, together with the active-node threshold 64, gives a ceiling-free depth envelope D(n) <= (28/17)*log2(max(1,n)). Charging the whole GL64 packet, including its high fibers and nine work roles, gives log_q S(n,w) <= 6748*w*log2(max(1,n)). For borrowing, stock is chosen from original width e before choosing k. The new coefficient is exactly 14/17 of the predecessor's sufficient bound.

This follows the revision-4 selected-stock-envelope card, refined after live overlap. The ordinary producer is BIT m=64/rank42; the separate complex m=73 supplier only constrains the shared exponent. Production row coefficient 18355, cutoffs and selected exponent remain unchanged.

Scientific base: 0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2. Contribution: 378593574261e0b0915e7e8a83147aa640274fc8. Claim and finding.

Evidence

The before bound is Adam Gall's conditional PR2084 at 8001a23b003bec5dff5e61edec907b652c475932. Its packet/completed-leaf argument is credited. Sricharan Vagvala's PR2105 at 0aca64e29d43533743bb912ac8b77b434e04b84a treats the distinct complex depth envelope and informed the inverse-threshold cross-check. Neither predecessor verifier is imported or executed.

After refinement, standard-library CPython 3.12.15 registered normal/optimized replays pass:

python3.12 scripts/research_package.py --package research/selected-bit-ceiling-free-stock

Observed output includes:

PASS_SELECTED_BIT_CEILING_FREE_STOCK sigma=6748 predecessor=8194 ratio=14/17 widths=100001 ell=16 no_new_kappa
Ran 10 tests
OK
PASS_REGISTERED_RESEARCH_PACKAGE research/selected-bit-ceiling-free-stock outcome=completed

Coverage includes separate forward/all-child checks for all widths 0..100000, 196 threshold boundaries, 15 power probes up to 4097-bit atom counts, literal fixtures and optimized public-CLI source/receipt rejection controls. Source archives and the consumed assembler member are authenticated before use. Missing or corrupt results fail without regeneration. The universal conclusion rests on the written proof, not the finite fixtures.

Also passed: all 65 test_research_*.py workflow tests, make selected-record-check, syntax compilation, warnings-as-errors, metadata/pins and staged diff checks. Exact commands, source pins, scope, environment and open next questions are included. Canonical main remained unchanged at the submission checkpoint. Final overlap covered 380 open PRs and 779 discussion records with complete pagination and no warnings; relevant predecessor heads were unchanged. Metadata coverage is not a novelty guarantee.

Credit also remains with Josie Elliston/PR1956 and PR1965, ToikY/PR1990, DreamingOfClouds/PR589, eumemic, Rohan Arun/PR185, PR387 and PR1094, and Jeremy Kothe/PR1087.

Merge danger

This is reversible and limited to a new opt-in research package. Frozen evidence, shared scientific inputs and the selected frontier are untouched.

The GL64 packet/compiler realization, fresh-field preservation and internally completed ordinary-leaf interface remain assumptions. Only the native first-stage fit comparison is checked. No full cold replay, physical/native admission, precision/tape discharge, formal-kernel proof, independent human review or hosted-CI success is claimed. The next useful work is a source-bound all-size parent/child field split and a realized completed-leaf borrowing contract.

@rcfc-jreed

Copy link
Copy Markdown
Contributor

Independent check: #2120 depth envelope (σ 8194 → 6748). No defect found; one sensitivity to note

Status: independent, code-disjoint corroboration of the conditional coefficient refinement at head 378593574261e0b0915e7e8a83147aa640274fc8 (scientific base 0fdd7d82). This is not a formal proof and not a replay of this PR's verifier. I did not import or run the #2120 or #2084 verifiers. The work was claimed in #1166.

What I checked

A standard-library script (below) reads the source facts the envelope consumes directly from canonical main 0fdd7d82. It authenticates each file by recomputing git blob ids, so a changed input is rejected.

  • Hypothesis sources (inherited from Prove a conditional GL64 parent-stock envelope for the selected BIT bootstrap #2084), traced to source:
    • The selected PR589 nine-stage profile (research/e8-bit-p111-tuned/tune/EXPECTED.json, blob e293ddc5) has child ranks {1..7, 42}. The maximum rank is exactly 42, carried by 288 children.
    • The selected assembler (upstream1087.tar.gz → code/assemble.py) sets BIT_M=1+7*BIT_L=64, asserts BIT_M==64, and pins that same EXPECTED.json blob.
    • notes/three-stage-cover-bit.tex writes the recursion with r\lfloor n/m\rfloor children and peels fewer than m leftover atoms. There is no \lceil n/m.
  • Certificate arithmetic:
    • 2^17·42^28 < 64^28 holds with a log₂ slack of 0.015112 bits.
    • 4097·28 = 17·6748 holds exactly.
    • ⌈log₂(8·6748)⌉ = 16 and ⌈log₂(8·8194)⌉ = 17.
  • Envelope via exact inverse thresholds: b_1 = 64 and b_{d+1} = 64·⌈b_d/42⌉, where b_d is the smallest n admitting d active levels.
    • All d: b_{d+1} ≥ (64/42)·b_d gives 28·log₂ b_d ≥ 168 + 17.0151·(d−1) ≥ 17d, which is D(n) ≤ (28/17)·log₂ n.
    • Finite corroboration:
      • b_d^28 ≥ 2^(17d) holds exactly for d = 1..4000 (n up to about 2^2437).
      • Brute-force depth agrees with the thresholds and with 2^(17·D(n)) ≤ n^28 for n = 0..300000.

Sensitivity worth recording: zero rank headroom

The 28/17 certificate admits r ≤ 42 only, while #2084's two-level halving argument (2r² < 64²) admits r ≤ 45. Two controls show where it would break:

  • A rank-43 child class: the 28/17 envelope fails at depth 187, near n ≈ 2^113. σ = 8194 would still hold.
  • Ceil padding (42·⌈n/64⌉): depth is unbounded at n = 65.

So σ = 6748 is correct for the selected supplier as written. However, any later change that introduces a child of rank ≥ 43, or rounds child sizes up, would silently revert the valid coefficient to 8194. This includes rerouting rank-42 residuals, e.g. #2160, and downstream users of 6748 such as #2547. It may be worth stating r ≤ 42 and floor children as an explicit guard alongside the coefficient.

Reproduce

python3 -B check_2120_depth.py /path/to/checkout-at-0fdd7d82 prints PASS_PR2120_DEPTH_ENVELOPE_INDEPENDENT_AUDIT (16 checks; Python 3.14.4, about 1 s).

check_2120_depth.py
#!/usr/bin/env python3
"""Independent scoped audit of PR2120's depth envelope (sigma 8194 -> 6748).

Code-disjoint from PR2120/PR2084 verifiers (neither is imported or run).
Standard library only. Usage: python3 check_2120_depth.py /path/to/integer-mult-bounds-checkout

Checks, in order:
  A. Source facts the envelope consumes, read from blob-pinned files of canonical main
     0fdd7d82 (pins are recomputed git blob ids, so a changed file is rejected):
       - selected PR589 nine-stage profile: child ranks and their maximum;
       - BIT_M of the selected assembler (PR1094 upstream1087 archive, code/assemble.py);
       - written stopped recursion: children r*floor(n/m), fewer than m leftover atoms peeled.
  B. Exact arithmetic of PR2120's certificate and coefficient.
  C. Exact worst-path inverse thresholds b_d (smallest n admitting d active levels) and
     the envelope D(n) <= (28/17) log2 n, checked as b_d^28 >= 2^(17 d); brute-force D(n)
     agreement for small n.
  D. Sensitivity controls: rank 43 and ceil padding (each must break the envelope).
Finite checks corroborate; the all-n statement rests on the one-line induction in C.
"""
import bisect, hashlib, io, json, math, re, sys, tarfile
from pathlib import Path

ROOT = Path(sys.argv[1] if len(sys.argv) > 1 else '.').resolve()
PINS = {
    'research/e8-bit-p111-tuned/tune/EXPECTED.json': 'e293ddc557742637f9f679f083a1a282d87b1b13',
    'notes/three-stage-cover-bit.tex': 'f05225d21f92cf8cef21b6e12601d5b4d61991f0',
    'research/complex-t16-rare-pattern-exchanges/upstream1087.tar.gz': '2970ef79b0441e937449bed30f68f2e0558186ba',
}
results, failures = {}, []


def check(name, ok, detail=''):
    results[name] = dict(ok=bool(ok), detail=detail)
    print(('PASS ' if ok else 'FAIL ') + name + (': ' + detail if detail else ''))
    if not ok:
        failures.append(name)


def pinned(rel):
    data = (ROOT / rel).read_bytes()
    blob = hashlib.sha1(b'blob %d\0' % len(data) + data).hexdigest()
    if blob != PINS[rel]:
        raise SystemExit(f'pin mismatch for {rel}: {blob} != {PINS[rel]}')
    return data


# A. source facts -----------------------------------------------------------------------
expected = json.loads(pinned('research/e8-bit-p111-tuned/tune/EXPECTED.json'))
profile = {int(k): v for k, v in expected['nine']['profile'].items()}
check('A1 selected nine-stage profile ranks', sorted(profile) == [1, 2, 3, 4, 5, 6, 7, 42],
      f'ranks={sorted(profile)}')
check('A2 maximum child rank is 42', max(profile) == 42, f'count of rank-42 children={profile[42]}')

archive = tarfile.open(fileobj=io.BytesIO(pinned('research/complex-t16-rare-pattern-exchanges/upstream1087.tar.gz')))
members = [m for m in archive.getmembers() if m.name.endswith('code/assemble.py')]
assemble = archive.extractfile(members[0]).read().decode() if len(members) == 1 else ''
params = re.search(r'BIT_L,BIT_T=(\d+),(\d+);BIT_K=\(BIT_L-1\)//2;BIT_M=1\+7\*BIT_L', assemble)
bit_l = int(params.group(1)) if params else None
check('A3 selected assembler sets BIT_M = 1+7*BIT_L = 64 and asserts it',
      params is not None and 1 + 7 * bit_l == 64 and 'assert BIT_M==64' in assemble,
      f'BIT_L={bit_l}, BIT_T={params.group(2) if params else None}')
check('A6 the assembler pins the same PR589 EXPECTED.json blob read in A1/A2',
      f"BIT_BLOB='{PINS['research/e8-bit-p111-tuned/tune/EXPECTED.json']}'" in assemble)
M = 64

tex = pinned('notes/three-stage-cover-bit.tex').decode()
check('A4 written recursion uses r*floor(n/m) children',
      r'T(r\lfloor n/m\rfloor,w)' in tex and r'\lceil n/m' not in tex)
check('A5 fewer than m leftover atoms are peeled to the weighted leaf algorithm',
      'Peeling fewer than $m$ leftover atoms uses the weighted leaf algorithm.' in tex)

# B. certificate arithmetic --------------------------------------------------------------
R = max(profile)
check('B1 2^17*42^28 < 64^28', 2**17 * R**28 < M**28,
      f'log2 slack = {28*math.log2(M) - 17 - 28*math.log2(R):.6f} bits')
check('B2 sigma = 4097*28/17 = 6748 exactly', 4097 * 28 == 17 * 6748)
check('B3 ceil(log2(8*6748)) = 16 and ceil(log2(8*8194)) = 17',
      (8 * 6748 - 1).bit_length() == 16 and (8 * 8194 - 1).bit_length() == 17)
largest_r_cert = max(r for r in range(1, M) if 2**17 * r**28 < M**28)
largest_r_halving = max(r for r in range(1, M) if 2 * r * r < M * M)
check('B4 rank headroom: 28/17 certificate admits r <= 42 only; predecessor halving admits r <= 45',
      largest_r_cert == 42 and largest_r_halving == 45,
      f'cert max r={largest_r_cert}, halving max r={largest_r_halving}')


# C. exact inverse thresholds --------------------------------------------------------------
def thresholds(r, levels):
    """b[d] = smallest n with an active path of d nodes (active iff n >= M)."""
    b = [None, M]
    for _ in range(levels - 1):
        # need child r*floor(n/M) >= b_d  <=>  floor(n/M) >= ceil(b_d/r)
        b.append(M * -(-b[-1] // r))
    return b


def depth(n, r, ceil_children=False, cap=10**6):
    d = 0
    while n >= M:
        child = r * (-(-n // M) if ceil_children else n // M)
        d += 1
        if child >= n or d > cap:
            return math.inf
        n = child
    return d


LEVELS = 4000
b = thresholds(R, LEVELS)
ok = all(b[d] ** 28 >= 2 ** (17 * d) for d in range(1, LEVELS + 1))
slack = min(28 * math.log2(b[d]) - 17 * d for d in range(1, LEVELS + 1))
check('C1 b_d^28 >= 2^(17d) for d = 1..%d (n up to 2^%d)' % (LEVELS, b[LEVELS].bit_length() - 1), ok,
      f'min slack 28*log2(b_d)-17d = {slack:.3f}')
check('C2 b_(d+1) >= (64/42) b_d (induction step used for all d)',
      all(42 * b[d + 1] >= 64 * b[d] for d in range(1, LEVELS)))
small = range(0, 300001)
check('C3 brute-force D(n) <= (28/17) log2 max(1,n), exactly 2^(17 D(n)) <= n^28, for n = 0..300000',
      all(2 ** (17 * depth(n, R)) <= max(1, n) ** 28 for n in small))
check('C4 inverse thresholds agree with brute-force depth for n = 0..300000',
      all(depth(n, R) == bisect.bisect_right(b, n, 1) - 1 for n in small))

# D. sensitivity controls -------------------------------------------------------------------
b43 = thresholds(43, 400)
first_fail = next((d for d in range(1, 401) if b43[d] ** 28 < 2 ** (17 * d)), None)
check('D1 control: a single rank-43 child class breaks the 28/17 envelope',
      first_fail is not None and 2**17 * 43**28 > M**28,
      f'first violating depth d={first_fail}, at n=b_d={b43[first_fail] if first_fail else None} (~2^{b43[first_fail].bit_length()-1 if first_fail else 0})')
check('D2 control: ceil padding (42*ceil(n/64)) gives unbounded depth at n=65',
      depth(65, 42, ceil_children=True) == math.inf and depth(65, 42) == 1)

status = 'PASS_PR2120_DEPTH_ENVELOPE_INDEPENDENT_AUDIT' if not failures else 'FAIL_' + ','.join(failures)
print(status)
sys.exit(0 if not failures else 1)

Credit: Adam Gall / #2084 for the conditional implication and its hypotheses, and Nick Petalas / #2120 for the refinement under audit.

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

@rcfc-jreed

Copy link
Copy Markdown
Contributor

Follow-up to my rank-headroom note above: none of the three open PRs that touch the rank-42 child interface introduces a child above 42·⌊n/64⌋ or any rounding up. So the zero-headroom 28/17 envelope is not broken by work currently in flight.

PR @ head What it does to the rank-42 residual Child sizes it emits
#2160 @ 3ad4f746 Lowers the first unhosted rank-42 residual to one contiguous weighted child Exactly one child of 42f atoms for n = 64f (receipt: 42, 84, 126 for f = 1, 2, 3). Adapters are ADDs, not children.
#2188 @ 77bb4e8c Fallback (nongeneric) diagonal-pair descriptor after a good rank-42 ancestor Pair children of width 1f or 3f. Its tested path 6400 → 4200 → 65 → 42 has every child ≤ 42·⌊parent/64⌋, with the 40- and 1-atom remainders peeled.
#2501 @ 52a995b9 Complete residual traces with serialized leaf children Every child is required to be below 64 atoms, and leaves run as atom swaps, ADDs and signs. Larger recursive children are explicitly left open.

For any future lowering, the condition remains: maximum child rank ≤ 42 with floor sizing, and leaves below 64 handled by completed ordinary operations. #2501's open question 1, replacing the below-64 child guard with recursive invocations, is where this should be re-checked.

Scope:

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

@Mister-Meeseeks
Mister-Meeseeks merged commit bd0f966 into CrocSwap:main Oct 15, 2026
55 of 61 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