Skip to content
Merged
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
29 changes: 29 additions & 0 deletions .github/workflows/bit-reuse-147.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Verify recycled bit registers on the paired-cube bit word

on:
push:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
certificate:
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.14']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: ${{ matrix.python-version }}
- name: Reproduce PR144, run the ledger, check exact nesting, replay and reprice
run: python3 research/bit-reuse-147/verify.py
- name: Require committed files to remain unchanged
run: git diff --exit-code
21 changes: 21 additions & 0 deletions research/bit-reuse-147/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Recycled bit registers on the paired-cube shared cores, 9 October 2026
Copyright 2026 DaysSky. Apache-2.0.

Prepared by DaysSky with Anthropic Claude assistance. The contribution is the late read timetable, the hand-off
of dead bit registers to later deferred births on this word, and their verification. No priority over concurrent
work is claimed.

Credits for what this package uses:

- icekylinx: #144 and #130 (paired-cube and three-stage cover framework, selected gauges, completed-core ledger,
pricing and assembly), and #104.
- hpst3r (William Porter): #147, terminal elimination on this bit word. Its plan of 1,549 eliminated slots is used
unchanged, and price147.py follows its pricing approach.
- jamesyc (James Chang): #124, the birth-read reuse operation.
- SovereignSteak: #122, terminal accumulator elimination.
- Swapnil Jain: the round-seven deferred bit word and its exact frame tools.
- Zhihao Chen (jacklightChen): the PR97 ledger.
- an664: #128, completed-core sharing.
- gupt1156: #148, the atom exponent 1/2000 reported as a secondary value.

All inherited licenses, notices and assistance disclosures remain in force and unchanged.
96 changes: 96 additions & 0 deletions research/bit-reuse-147/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Recycling dead bit registers at deferred births: argument and scope

**Setting.** This is the bit branch of the merged #144 (icekylinx), after the terminal elimination of #147 (hpst3r).
Its word is Swapnil Jain's round-seven PR97 word at h = 23:

- non-deferred and omitted reads at frame 0;
- early V gates, phase 1 and the copied centres;
- deferred reads of the selected slots at their sigma frames, in the inherited readout order;
- late V gates, the rest of L, the output reads, then L^-1 and V^-1 at the full frame.

#144 charges the resulting chains per vertex in dimension m = 69: auxiliary chain steps, source and target chains and
copied centres, each three times; one gauge child 3 dim(sigma) per selected slot; and 2v endpoint children.
W = 2v + R and the deficit is 2,024 per vertex. #147 deletes 1,549 terminal output slots; that plan is used here
unchanged, as is #144's choice of 9,543 selected gauges.

**Two changes.** Nothing else in the word moves.

1. *Reads run late.* The selected reads keep their inherited relative order, but each one is executed as late as
these constraints allow, instead of in one block after phase 1:
- a read precedes the first operation that touches its slot, and that slot's V gate follows the read;
- the V gates of one leaf keep their inherited chain order;
- every read on a target precedes the first redirected write into that target.
2. *Dead registers are reused.* A slot D that is neither an output slot nor a retained centre is never touched
again after its last operation, where it sits at the frame U_D of that operation. For 3,338 pairs (B, D) with D's last operation
before B's read and U_D inside sigma_B, the register of D is moved from U_D to sigma_B and becomes B. B is then a
deferred slot without an entrance gauge. This is jamesyc's #124 birth-read operation, applied to the bit word.

**Scalar identity.** The inherited identity holds for arbitrary start values of all slots: a slot s with start value
z_s contributes C_{T,s} z_s to target T through L and the root reads, and its read subtracts exactly that, where C is
the exact integer adjoint.

- Delaying a read does not change what it reads. Until its first operation or V gate, the register holds its start
value, and a read only writes into targets, which nothing reads back.
- For a recycled pair, B's start value is whatever D left behind, a linear form in the data and the other start
values. D's last operation is before the read and B's first operation is after it, so B's read sees that value
and B's own contribution carries the same value with the same coefficients. The two cancel as before.
- D's remaining contributions are unchanged, because no operation reads D after its last operation.
- The inverse pass undoes the register updates (operations and V gates) in exact reverse order, at the full frame.
On a recycled register this removes B's V gate before D's operations are undone. The inherited order, with every
V^-1 after L^-1, would not restore the registers; `verify.py` checks that it fails.

`word147.complete` runs the literal word on the 23,979 physical registers with every data port, target and
register as its own formal variable, over F2 (bitmasks) and over Z (integer linear forms with the exact integer
coefficients). Every register must end as its own variable and every target as its start variable plus exactly
its defining sum. This check is complete and uses no random vectors. `word147.replay` then runs the word on random
scratch and data, where three tampered words must break the Z identity: a recycled read of the register's entrance
value, a recycled read taken before its donor's last write, and the inherited inverse order.

**Frames.** Every frame is an original frame key of the PR97 word, so nondegeneracy is inherited. A hand-off is the
difference of two inherited projectors; it adds finitely many rank-witness primes for the fixed prime q of #130's
weighted compiler to avoid, and nothing else. `word147.ledger`
executes the forward word on frame keys. Each scalar gate must find all its registers at one common key, and no
register may retreat in dimension. The check of actual nesting is separate:

- A move between two keys of one inherited certified chain, in that chain's order, is nested by the pinned audits
(`check_lifted.py` D, `check_frames.py` X and Q) that #144 relies on. Those chains are the original slot chains,
the X chains in their original V order, and the target chains in readout order with positive Z support, ending
at t_T^perp. A subsequence of a nested chain is nested.
- Every other move is checked exactly over Q with integer bases rebuilt by `check_lifted.py`, and both frames are
checked nondegenerate. There are 4,878 such moves:
- 3,338 hand-offs U_D -> sigma_B (993 of them have equal dimension, so the two frames are equal);
- 935 target moves from the last remaining level to a redirected V frame;
- 605 target moves from one eliminated slot's redirected frame to another's V frame. These arise because a
redirected V write now runs just before its slot's first operation rather than in the late-V block.

Delaying the reads does not reorder any chain. With no elimination and no recycling, the delayed word reproduces
every histogram of #144's row; `verify.py` checks this as a control.

**Accounting.** #144's ledger (`notes/paired-cube-sharing.tex`) charges a physical role by its entrance gauge and
its frame chain. A recycled register enters with its first occupant's gauge, follows one nested chain to the full
frame, and has its raw value restored, so it satisfies the same completed-core contract. Relative to #147, one pair
(B, D) with d = dim U_D and f = dim sigma_B

- removes D's final step of rank 23 - d (three copies) and B's gauge child of width 3f;
- adds the hand-off step of rank f - d (three copies);
- lowers W by one.

The removed rank is 3(23 - d) + 3f and the added rank is 3(f - d), so the mass drops by 69 = m and the deficit stays
2,024. The row is rebuilt from the actual ledger moves (`word147.row`) and priced with #144's own functions
(`price147.py`): `exact_moment`, the full rare-class fallback, the complex certificate, the finite bridge and the
47-constraint assembly. The largest child falls from 66 to 60, which only shortens the recursion depth bound.

**Scope.** This is a finite conditional construction. Every interface that #144 retains stays an assumption:

- the unchanged complete scalar word and the inherited rational frame audit of PR97;
- the paired source scheduling and completed-core sharing;
- the uniform recursion, analytic and tape contracts.

Not established here:

- The replay runs one core on its own bank, as in #147. That is the premise the shared-core argument uses.
- The pinned PR97 frame audits are relied on, not rerun.
- The plan is one legal choice found by a matching heuristic (`make_plan.py`). No optimality is claimed, and the
certified value does not depend on how the plan was found.
- The headline uses the merged atom exponent 1/1000. The value at 1/2000 (gupt1156's #148) is reported separately
and rests on the retained requirement a_bit < beta < 1 - a_bit.
71 changes: 71 additions & 0 deletions research/bit-reuse-147/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Recycled bit registers on #144's shared cores

Under the interfaces retained by the merged #144, this package certifies

T(n) = O(n (log n)^(1 - κ)), κ = 471809569/10^12 = 4.71809569e-4

That is +1.54% over #147 (4646633/10^10) and +2.36% over the merged #144 (4609169/10^10). It adds this directory
and one workflow; no existing file changes.

## What changes

Only the bit word changes, and #144 is bit-limited. Starting from #147's reduced word:

- The selected deferred reads keep their order but run as late as the word allows, instead of in one block.
- 3,338 auxiliary registers that are dead (never touched again) are handed to a later deferred slot whose entrance
frame contains the dead register's frame. The recipient's inherited read cancels what the donor left. This is
jamesyc's #124 birth-read operation, applied to the bit word.

Each hand-off removes one physical role, the donor's final step and the recipient's gauge child, and adds one
shorter step. [PROOF.md](PROOF.md) gives the argument and its scope.

| | roles R | W per vertex | coarse bit saving | κ |
|---|---|---|---|---|
| #144 (merged) | 28,866 | 32,408 | 4617656/10^10 | 4609169/10^10 |
| #147 | 27,317 | 30,859 | 4655227/10^10 | 4646633/10^10 |
| this package | 23,979 | 27,521 | 472689442/10^12 | **471809569/10^12** |

The deficit per vertex (2,024) is unchanged. The complex side (4856569/10^10) still has about 2.9% headroom.

The headline keeps the merged atom exponent 1/1000. At gupt1156's 1/2000 (#148) the same row gives
472026274/10^12 = 4.72026274e-4; `verify.py` checks both.

Not composed here: Th0rgal's exact min-cut gauge subset (#146). #144's own 9,543 selected gauges are used.

## Verify

python3 research/bit-reuse-147/verify.py # stdlib only, about 2 minutes; do not use -O
python3 research/bit-reuse-147/verify.py --all # also re-checks every inherited frame move, about 9 minutes

`verify.py` runs these checks:

1. It reproduces #144's coarse saving, stopped saving and κ exactly on #144's own grid.
2. With no elimination and no recycling, the delayed-read word reproduces every histogram of #144's row.
3. It runs the frame ledger of the frozen plan: every scalar gate at one common frame, no register retreating. The
row rebuilt from the actual moves must equal `row.json`.
4. It checks all 4,878 new adjacent frame pairs for exact nesting over Q, with bases rebuilt by `check_lifted.py`.
A control must reject mismatched hand-offs.
5. It runs the literal word on the 23,979 physical registers with all 27,521 inputs as formal variables, over F2
and over Z, and requires the exact identity. This is complete, with no random vectors. A random replay then
confirms that three tampered words break the identity.
6. It prices the row with #144's assembly (47 constraints, 7 margins); the next grid points are rejected.

## Files

- `word147.py`: timetable, literal events, scalar replay, frame ledger and row.
- `frames147.py`: exact integer frame bases and nesting over Q.
- `price147.py`: pricing with #144's `paired_cube_network.py` functions. As in #147, the one relaxed check is the
bit dimension test, which accepts R <= 28866.
- `plan.json`: the eliminated slots (#147's plan, unchanged), the remaining gauge slots and the 3,338 pairs.
- `row.json`, `expected.json`: the resulting row and the certified values.
- `make_plan.py`: how the plan was found (needs numpy and scipy). Verification does not use it.

## Limits

- This is a finite conditional construction. Everything #144 retains stays an assumption, and the pinned PR97
frame audits are relied on, not rerun.
- The replay runs one core on its own bank, as in #147.
- The plan is one legal choice from a matching heuristic. No optimality is claimed.
- The complete `make verify` and the formal targets were not run locally; the fork's CI runs them.

Credits are in [NOTICE](NOTICE).
5 changes: 5 additions & 0 deletions research/bit-reuse-147/expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"coarse": "236344721/500000000000",
"kappa": "471809569/1000000000000",
"kappa_atom_2000": "236013137/500000000000"
}
72 changes: 72 additions & 0 deletions research/bit-reuse-147/frames147.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
"""Exact integer bases of the frames that the recycled word joins in a new order, and exact nesting over Q.

Stdlib only. Node frames, late-copy intersections and root frames are rebuilt from the pinned PR97 witness with
Swapnil Jain's check_lifted.py machinery, exactly as check_frames.py derives them; sigma and V-leaf frames are the
primitive integer bases of the pinned data file."""
import sys
from fractions import Fraction
from math import gcd


def prim(r):
r = [Fraction(x) for x in r]; den = 1
for x in r: den = den * x.denominator // gcd(den, x.denominator)
z = [int(x * den) for x in r]; g = 0
for x in z: g = gcd(g, x)
return [x // g for x in z] if g else z


class Exact:
def __init__(self, S, W, folder):
sys.path.insert(0, str(folder))
import check_lifted as cl
from linalg import null_exact, rank_mod, Q31
self.S = S; self.h = h = S.h; self.cl = cl; self.null_exact = null_exact; self.rank_mod = rank_mod; self.Q31 = Q31
pr = cl.Prog(W); bas, dn = cl.spans(pr); self.users = cl.users_of(pr, dn)
fr = self.fr = cl.Frames(pr, dn, bas, self.users); fr.cobases(); d, _ = fr.dims(); self.ld, _ = cl.late_frames(fr, pr, self.users)
assert all(S.node_dims[n] == d[n] for n in pr.act) and len(S.node_dims) == len(pr.act), 'recorded node dimensions'
self.full = [[int(i == j) for j in range(h)] for i in range(h)]
self._basis = {}; self._null = {}

def ukey(self, n, k):
u = self.users[n][k]
return ('n', u[1]) if u[0] == 'gate' else self.cl.root_key(u)

def basis(self, key):
if key not in self._basis:
S, fr = self.S, self.fr; kind = key[0]
if kind == 'sigma': B = S.sigma[key[1]]
elif kind == 'v': B = S.vstart[key[1]]
elif kind == '0': B = []
elif kind == 'F': B = self.full
elif kind == 'out': B = [prim(r) for r in fr.exact_basis(('out', key[2][0], tuple(key[2])))]
elif kind == 'c':
n, lt = key[1], key[2]
B = self.basis(self.ukey(n, lt[-1]))
for kk in reversed(lt[:-1]): B = fr.intersect_exact(self.basis(self.ukey(n, kk)), B)
B = [prim(r) for r in B]
else: B = [prim(r) for r in fr.exact_basis(key)]
assert len(B) == S.dim(key), ('exact dimension', key)
self._basis[key] = B
return self._basis[key]

def null(self, key):
if key not in self._null:
B = self.basis(key)
self._null[key] = [prim(z) for z in self.null_exact(B, self.h)] if B else self.full
return self._null[key]

def inside(self, a, b):
"""span(a) <= span(b), exactly over Q (integer dot products with an exact integer basis of b's annihilator)."""
A = self.basis(a)
if not A or len(self.basis(b)) == self.h: return True
if len(A) > len(self.basis(b)): return False
return all(sum(x * z for x, z in zip(ra, rz)) == 0 for ra in A for rz in self.null(b))

def nondegenerate(self, key):
"""G = I - J/9 nondegenerate on the frame: det(9 B G B^T) nonzero mod 2^31-1, hence over Z."""
B = self.basis(key)
if not B or len(B) == self.h: return True
sm = [sum(b) for b in B]
gram = [[9 * sum(x * y for x, y in zip(a, b)) - sa * sb for b, sb in zip(B, sm)] for a, sa in zip(B, sm)]
return self.rank_mod(gram, self.Q31) == len(B)
Loading