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
185 changes: 185 additions & 0 deletions research/bit-row-padding-physical/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
# Complete-fibre compatible-row padding on fifteen fixed tapes

JoyboyBrian, substantial OpenAI Codex assistance. Apache-2.0.
The compatible-row semantics are Jose Manuel's PR2786, and the wider strict
volume criterion and bounded Count adapter are Nick Petalas's PR3503. This
package does not claim either arithmetic fact as new.

## Contract and machine

Let P,R,S,B be positive integers with S<=R, V=PRB, and
R'=S ceil(R/S), Delta=R'-R. Input is an arbitrary binary function serialized
in lexicographic [P][R][B] order. B is the COMPLETE body/spectator fibre,
including the other high field and any supplied intermediate coordinates.
P contains all preceding complete coordinates. No coordinates are silently
dropped or replaced by one representative bit.

The source and four descriptors are borrowed. Descriptors are canonical
least-significant-first binary words (last digit1). Each tape has a unique
left marker followed by its finite word, then blanks. Every head initially
points one cell right of its own marker; origins can differ independently.
Nine work/call tapes begin blank; a distinct final output tape begins blank.
These are fifteen physically distinct tapes, not fifteen aliases of a bank.
A fixed physical tape is the ownership identity; distinctness is an input
ABI premise, not an uncharged pointer comparison. The Python simulator checks
identity at construction and resumption to reject aliased representations;
that structural validation is not an extra physical routing instruction.

The controller creates the padded word [P][R'][B], inserting Delta complete
zero rows AFTER the R genuine rows of EACH prefix. It exposes this tape and
a canonical binary R' at CALL. The callee borrows padded input, row count and
all original borrowed state, returns a distinct owned tape [P][R'][B], restores
all borrowed contents/heads, and closes its own scratch. The private P,R,S,B,Delta and temporary control
tapes are not exposed to the callee and must remain untouched. Its completed endpoint
preserves each row ordinal and permutes inside that row. Consequently padded
rows are again zero. More generally an explicitly proved zero-preserving
rowwise endpoint can satisfy the same adapter contract.

The controller then copies genuine rows, checks and discards all added row
bits, rejects wrong returned lengths, and clears all nine owned work/call
tapes. Final output is a distinct owned [P][R][B] tape. Borrowed source,
descriptors and their backing/heads are unchanged. All heads are at their
own local first cell and all owned visited cells except fixed left markers
and final output are blank.

The callee's row semantics and source preservation are premises. Local
zero checks do NOT establish them. A returned all-zero word can pass the
shape checks while destroying genuine data; the verifier intentionally
exhibits this. Test snapshots/oracles are not executable semantic admission.
The callee itself, its time/space/precision and native admission are excluded
from the adapter theorem. If the callee violates the contract, local malformed
return guards may reject; successful semantic correctness is not promised.
For canonical marked tapes, data/extent/length/padding-zero failures enter a
fixed cleanup epilogue: all owned work and partial output are erased, and
original borrowed heads rewind without changing their bytes. Post-CALL head
guard failure instead quarantines state: a violating callee may have moved
a head left of its marker, so a one-direction rewind is not a valid recovery
argument. Foreign alphabet symbols or misplaced left markers also quarantine.
No recovery of bytes maliciously changed by a callee, arbitrary exception
unwinding or drop-in replacement of Python try/finally is claimed. On invalid
inputs the valid-volume bound is not asserted; cleanup pays the actual finite
word lengths it scans. Canonical positive descriptors/valid callee are the
success theorem domain.

## Fixed control and positive-width invariant

machine.py emits one constant table, without input arguments. Its only
instructions are local read-and-branch, one-cell write, unit move, fixed jump,
CALL and DONE. Each references at most one fixed tape. The alphabet is
{0,1,left,blank}; one local instruction is one transition for this model.
The simulator's counters/dictionaries and visited-cell observation are a
representation of this machine, not runtime arithmetic instructions.
No instruction decodes extents, addresses a nonlocal cell, slices data,
multiplies, divides, allocates tapes or chooses an input-dependent unbounded control program.
Static labels and assembly resolve once, independently of P,R,S,B.

Four descriptor passes copy bits to one reusable temporary binary tape.
The finite copy state remembers only the last bit, so empty/zero/noncanonical
positive descriptors reject. Each descriptor is rewound and preserved.
The temporary is decremented to zero, emitting one unary1 per decrement.
A decrement flips low zeros to ones, clears the next one and, if that one
was the highest digit, removes it. It rewinds only the digits just crossed.
Thus the temporary remains canonical or empty, and yields exactly n unary
ones for descriptor n. There is no4096-bit or other width capacity.

Planning first scans unary R and S together, rejecting S>R, then rewinds.
It consumes all R row marks and cyclically traverses S group marks. At each
consumed mark it increments a canonical binary R' counter. If R ends on a
group boundary, Delta is empty. Otherwise it drains the remaining group,
appending one Delta mark and incrementing R' once per mark. Exactly
S ceil(R/S) positions are counted. This is a paid sequential implementation
of round-up, not a host division.

At every prefix the first row loop processes exactly R rows and the second
exactly Delta rows. For every row the unary B counter advances once per bit
and rewinds at its right end. Padding copies genuine bits and writes literal
zeros on additional rows; restriction copies genuine bits and requires every
additional source bit to be0. The prefix counter advances once per complete
pair of loops. End-of-word guards enforce the exact supplied volume. All
counter rewinds and payload head moves are actual local instructions.

At CALL the original source, descriptors, padded source and R' are all
rewound. After return, the machine locally steps left and reads the unique
left marker on each exposed tape, then steps right. This checks returned
head positions; it does not compare borrowed contents. Restoration of those
contents remains the callee premise. Restriction then runs only AFTER CALL.

## Uniform costs, including setup

Every positive extent is at most V: P,R,B<=PRB and S<=R. Also
Delta<R and R'<2R. Binary descriptor length ell(n)<=n. The following bounds
count local instructions in the fixed table, excluding the callee.

For n consecutive binary decrements, let z(t) be the number of low zero
digits in the positive value t. Each digit position j is crossed in the
borrow chain only when 2^j divides t. Hence
sum(t=1..n) z(t) = sum(j>=1) floor(n/2^j) < n.
The total number of changed/crossed digits is <2n. Rewinding follows only
those crossed digits plus at most two boundary cells: it never scans the
original full descriptor width on each decrement. Copy, rewind, trim and
unary-output overhead are bounded by60n+40 instructions, directly allowing
eight instructions per borrow/return edge and all fixed tests. Four
conversions therefore cost at most240V+160.

For increments1..r, the number of carried low ones sums to less than r.
Counting writes, local branch/goto, carry moves and rewind gives at most
16r+8 instructions. Group planning includes the cover comparison, all group
rewinds, remaining-row and group tests, Delta writes, and counter increments.
Every group rewind is charged to its consumed marks; total consumed group
marks is R'<2R. A conservative bound is80R+80<=80V+80.

For one transform, every processed genuine/added cell has at most ten
instructions in the bit loop. B rewinds cost at most3(B+2) per row; row and
prefix guards/rewinds cost at most a further twenty per row plus twenty per
prefix. Since B,R>=1 and processed row count is PR'<2PR,80V+80 bounds a
transform including source/output rewinds and terminal guards. The two
transforms therefore cost at most160V+160.

Nine owned tapes are cleared by one forward erase scan and one backward
rewind, at most eight instructions per cell plus fixed boundary overhead.
Their maximum occupied lengths total at most
P+R+S+B+Delta+max(ell(P),ell(R),ell(S),ell(B))+ell(R')+2V+2V < 11V+2.
Thus100V+200 is a conservative cleanup bound; the eight post-CALL local
boundary checks cost24. Summing these deliberately loose allocations is
less than2048V+2048 transitions for all V>=1. This bounds the actual table,
not the host Python interpreter's elapsed time.

For space, all four unary extents and Delta total at most5V; the two binary
work/count extents total at most2V+1. Original source, padded source,
returned source and final output occupy at most6V altogether. Borrowed
descriptors have total length at most4V. Include all fifteen fixed markers,
the blank cells observed at right boundaries and any one-cell guard/rewind
overrun: fewer than64V+64 distinct visited cells on all tapes suffice.
The callee must deliver a returned word of length PR'B and must charge its
own other scratch separately. No global-origin span is counted: independent
tape origins are translation-invariant.

These bounds need not be optimal. They prove supplied-width linear movement
and preparation with fixed tape/control resources. For the T=10Nf sequential
matcher lifetimes, the adapter charge is the SUM of these per-call bounds
at their actual complete volumes. It cannot replace the2T raw bodies,
3T body additive maps or T older high-part swaps. Physical P3 constants,
precision, the full native body and outer admission remain separate.

## Actual source boundary and discriminator

#4989's generator uses the borrowed branch exactly when2k<e=w-1. For
f1,q5,w4,k1,S3, e3>2 and R=q^k=5. It schedules
inner_borrow, row_pad, body_sub, raw_reverse_swap, body_add,
raw_reverse_swap, body_rsub, inner_return, row_unpad, older_high_swap.
This adapter supplies the padding/restriction interface around that completed
inner body; it does NOT implement that body. The source owners462 and461
remain distinct; the latter is a complete spectator encoded in the fibre.

At P2,B6, sixty genuine bits become seventy-two padded bits. Twelve actual
zeros are written in two six-bit rows. The old addressed interpreter's
zeros=[0]*(total-size) is valid row metadata, but is not this physical bit
allocation; no predecessor bug is asserted. All sixty individual dirty basis
inputs and an all-one translated-origin fixture test the complete fibre,
together with boundary cases around binary carries. A synthetic completed
rowwise reversal witnesses the adapter composition only.

The conditional proof applies at arbitrary positive extents, including the
actual much larger body/spectator product. P2,B6 is a discriminating interface
fixture, not an execution of the full GL64 cover. Small q5 is source scheduling
calibration, not proof of the source's large-prime admissibility bound.
61 changes: 61 additions & 0 deletions research/bit-row-padding-physical/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Physical complete-fibre ROW padding

This package lowers the compatible-row padding/return/restriction boundary
to one fixed589-instruction controller on fifteen tapes. For runtime positive
binary P,R,S,B with S<=R and V=PRB, it pays descriptor preparation and
round-up, inserts complete zero fibres, restricts only after the completed
callee returns, and erases every owned temporary. The written bound is
2048V+2048 transitions excluding the callee and64V+64 visited cells.
There is no fixed descriptor bit-width limit.

The actual #4989 helper462/frame506 borrowed branch at q5,w4,k1,S3 pads
five rows to six. With P2 and body/spectator fibre B6,60 bits become72:
twelve physical zeros, not one metadata marker. All sixty basis inputs,
binary carry boundaries, arbitrary dirty data and independently translated
tape origins are checked. [PROOF.md](PROOF.md) separates this finite evidence
from the all-width argument.

The completed row-pointwise, source-preserving callee remains a semantic
premise. Local zero/length/head checks do not certify it; a registered
counterexample demonstrates that distinction. No native_canonical or
raw_reverse_swap implementation, full GL64 payload, new supplier, P3 reserve,
precision/outer admission or new kappa is claimed. Canonical data/shape failures execute owned cleanup and rewind borrowed
heads; callee head violations quarantine state instead of promising recovery.

Jose Manuel's PR2786 supplies the original compatible-row scans and callback
contract. Nick Petalas's PR3503 supplies the exact strict-volume criterion
and capped Count/Tape adapter. Their ratio/least-borrowing results and scans
are credited, not republished as new results. This adds fixed local control
and a uniform complete-fibre cost, while keeping the actual source S<=R domain.
The wider S<2R change is outside scope. #4957's conditional completed BIT API
and #4989's addressed matcher/ROW schedule supply the actual caller boundary.

Run from repository root with standard-library Python3.12:

```sh
python3.12 -Werror -B scripts/research_package.py --package research/bit-row-padding-physical
```

Registered normal/optimized replay checks immutable inputs, complete bytes,
cleanup, malformed returns and the fixed table receipt. Committed bytes,
source history and official Git-free export are separate publication checks.
The simulator uses dictionaries to represent tapes; only its declared local
instructions define the proved machine cost. Test oracles and synthetic
callee execution are not hidden machine instructions.

Canonical claim:
https://github.com/CrocSwap/integer-mult-bounds/discussions/4945#discussioncomment-19141335

## Open next questions

- Supply an actual completed native/raw callback with this exact source,
row-pointwise, distinct-output and restored-head contract; begin at the
source inner_return boundary, preserving complete other-high-field fibres.
- Bind this controller to the full selected serialization and actual P3
reserve/precision constants. The interface calibration alone does not
instantiate the astronomical complete matcher cover.

JoyboyBrian, substantial OpenAI Codex assistance. Apache-2.0. Preserve credit
to ai-nanachi, Jose Manuel, Nick Petalas, Chris R/Clear1nsight, David Arias
and the full source-native/ordinary/ROW lineage in the authenticated inputs.
No independent human or proof-kernel acceptance claim.
75 changes: 75 additions & 0 deletions research/bit-row-padding-physical/RESULT.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"actual_fixture": [
2,
5,
3,
6,
2055,
4675,
327
],
"basis_columns": 60,
"bounds": {
"transitions": "2048*V+2048 excluding callee",
"visited_cells": "64*V+64 including endpoints and callee return"
},
"callee_semantics_remain_conditional": true,
"cases_sha256": "3c3c584c2fa23e5c024579e778fb693938feb0f8446dacb239ba66289ec07c74",
"instructions": 589,
"max_steps": 16217,
"negative_checker_rejects_bad_cleanup": true,
"program_sha256": "0c1c46c163311ac03ce95ab456d53cae0584c7071b4464c3c3b9a1cbb652b545",
"rejected": [
"aliased-physical-port",
"aliased-return-port",
"zero-descriptor",
"noncanonical-descriptor",
"empty-descriptor",
"nonbinary-descriptor",
"stock-exceeds-rows",
"short-source",
"long-source",
"short-return",
"long-return",
"dirty-added-fibre",
"wrong-return-head",
"wrong-borrowed-head"
],
"scope": "All-width written local-controller proof; finite source-bound adapter calibration, no native supplier admission",
"source": {
"actual_fixture": {
"S": 3,
"added_bits": 12,
"body": 6,
"borrowed": true,
"f": 1,
"genuine_bits": 60,
"high_width": 3,
"k": 1,
"padded_bits": 72,
"prefixes": 2,
"q": 5,
"rows": 5,
"w": 4
},
"inputs": 11,
"retained_padding_sha256": "9f58bf2d343e13a70dc765d86c590b912d5987669d507ab14bd36deed94a76ee",
"source_owners": [
462,
461
],
"source_padding_lifetimes": 80
},
"status": "PASS_COMPLETE_FIBRE_ROW_PADDING",
"successful_cases": 126,
"tapes": 15,
"translated_fixture": [
2,
5,
3,
6,
1996,
4557,
327
]
}
Loading