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
35 changes: 35 additions & 0 deletions research/r420-frame-zero-pair/CLAIM.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"track": "Bit supplier",
"assignment_seed": 1,
"seed_source": "Python secrets.randbelow(100), backed by operating-system randomness",
"base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60",
"claimed_at_utc": "2026-10-13T03:48:00Z",
"expected_finish_utc": "2026-10-13T04:23:00Z",
"planned_verification_no_later_than_utc": "2026-10-13T04:13:00Z",
"actual_verification_started_at_utc": "2026-10-13T03:56:30Z",
"coordination": "GitHub pinnedIssues was empty; the only open issue was #650 (Discussions). Local claim used as requested.",
"candidates": [
"Resynthesize the seed-selected R420 phase-B block 1; rejected as too close to concurrent #670 and #674 block resynthesis.",
"Optimize a fixed-order R420 phase-B frame schedule; rejected because #661 already closes this search class.",
"Factor one pair of dirty helper columns in R420's frame-zero compensation, including preparation, restoration and both positive prefix bills. Selected."
],
"object": "PR543 R420 D compensation; single restored helper-pair factorization at frame zero",
"method": "Count all 87990 unordered pairs of 420 helper columns. Select maximum shared support, lexicographic tie break. Assignment seed parity chooses the initial orientation. Test both orientations' exact positive prefix bills. No wider search.",
"optimistic_budget": "For q shared target rows: 2q direct XORs become q+2 XORs, including two helper preparation/restoration gates. No new helpers, moves, copies, or recursive children. At q=110 the saving is 108 XORs. The paid movement profile and complex bottleneck cannot improve from this alone.",
"expected_deliverable": "Standalone finite circuit recipe, exact dirty-input and record replay, meaningful mutation controls, prefix accounting, and a scoped proof of the generalized D interface. No new kappa claim.",
"overlap_snapshot": {
"670": "2e31fcad7f9ecc8b97039ecb2333e581fd725fa1",
"674": "1b01fd8b135fb2c458554fbbbab4338336bf366d",
"661": "9ca7aa3ab0a3260a2f36ac86b9911a31fd88bd89",
"612": "ce37f3ce35ba8891771e01492b3a21978763bebb"
},
"status": "completed: finite circuit improvement, no new kappa",
"result_update_at_utc": "2026-10-13T04:05:35Z",
"result": {
"pull_request": "https://github.com/CrocSwap/integer-mult-bounds/pull/686",
"summary": "Single restored helper pair saves 108 binary XORs: D 19922->19814, complete native word 26916->26808. No additional frame changes, copies, helpers or local recursive children; both native prefix maxima unchanged.",
"completed_coverage": "87990/87990 unordered pairs by two methods; both orientations; all 660 native columns and 1380 nine-stage columns; six D controls, 18 bridge controls per word and an F2-neutral prefix-inflation rejection.",
"handoff": "README.md, SOURCES.json, certificate.json, VALIDATION.json and one-command verify.py; generalized D interface and remaining hosting/all-size obligations explicitly documented.",
"final_overlap_refresh": "Open PR metadata refreshed through #685; no frame-zero R420 pair construction found. #670/#674 modify B; #661 holds D fixed; #673/#677 use different dirty primitives. Main remained at the exact base and no pinned issue existed."
}
}
195 changes: 195 additions & 0 deletions research/r420-frame-zero-pair/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
# R420: share one dirty-helper pair at frame zero

This finite bit-circuit contribution saves **108 binary XOR operations** in
eumemic's PR543 R420 word. Its frame-zero dirt compensation goes from 19,922
to 19,814 scalar ADDs; the complete native word goes from **26,916 to 26,808**.
Both dirty helpers are restored before phase A. The nine-stage formal-column
replay, frame paths, copied information and measured native prefix bill pass.
**No new kappa or completed hosted supplier is claimed.**

The base is `66849e1475c930fd7732b1a0067ffee7e1e95f60`. At that base the
selected composition is PR626 with PR543, conditional
`kappa = 51110230636731/31250000000000000 = 0.001635527380375392`, and its complex
supplier binds. These facts come from the selected certificate, its actual
`research/community-k492-audit/pr626/replay/ASSEMBLY.json`, and the
[maintainer review](../../docs/research/community-k492-review.md).
The R420 README's older frontier discussion is historical.

## Reproduce

From the repository root, with Python 3.11+, a C++17 compiler and Boost headers:

```sh
python3 -B research/r420-frame-zero-pair/verify.py
```

Expected last line:

```text
PASS_R420_FRAME_ZERO_PAIR D=19922->19814 native_adds=26916->26808 columns=660 kappa=unchanged
```

Python uses only the standard library. `CXX` selects a compiler; `BOOST_INCLUDE`
can name a nonstandard Boost include directory. The command checks all source
pins, regenerates the circuit and records, compiles the unchanged predecessor
checkers, runs the controls and compares every certificate field. It uses a
temporary directory. To retain the generated word, raw records, C++ receipts,
compile logs and certificate, append `--output /absolute/new/directory`.
An existing output directory is rejected.

Only this research directory is added. The selected frontier, predecessor
packages and `upstream/` are unchanged. The recipe is implemented in `factor`
in [verify.py](verify.py); its exact output has canonical JSON SHA-256
`358eca016e0e1ef48267dcd7ff33d4d36c27ecc3f38fffbdceb4c924e2254349`.
[SOURCES.json](SOURCES.json) pins every imported or executed predecessor file.
[certificate.json](certificate.json) records the complete census, target list,
both orientations, accounting and controls.

## The circuit and complete local cost

Write `a = helper 552`, `b = helper 521`. Let T be the 110 targets whose original
D row contains both a and b. Target register IDs are 120 through 239, except
153, 161, 174, 182, 185, 193, 206, 214, 222 and 230. All operations below occur
at frame zero:

1. Execute each original D row, omitting a and b only for rows in T.
2. Execute `a ^= b`.
3. Execute `y_t ^= a` once for each target in T.
4. Execute `a ^= b` to restore the original dirty value of a.

No source register is accessed. For arbitrary initial values alpha and beta,
the middle register contains `alpha XOR beta`, each selected target receives
exactly its omitted two terms, and a ends as alpha. Register b is read only.
All other helper and target terms are unchanged. Thus the D map is exactly
the original map on **all input columns**, including arbitrary helper dirt and
arbitrary target inputs. Reordering the residual target-only gates is valid:
they commute, read unchanged helpers, and cannot change a or b.

For a pair shared by q target rows, `2q` target XORs are replaced by `q+2`
XORs, including preparation and restoration. Here q=110, so the saving is 108.
The JSON D list grows from 120 grouped gates to 232 grouped gates; every source
term is still counted as a separate binary ADD. The result is not obtained by
pricing a many-source gate as a single operation.

| Complete native quantity | Original | Candidate |
| --- | ---: | ---: |
| D scalar ADDs | 19,922 | 19,814 |
| All scalar ADDs | 26,916 | 26,808 |
| All emitted records | 29,874 | 29,766 |
| Helpers | 420 | 420 |
| Retained copies | 9 | 9 |
| Paid rank mass | 5,112 | 5,112 |
| Forward positive prefix | 144,651 | 144,651 |
| Reverse positive prefix | 2,270,064 | 2,270,064 |
| Five-stage payload bits | 100 | 100 |

The entire MOVE/COPY/ERASE subsequence is identical, as are A, scatter, B, C,
boundary frames, labels and retained registers. There are no additional
frame changes, copies, helper allocations or local recursive children.
The paid histogram remains `{1:1320, 2:1440, 4:60, 5:120, 8:9}`. In the
nine-stage scalar replay the local saving is repeated nine times: 972 fewer
ADDs; the 2,160 bridge ADDs and 81 fresh center copies are unchanged.

F2 equality alone does **not** imply equality of positive prefix bounds. The
restoration gate increases the unsigned helper bound even though it cancels
over F2. We explicitly replay both signed orientations with nonnegative
integer bounds, independently in Python and in the pinned C++ checker. The
unchanged payload is exactly
`64 * 144651^3 * 2270064^2 = 998206739997057013039187410944 < 2^104`.
Neither entrywise domination of every intermediate positive map nor an
integer-ring endpoint identity for the all-positive XOR stream is asserted.

## The changed interface obligation

PR543's literal H2 requires every D gate to write a target and read helpers.
This candidate deliberately fails that syntactic condition, since two D gates
write helper a. The original checker's `K_equals_D` calculation also assumes
literal helper reads, so it is inapplicable to the compressed circuit.
Neither check is silently weakened in the predecessor package.

Replace H2 by the following sufficient condition, keeping H1 and H3--H5:

> D uses only target/helper registers at frame zero, reads only helpers, and
> has aggregate map `(x,s,y) -> (x,s,y+Ns)`; in particular every helper is
> restored before A starts.

The original block-triangular proof then applies verbatim at the boundary:
the raw A/scatter/B map is `(z,y) -> (Uz,y+Jx+Ks)` with z=(x,s), and C applies
`U^-1` to z. Composing after D gives
`(x,s,y) -> (x,s,y+Jx+(K+N)s)`. Here the unchanged raw word has J=I and the
new D has exactly the old N=K, so the final map is `(x,s,y+x)` over F2.
The two new helper gates are legal at frame zero, where helpers initially
stand. They restore before any climb, so no extra gate belongs in C and no
descent is hidden. This is a written finite-interface argument, not Lean.

The verifier first evaluates the new D with a separate set-valued symbolic
interpreter and requires its complete map to equal the pinned original D.
It then runs PR543's exact labels, closed frames and 660-column native replay
on the actual candidate. For the inherited interface it checks that exactly
the documented H2 and syntactic K checks fail. Replacing only D by its proven
equivalent original normal form restores all H1--H5 and conclusion checks.
The unmodified C++ record checkers additionally accept actual candidate
geometry and all 1,380 columns across nine stages, including arbitrary dirt.

## Search scope, controls and remaining work

OS randomness supplied assignment seed **1**, selecting the bit-supplier
track. Its parity selects the orientation `552 ^= 521`; the opposite
orientation was also checked and has the same costs and prefix maxima.
The search stops after all `binomial(420,2) = 87,990` unordered helper pairs.
Two methods agree for every pair: count pair occurrences in rows, and
intersect column-incidence bitsets. Their complete histogram has a unique
maximum q=110 at `{521,552}`. Consequently 108 is the largest saving within
this **single-pair recipe with two helper updates on this fixed D matrix**.
This does not establish optimality among general XOR circuits, multiple-pair
factorizations, changed frames, changed words or supplier assemblies.

Six D controls reject an omitted restoration, an omitted shared read, a wrong
restoration source, an F2-correct read at a nonzero frame, an F2-neutral pair
of target-to-helper reads, and an F2-neutral pair of source reads at frame
zero. A harmless adjacent pair of helper updates is a positive control. An
additional F2-neutral record preamble preserves every endpoint column but
exceeds the positive-prefix limit, and the actual C++ bill check rejects it.
Both baseline and candidate also reject all 18 omitted-bridge controls.

This package completes the finite native circuit and nine-stage cohort
checks. Integration would still need review of the generalized D interface
in the all-size/common-label realization and a fresh hosted-parent replay,
invoice and outer assembly. Equal local frame paths and prefix maxima alone
do not certify those obligations. The selected assembly is already complex
limited; this scalar-work saving does not alter its paid local moment or
establish a better kappa. Whole-call pooled-cell hosting, normalized residuals,
mutable-basis realization, precision, fixed-tape and analytic assumptions are
inherited. No practical runtime speedup or full multiplication theorem is
asserted.

## Relation to concurrent work and attribution

The local [claim](CLAIM.json) records three candidates and the overlap check.
No pinned sprint issue existed. PR670 (yongjae321) resynthesizes phase-B block
3; PR674 (x0hu) resynthesizes block 5. This contribution changes D and uses
temporary helper sharing followed by restoration, adding distinct coverage.
Their changes are not imported and composition with them is not tested.
PR661's exact frame bound fixes D and the scalar gate order and explicitly
excludes resynthesis. This task changes that excluded circuit structure.
PR612's original R420 Lean boundaries do not prove this changed D interface.
PR589's punctured-word transport search is separate.
The final refresh through PR685 also checked PR673's multiway cyclic-inverse
dirty echo and PR677's native ADDRESS/DATA interface: both change different
primitives. Neither is a dependency, and no novelty of the general reversible
prepare/share/restore trick is claimed. The new evidence here is its concrete,
fully costed R420 compensation instance and changed D interface.

Credit remains with **eumemic** for PR543's R420 construction, interleaved
interface, independent checker and PR493 carrier skeleton; **Dylan Crow** for
the bit word format and exporter; **DaysSky** for the bridged-stage checker
and hosting lineage; **Chafik Boukhalfa** for the inherited geometric checker
and invoice lineage; **Zhihao Chen** for the mutable-basis/interface lineage;
**DreamingOfClouds** for the retained-total and nine-stage bit work; and the
cumulative authors named in those packages and the repository contributor
record. Their original notices and bytes are unchanged.

Prepared by **Mikhail R. Gadelha (@mikhailramalho)** with substantial **OpenAI
Codex assistance**, including investigation, implementation, proof drafting
and verification. No independent human review is claimed. New files follow
the repository's **Apache-2.0** license.
33 changes: 33 additions & 0 deletions research/r420-frame-zero-pair/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60",
"PR543_head": "2065fe4f72a914d907f1046603f5a36f17018535",
"selected_at_base": {
"kappa": "51110230636731/31250000000000000",
"decimal": "0.001635527380375392",
"composition": "PR626 with PR543",
"binding": "complex",
"record": "certificates/selected-result.json",
"review": "docs/research/community-k492-review.md",
"actual_certificate": "research/community-k492-audit/pr626/replay/ASSEMBLY.json"
},
"sha256": {
"research/e8-bit-r420/data/bitE8mut-r420.json.gz": "9721a3819efd68307f66f00d84a952eb28eb7c3ad2ce79653ce295c98a764784",
"research/e8-bit-r420/code/xcheck.py": "5737d18a7826fd51e131035f2d7bebba2e2868af91dd7672a5f11208b036d424",
"research/e8-bit-r420/code/gen_l3.py": "d5c802447c99255db1bdfcae62b2116bfc9612c9dc9000d41aa4f5f2fec9f2f2",
"research/e8-bit-r420/README.md": "9807be57c6adf26b30e4f54e2f8160075bbc05091f1a6d157e43d2a4620c1c9f",
"research/e8-bit-carrier-skeleton/code/bit/export_records.py": "8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3",
"research/e8-bit-carrier-skeleton/code/bit/checkers/columns_k.cpp": "1c344d18fcd494eeca93e259f10cafae7705780e6592f6dcb35b34752dab9bc2",
"research/e8-bit-carrier-skeleton/code/bit/checkers/legality_h.cpp": "6c1ef2b24e57781d6951c172a1024fc4300e6fd392c9d6672079a7806ab663b3",
"research/e8-bit-carrier-skeleton/code/bit/checkers/json.hpp": "aaf127c04cb31c406e5b04a63f1ae89369fccde6d8fa7cdda1ed4f32dfc5de63",
"research/e8-bit-carrier-skeleton/code/bit/regression/stage_cohort.py": "6c288f6f234b528c1a7c0a4adfb724e91e0fe6b18c8dffad96af3f973de1829a"
},
"attribution": {
"PR543_PR493": "eumemic: R420 construction, generator, interleaved interface, exact word checker and mutable-source carrier skeleton",
"PR370": "Dylan Crow: bit word format and record exporter",
"PR266_PR346_PR352": "Inherited common-frame legality and formal-column checking lineage, as retained in PR493",
"PR363_PR381": "DaysSky: general bridged-stage replay in columns_k.cpp",
"PR425_PR472_PR535": "Zhihao Chen and cumulative contributors: scalar interface and common-label realization carried by the PR543 proof",
"PR510_PR589": "DreamingOfClouds: nine-stage bit pricing and later punctured-bit headroom; context only, not replayed here",
"contribution": "Mikhail R. Gadelha (@mikhailramalho), with substantial OpenAI Codex assistance; Apache-2.0"
}
}
56 changes: 56 additions & 0 deletions research/r420-frame-zero-pair/VALIDATION.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"status": "passed local finite verification",
"base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60",
"environment": {
"os": "Linux 6.17.0-41-generic x86_64 GNU/Linux",
"python": "3.13.7",
"cxx": "Ubuntu GCC 15.2.0-4ubuntu4",
"boost": "1.88"
},
"commands": [
{
"command": "python3 -B research/r420-frame-zero-pair/verify.py",
"result": "PASS_R420_FRAME_ZERO_PAIR D=19922->19814 native_adds=26916->26808 columns=660 kappa=unchanged"
},
{
"command": "python3 -O -B research/r420-frame-zero-pair/verify.py --output /tmp/r420-frame-zero-pair-optimized",
"result": "Same complete certificate; optimized execution preserves all checks"
},
{
"command": "python3 -B research/r420-frame-zero-pair/verify.py --output /tmp/r420-frame-zero-pair-optimized",
"result": "Expected FileExistsError before any output overwrite"
},
{
"command": "make selected-record-check",
"result": "PASS selected record, exact kappa, original source inventory and proof supplement: 51110230636731/31250000000000000"
},
{
"command": "python3 -I -B research/r420-frame-zero-pair/verify.py (from a fresh Git archive containing only this package and its nine pinned source files)",
"result": "Same PASS and complete certificate; no unlisted local dependency required"
},
{
"command": "git diff --cached --check",
"result": "Passed; only new files in research/r420-frame-zero-pair are included"
}
],
"coverage": [
"All 87990 unordered helper pairs by row-pair counts and independent column-incidence intersections",
"Exact set-valued compensation map on arbitrary input dirt and targets",
"Pinned E8 labels, all closed frames and 660-column native candidate replay",
"Documented legacy H2 and K rejection; exact D normalization restores the original interface",
"Independent Python forward/reverse raw-record interpretation and positive prefix bill for both pair orientations",
"Unmodified C++ chronological geometry checker and 1380-column nine-stage checker on baseline and candidate",
"Six D rejection controls, a positive D control, 18 omitted-bridge controls per word and a bill-inflation control with exact F2 endpoint preservation",
"Complete regenerated certificate comparison, with the large integer payload stored as an exact decimal string"
],
"not_run": [
"Full hosted-parent reconstruction and invoice",
"Outer assembly for the changed word",
"Repository-wide regenerating make verify",
"Lean formalization",
"Remote CI"
],
"remaining_obligations": "Review generalized D interface under all-size/common-label realization; rebuild hosted parent and invoice before supplier integration. All inherited physical, precision, tape and analytic obligations remain.",
"assistance": "Substantial OpenAI Codex assistance; no independent human review claimed",
"result_pr": "https://github.com/CrocSwap/integer-mult-bounds/pull/686"
}
Loading