Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/cascade-frames-bit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Verify cascade-optimized bit frames
on:
pull_request:
paths:
- 'research/cascade-frames-bit/**'
- 'research/source-assisted-v4/**'
- 'research/source-assisted/**'
- 'scripts/paired_cube_assembly.py'
- '.github/workflows/cascade-frames-bit.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
full:
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
repository: CrocSwap/integer-mult-bounds
ref: a1175449f34d39ff933d9d8ab23ced1f32b290ec
path: .dependencies/pr200
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
repository: CrocSwap/integer-mult-bounds
ref: 187e1010ac8b259af8e9b5166f68b64bc27b4b47
path: .dependencies/pr193
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
with:
python-version: '3.13'
- run: python -m pip install -r .dependencies/pr193/research/source-assisted/requirements-round13.txt
- run: python -B research/cascade-frames-bit/verify.py --complex-root .dependencies/pr193 --bit-root .dependencies/pr200 --full
- run: git diff --exit-code
38 changes: 38 additions & 0 deletions .github/workflows/packed-diagonal-bit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Verify packed diagonal bit supplier
on:
pull_request:
paths:
- 'research/packed-diagonal-bit/**'
- 'research/source-assisted-v4/**'
- 'research/source-assisted/**'
- 'scripts/paired_cube_assembly.py'
- '.github/workflows/packed-source-assisted-bit.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
full:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
repository: CrocSwap/integer-mult-bounds
ref: a1175449f34d39ff933d9d8ab23ced1f32b290ec
path: .dependencies/pr200
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
repository: CrocSwap/integer-mult-bounds
ref: 187e1010ac8b259af8e9b5166f68b64bc27b4b47
path: .dependencies/pr193
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
with:
python-version: '3.13'
- run: python -m pip install -r .dependencies/pr193/research/source-assisted/requirements-round13.txt
- run: python -B research/packed-diagonal-bit/verify.py --complex-root .dependencies/pr193 --bit-root .dependencies/pr200 --full
- run: git diff --exit-code
18 changes: 18 additions & 0 deletions research/cascade-frames-bit/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Packed diagonal bit supplier. Apache-2.0.
Prepared by Rohan Arun (rohanarun) with Anthropic Claude assistance.

Reused, with credit:
- Evan McKinney, PR197 (OpenAI Codex assistance): completed-bank packing, exact
gauge charts, nine-colour bank incidence, routing bound, arithmetic, audit
and endpoint controls. banks.py and controls.py are byte-identical extracts;
packing.py, arithmetic.py, audit.py and verify.py are adaptations to PR200.
- Chafik Boukhalfa, PR200 at a1175449f34d39ff933d9d8ab23ced1f32b290ec (Anthropic
Claude and OpenAI Codex assistance): the fixed-coordinate/face-diagonal bit
word, physical layer, terminal sinks, prime witnesses and package verifier.
- Avi Eisenberg, PR193 at 187e1010ac8b259af8e9b5166f68b64bc27b4b47: the v4
source-assisted complex supplier and balanced assembly bridge; icekylinx for
the source-assisted method (PR184) and the paired-cube framework (PR144).
- maxime-fleury, PR204: the model of this lever and its predicted value.
- eumemic (PR168 lineage), jamesyc (PR166 terminal lemma), PR185/187 finite
ordinary-leaf composition, and every contributor credited by those packages.
Original notices remain in the pinned checkouts.
62 changes: 62 additions & 0 deletions research/cascade-frames-bit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Cascade-optimized frames on PR200's banked bit word

Under the retained multiplication interfaces, this finite witness certifies

$$
T(n)=O\left(n(\log n)^{1-\kappa}\right),\qquad
\kappa=\frac{683847872495777}{10^{18}}=0.000683847872495777 .
$$

That is **+0.0962%** over PR207 (`1366380910073/(2*10^15)` = 0.0006831904550365) and **+0.1152%** over PR205 (0.000683061299399923). The bit supplier still binds; PR193's complex saving `700918443859411/10^18` is unchanged.

| Construction | Unpacked bit coarse | Packed bit coarse | Conditional kappa |
|---|---:|---:|---:|
| PR205: PR200 word + completed banks | 6.77774e-4 | 6.835282e-4 | 0.000683061299399923 |
| PR207: 302 coordinated frames + banks | | | 0.0006831904550365 |
| **This: 6,191 cascade-optimized frames + banks** | **6.785484e-4** | **6.843158e-4** | **0.000683847872495777** |

## What is new

PR207 showed that PR200's operation frames are not optimal for the paid moment and admitted 302 rational frame changes. This package pushes the same lever much further with a different search.

**Exact chain model.** Every physical chain of PR200's word (donor + recipient splices, root frames, terminal full frame) is a sequence of slots. Each operation frame is shared by its destination and source chains. A frame is feasible when it contains the operation's value span, is G-nondegenerate, and is nested between its neighbours on both chains. The cost of a chain is the sum of `t*ln(72/t)` over its rank increments `t`, the first-order paid-moment weight.

**Cascading moves.** For an operation, try raising its frame to a later neighbour frame on either chain (up to four slots ahead), or to its global feasible maximum. Joining the new frame forward along every affected chain repairs nesting. Lowering mirrors this: meet backward down to the global feasible minimum. Root frames, gauge frames, start frames and alias endpoints stay fixed. A move is accepted on exact cost decrease. Single-operation moves stall almost at once; the cascades plus short annealing (T = 0.5, 1.0, 0.3) reach a deeper local optimum. Internal chain cost falls from 804,451.6 to 803,364.5 (−0.135%).

**Admission by PR200's own checkers.** Frames are the only change; 6,191 operations receive new rational bases (`opframe-bases.json`). PR200's modules re-check:

- every replacement frame for value span and nondegeneracy;
- all physical chain nestings and the 1,760 alias containments;
- the 34-sink terminal-modified word on all 1,760 source, 1,760 target and 17,114 dirty columns, over F2 and over the integers (residual bound 39,780, 24-bit packed digits);
- Gram/prime witnesses for all 24,611 used frames, each with residual factor below 2^80;
- the paid coarse and atom certificate.

The resulting unpacked coarse saving is `135709678471459/(2*10^17)`.

**Banks.** Same as PR205. Role counts, gauges and aliases are unchanged, so there are 45,842 banks, W = 56,402, deficit 5,808, maximum child 22, and at most 171 chart factors. The conservative selector-call bound is 5,368,513,266.

**Composition.** The finite ordinary-leaf recurrence uses three levels from the re-certified ordinary saving. It is followed by the balanced 47-constraint assembly with eta = beta = 10^-24. The next 10^-18 grid point fails.

## Reproduce

```sh
git -C <pr193> checkout 187e1010ac8b259af8e9b5166f68b64bc27b4b47
git -C <pr200> checkout a1175449f34d39ff933d9d8ab23ced1f32b290ec
python -B research/cascade-frames-bit/verify.py --complex-root <pr193> --bit-root <pr200> --full
```

The full run takes about 6 minutes on two cores. It re-runs PR193's complex verifier, re-admits every frame through PR200's exact checkers, rebuilds charts and banks, and reproduces `certificate.json` byte for byte. Without `--full`, it re-derives the arithmetic from the stored physical record.

## Scope

This is a conditional finite supplier certificate. It inherits, without proving, the same all-size compiler, the completed weighted/restored selector, routing, precision, the fixed analytic tape, and the finite bridge hypotheses as PR193/197/200/205/207. The frame search is a heuristic local optimum with no optimality claim. The search scripts are not needed for verification: only the frozen frame list is a mathematical input.

## Credits

- PR200 (Chafik Boukhalfa): word and checkers.
- PR193: complex supplier.
- PR197 (Evan McKinney): bank packing.
- PR185/187: finite composition.
- PR207 (Dugongue): first showed that frame re-optimization pays and how to admit frames through PR200's checkers.

Prepared by Rohan Arun with Anthropic Claude assistance. Apache-2.0.
24 changes: 24 additions & 0 deletions research/cascade-frames-bit/SOURCE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"bit_commit": "a1175449f34d39ff933d9d8ab23ced1f32b290ec",
"bit_files": {
"research/paired-cube-diagonal-bit-168/arithmetic/interval_moment.py": "9d3d1d28bfb3375958995205179b171fb65c70a3792cf9f7a21ef5ee54f5460b",
"research/paired-cube-diagonal-bit-168/certificate.json": "853afa75980e11ce16b333c28311c4f635e84065867c049fda9916c2419091ed",
"research/paired-cube-diagonal-bit-168/selected/bit/frames_p12.json": "aec2f09df5b42165a353a9233d9c8549bf091167915f6b044689c4bfb189d406",
"research/paired-cube-diagonal-bit-168/selected/bit/sinks.json": "c00ff70c564829d4b97740f92796fc6ce14fbcd5ca519663828650552b80249d",
"research/paired-cube-diagonal-bit-168/selected/bit/word_p12.json": "0728ed1c7320430a87709b1034485cbabefec85d532b48897f74136cf3954218"
},
"bit_manifest_sha256": "015abe3342d08d08a9c4a764f103cafc1be1fe7f23d7a72471bd87412c57c2df",
"comparison": {
"pr197": "Evan McKinney, packing on PR187",
"pr202": "Chafik Boukhalfa, kappa = 6768823/10^10",
"pr204": "maxime-fleury, modelled 6.83061299e-4"
},
"complex_commit": "187e1010ac8b259af8e9b5166f68b64bc27b4b47",
"complex_files": {
"research/source-assisted-v4/SOURCE.json": "99024e5c8296ad03b6e499c3c4e1e9e879bf6a5954d8558cc39abd557edf79d6",
"research/source-assisted-v4/certificate.json": "d84406d2fcc6990deba2b135509e6d86600e57123d88f9b21f7b7240e1aeb513",
"research/source-assisted/global/FINITE_BRIDGE.txt": "66d8f4ea8752abd89952d6674a636575a0db16e18b1c16e293f48f64242f0c46",
"scripts/paired_cube_assembly.py": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c"
},
"frames_sha256": "56b2ed0f6b867e8cafdc32ac70419cfda36d02838844572098b3fc77f8026e58"
}
106 changes: 106 additions & 0 deletions research/cascade-frames-bit/arithmetic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
"""Exact paid moments, finite ordinary-leaf composition and the balanced assembly.

Adapted from PR197's arithmetic.py (Evan McKinney; PR185/187 finite bootstrap, PR193 balanced bridge inherited):
the bit supplier is PR200's terminal-modified diagonal-circuit word instead of PR187's.
Prepared by Rohan Arun with Anthropic Claude assistance. Apache-2.0.
"""
from fractions import Fraction as Q
from pathlib import Path
import importlib.util, json

BIT_PACKAGE = 'research/paired-cube-diagonal-bit-168'
PR207_KAPPA = Q(1366380910073, 2 * 10 ** 15) # PR207: 302 coordinated frames + completed banks on PR200
PR205_KAPPA = Q(683061299399923, 10 ** 18) # PR205: completed banks on PR200


def load(name, path):
s = importlib.util.spec_from_file_location(name, path); m = importlib.util.module_from_spec(s); s.loader.exec_module(m)
return m


def build(ROOT, BIT, physical, admitted):
im = load('interval_moment', BIT / BIT_PACKAGE / 'arithmetic/interval_moment.py')
assembly = load('frontier_assembly', ROOT / 'scripts/paired_cube_assembly.py')
p = physical
c191 = json.loads((ROOT / 'research/source-assisted-v4/certificate.json').read_text())
b200 = admitted

def profile(m, W, H, delta):
H = {int(r): int(n) for r, n in H.items()}
return dict(m=m, W=W, child_multiplicities=H, N=delta, L=0, total_rank=sum(r * n for r, n in H.items()), maxchild=max(H))
cp = c191['complex_profile']; cp = profile(cp['m'], cp['W_per_vertex'], cp['child_histogram'], cp['deficit_per_vertex'])
bp = b200['profile']
unpacked = profile(bp['m'], bp['W_per_vertex'], bp['child_histogram'], bp['deficit_per_vertex'])
assert unpacked['total_rank'] == bp['rank_per_vertex'] and unpacked['maxchild'] == bp['maxchild'] == 60
packed = profile(72, p['W'], p['child_histogram'], p['deficit'])

def paid(row, a, bit):
result = im.moment(row, a)
if bit:
l, u = im.log_interval(Q(row['m'])); e, f = im.exp_interval(a * l, a * u)
w = Q(1, 10 ** 16) * Q(32 * row['m'] * sum(row['child_multiplicities'].values()), row['W'])
result.update(lower=result['lower'] + w * e, upper=result['upper'] + w * f)
return result

def certify(row, bit):
den = 10 ** 18; lo = 0; hi = den // 100
assert paid(row, Q(lo, den), bit)['upper'] < 1 < paid(row, Q(hi, den), bit)['lower']
while hi - lo > 1:
mid = (lo + hi) // 2; v = paid(row, Q(mid, den), bit)
if v['upper'] < 1: lo = mid
elif v['lower'] > 1: hi = mid
else: raise AssertionError('Interval inconclusive')
a = Q(lo, den); b = Q(hi, den)
return dict(saving=a, accepted=paid(row, a, bit), next_excluded=paid(row, b, bit))

complex_cert = certify(cp, False)
original = certify(unpacked, True); new = certify(packed, True)
assert original['saving'] == Q(b200['coarse']['coarse_saving'])
assert new['saving'] > original['saving']
assert paid(packed, original['saving'], True)['upper'] < paid(unpacked, original['saving'], True)['lower']
# Finite-depth ordinary supplier composition, as in PR185/187/197, from PR200's completed ordinary supplier.
old = Q(b200['coarse']['ordinary_saving']); coarse = new['saving']; chain = [old]
for _ in range(3):
a = (1 - coarse) * coarse + coarse * chain[-1]
assert chain[-1] < a < coarse < 1 - a
chain.append(a)
assert 0 < p['conservative_selector_calls'] < 2 ** 40
# Additional chart/router calls use the inherited completed ordinary selector; their exponent is at most the
# atom exponent coarse, which is below 1 - ordinary.
assert coarse < 1 - chain[-1]
bridge = c191['assembly']['finite_bridge']; bridge['rows']['degree_gap'] = Q(bridge['rows']['degree_gap'])
beta = eta = Q(1, 10 ** 24); weak = Q(1, 10 ** 30); den = 10 ** 18

def assemble(bit_saving):
b = complex_cert['saving']; a = min(bit_saving, (1 - beta) * b - weak)
q = a * (1 - 2 * eta); bound = (1 - eta) * q / (1 + q); z = bound * den
k = Q((z.numerator - 1) // z.denominator, den)
out = assembly.assembly(a, b, bridge, k, eta=eta, beta=beta)
assert len(out['strict_constraints']) == 47 and len(out['margins']) == 7
try: assembly.assembly(a, b, bridge, k + Q(1, den), eta=eta, beta=beta)
except AssertionError: pass
else: raise AssertionError('Next final grid accepted')
constraints = out.pop('strict_constraints')
out['strict_constraint_count'] = len(constraints)
out['minimum_constraint'] = min(constraints.values())
return dict(kappa=k, assembly=out, binding='complex' if a == (1 - beta) * b - weak else 'bit')
before = assemble(old); after = assemble(chain[-1])
del before['assembly']
assert before['kappa'] < after['kappa'] and after['binding'] == 'bit'
assert after['kappa'] > PR207_KAPPA and after['kappa'] > PR205_KAPPA
controls = []
bad = dict(packed, total_rank=packed['total_rank'] + 1)
try: paid(bad, coarse, True)
except ValueError: controls.append('changed rank mass')
else: raise AssertionError('Corrupt mass accepted')

return dict(scope='Conditional composition; physical and finite bridge proof dependencies are separate',
source_commits=dict(complex='187e1010ac8b259af8e9b5166f68b64bc27b4b47', bit='a1175449f34d39ff933d9d8ab23ced1f32b290ec'),
complex_profile=cp, unpacked_profile=unpacked, packed_profile=packed, complex=complex_cert,
bit_before=original, bit_after=new, bit_coarse_relative_gain=new['saving'] / original['saving'] - 1,
stock_relative_reduction=1 - Q(p['W'], 3 * unpacked['W']), ordinary_chain=chain,
extra_selector_calls=p['conservative_selector_calls'], selector_toll_gap=1 - chain[-1] - coarse,
comparison_pr207_kappa=PR207_KAPPA, comparison_pr205_kappa=PR205_KAPPA,
before_packing=before, after_packing=after,
kappa_gain_from_packing=after['kappa'] - before['kappa'],
relative_gain_over_pr207=after['kappa'] / PR207_KAPPA - 1, controls=controls)
Loading