Repository navigation
Tighten the conditional selected BIT parent-stock bound - #2120
Mister-Meeseeks merged 1 commit into
Conversation
Independent check: #2120 depth envelope (σ 8194 → 6748). No defect found; one sensitivity to noteStatus: independent, code-disjoint corroboration of the conditional coefficient refinement at head What I checkedA standard-library script (below) reads the source facts the envelope consumes directly from canonical main
Sensitivity worth recording: zero rank headroomThe 28/17 certificate admits r ≤ 42 only, while #2084's two-level halving argument (
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
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). |
|
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
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). |
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:
The exact certificate
2^17*42^28 < 64^28, together with the active-node threshold 64, gives a ceiling-free depth envelopeD(n) <= (28/17)*log2(max(1,n)). Charging the whole GL64 packet, including its high fibers and nine work roles, giveslog_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-envelopecard, 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 at0aca64e29d43533743bb912ac8b77b434e04b84atreats 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:
Observed output includes:
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_*.pyworkflow 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.