Skip to content
Closed
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
30 changes: 30 additions & 0 deletions .github/workflows/gcert-program-233.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: gcert-program-233

on:
pull_request:
paths:
- 'research/gcert-program-233/**'
- '.github/workflows/gcert-program-233.yml'
push:
paths:
- 'research/gcert-program-233/**'
- '.github/workflows/gcert-program-233.yml'

jobs:
verify:
runs-on: ubuntu-latest
timeout-minutes: 40
strategy:
matrix:
python-version: ['3.11', '3.13']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install the regeneration dependencies of the pinned pipeline
run: python -m pip install numpy==2.3.5 scipy==1.17.0
- name: Regenerate both words, run flow and lift, emit the gcert/1 programs, run gx.check1, compare with the committed certificates
run: python3 -B research/gcert-program-233/verify.py
- name: Require an unchanged tree
run: git diff --exit-code
35 changes: 35 additions & 0 deletions research/gcert-program-233/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Prepared by Chafik Boukhalfa with substantial Anthropic Claude and OpenAI
Codex assistance. Apache-2.0. Inherited files retain their original notices
and assistance disclosures. This package claims no exclusive priority over
concurrent work and reports no new kappa.

What this package contributes: gcert_emit.py, the lowering of PR #184's flow
witness and exact lift to Jacob Sussman's certificate format gcert/1, and the
two resulting programs (PR #194's and PR #233's complex words) with their
checks. Everything else is retained and credited:

- Jacob Sussman (Anthropic Claude assistance): the certificate format gcert/1,
the reference checker gx.py (vendored unchanged in gx/, Apache-2.0,
Copyright 2026 Jacob Sussman, jacobalansussman/wht-power-saving-lean at
f010392c), the Lean-checked bridged five-stage layout and its checks, the
unit convention of gxconv.py reused for scalings, and the published
certificate of #193 whose histogram is the control
(references/sussman/pr193-blocks.json).
- icekylinx (OpenAI GPT-6 Astra and Codex assistance): PR144 paired cubes and
signed decoder (the K blocks and the star scatter replayed here), PR184
source-assisted construction: frame flow, exact lifts, contract; the flow
DAG and the local completions this package lowers.
- ikeboy: PR191/193/194, the rebuild on the PR168 v4 modules
(source_aligned_local_v4.py, contract_v4.py whose read responses this
package reproduces), and the pairs of #193 (the control's layer).
- eumemic (Anthropic Claude and OpenAI Codex assistance): PR168 modules,
schedules, physical frames (the frames of both programs); PR117/155/157/161.
- hcg890 (PR234), SovereignSteak (PR250: the five-stage ledger statement used
for the price), rohanarun (PR209/237), and the exact-DFT arena of eumemic
(scripts/moment.py adapts eumemic/exact-dft-bounds, Apache-2.0).
- PR202 baseline lineage as credited in references/pr233-layer/NOTICE:
jamesyc / James Chang, DaysSky, GamingPuzzled, gupt1156, Abhinav
Ramachandran/geckods, jacklightChen / Zhihao Chen, Rohan Arun, an664,
Swapnil Jain, hpst3r, Aurel Prosz, dleen, Douglas Colkitt.
- Chafik Boukhalfa (Anthropic Claude and OpenAI Codex assistance): PR200
maximum-weight reuse pairing, PR233 layer, PR225 exact-DFT transfer.
75 changes: 75 additions & 0 deletions research/gcert-program-233/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# The source-assisted complex words as explicit numbered programs

**Claim.** The complex words of PR #194 (PR #168's frames, PR #193's reuse pairs) and PR #233 (PR #168's frames,
PR #200's maximum-weight reuse pairs) are each one explicit program in Jacob Sussman's certificate format gcert/1:
12,052 numbered registers (1,320 sources x, 1,320 targets y, 9,412 slots), a table of 18,248 frames, and one gate
list per phase (before and after the star scatter), accepted by his reference checker `gx.check1`
(jacobalansussman/wht-power-saving-lean, `tools/gx/gx.py`, commit `f010392c`; vendored unchanged in `gx/`).
In the bridged five-stage word of that repository (m = 5h = 110, W = 4v + R = 14,692) the PR #233 program is
certified at saving a = 7547/10⁷ with exact rational bounds (7548/10⁷ rejected); Sussman's own mirror
`gxdry.py` prices it at 7547361/10¹⁰ against 7474547/10¹⁰ for the circuit of #193. No new κ: the bit supplier
binds in every current assembly.

## 1. What the checker checks (Sussman's conditions, as implemented in `gx/gx.py`)

- **E0, E1 (labels).** Every register has a start frame (x: its port line; y and slots: the zero frame) and a
final frame (x and slots: the full frame; y: the perpendicular of its port, dimension h − 1). Every gate names
one frame; every register named by a gate moves to that frame, and every move is a strict nesting of reduced
echelon subspaces of F₂^h. The rank of a move is the dimension difference; the block histogram counts moves
by class (x, y, s) and rank; the c class counts the retained totals at their frames.
- **E2 (scatter cut).** Between the two phases, h = 22 retained totals sit in slots at their recorded frames and
every target is still at frame 0; the star rule scatters total k into target t with coefficient 1/3 when
coordinate k lies in port t and −1/6 otherwise.
- **E3, E4 (shape).** Gates are fan-out ('out': one source, several targets) or fan-in ('in'); phase 1 has only
x→slot and slot→slot gates; targets are written only in phase 2.
- **E5 (exact scalar identity).** Replaying every gate on the x-content of every register with exact rationals,
each target ends with exactly its source and each source is restored (the K blocks are undone).
- **E6 (price).** N = Σ rank·count over the histogram equals R·h + 2v(h − 1) + cst, cst = Σ dim of the retained
totals' frames = 22·20 = 440.

## 2. How the program is built (`gcert_emit.py`)

The input is the output of PR #184's tool chain on the aligned word: `complex_frame_flow.py --witness` (the flow
DAG: one node per (phase, frame), the value channels on every edge, the births, retirements and reads) and
`exact_complex_flow_lift.py` (at every node an invertible completion Q as a list of elementary row operations,
and the coordinates of every read in the node's inputs). The emitter numbers one slot per physical flow
coordinate (v source copies at the port lines, then every birth; a kernel reuse continues a slot) and, node by
node in the lift's topological order, at the node's frame:

1. copies the original sources into their first slots (phase 1, port line);
2. emits every read: side and deferred reads as fan-outs from the slots that carry the read value into the
targets of the root, with the coefficients ±1/2 of PR #194's contract (`contract_v4.py`: responses ±3 and
−3c on the ledger scaled by 6); a centre read is a retained total, formed in place in one of its retiring
input slots (the nine inputs of a centre node retire untouched);
3. emits the completion as fan-outs with one target: the lift stores the row operations that take Q to the
identity, so they are replayed in reverse with inverted coefficients; a swap only relabels positions; a
scaling changes the unit of a slot (wanted = λ·stored, as Sussman's `gxconv.py`) and every later coefficient
is rescaled;
4. names, as extra registers of the node's last fan-out, every coordinate that passes through the node
untouched: the flow charges each edge, and the block histogram of the program must be the flow's ledger.

After the last phase-2 node the program applies, for each parity class of each cube, the K block 1 − J/2 of
PR #144's decoder on the four source registers at their parity 3-space (three fan-in/fan-out gates, the class
head carrying the sign), reads each mixed source into its antipodal target (Hamming distance 6 inside the
cube) at that target's cap frame, and undoes the K blocks at the full frame. This is PR #194's contract read as a
program: the scatter, the side and deferred responses and the K responses are the terms whose sum the contract
checks to be 6·I.

## 3. What is reproduced

- The control (PR #194's word) has the block histogram of Sussman's published certificate of #193 in every class
and rank (70,169 blocks, N = 262,944), and `gx.check1` accepts it; `gxdry.py` prices it at his 7474547/10¹⁰.
- The PR #233 program (69,683 blocks, N = 262,944) is accepted; its per-invocation ledger
3(x + y + s + c) + 2v·e₂ is PR #233's certified child histogram (`certificate.json` of PR #233, vendored), so the
program is the word PR #233 certifies through PR #184's lift and contract, now as one explicit transcript.
- Five-stage price (as PR #225, Proposition E; ledger H₅ = 5·H_inv + 2v(e₄₂ + e₂₁ + e₄₆ + e₄) stated by PR #250
for PR #234/#209's layout): the moment Σ n_r (r/m)^{1−a} at m = 110, W = 14,692 is below W at a = 7547/10⁷ and
not at 7548/10⁷, with the exact bounds of `scripts/moment.py`.

## 4. What is not claimed

The program is checked here by Sussman's Python reference checker and Python mirror, not by the Lean kernel
(his repository checks the #193 program in Lean; the same generators apply to this file, and a kernel build of
the generated modules is reported in the pull request, not in this package). The emitter has no proof of its own:
it is validated by the two checks above (the control reproduces an independently rebuilt certificate, and the
result reproduces PR #233's certified ledger). No κ changes.
46 changes: 46 additions & 0 deletions research/gcert-program-233/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# gcert-program-233

**The source-assisted complex word of PR #233 as one explicit numbered program (no new κ).** PR #194's contract
notes that "a literal globally renumbered operation program is not exported" for its flow word. This package
exports it, for PR #194's word and for PR #233's, in Jacob Sussman's certificate format gcert/1
(jacobalansussman/wht-power-saving-lean): 12,052 numbered registers, 18,248 frames, every addition explicit, the
star scatter as a rule. His reference checker `gx.check1` (vendored unchanged) accepts both files: nested frames
of every register, block histogram, N = 262,944 unit moves, and the exact scalar identity (every target receives
exactly its source, every source is restored).

| program | blocks per invocation | N | checker | five-stage saving |
|---|---|---|---|---|
| PR #194 word (control; the circuit of #193) | 70,169 = Sussman's published histogram, class by class | 262,944 | accepted | 7474547/10¹⁰ (his Lean figure; `gxdry.py` reproduces it on this file) |
| **PR #233 word** | 69,683 | 262,944 | accepted | **7547/10⁷ exact bounds here; 7547361/10¹⁰ by Sussman's mirror** |

The PR #233 program's ledger 3(x + y + s + c) + 2v·e₂ is PR #233's certified child histogram, so this is the word
PR #233 certifies (complex saving 3549537/5·10⁹), now as a transcript a third-party checker reads. In the
Lean-checked five-stage layout (m = 110, W = 14,692) it is 0.97% above the circuit of #193. κ does not change: the
bit supplier binds in every current assembly. [PROOF.md](PROOF.md) states the claim, the checks and the emitter.

## Verify

python -m pip install numpy==2.3.5 scipy==1.17.0 # only for the pinned regeneration of PR #202's word
python3 -B research/gcert-program-233/verify.py # about 4 minutes; -O is refused

The script checks every pin of `SOURCE.json`, rebuilds the 308 pinned files of PR #202 from the vendored PR #233
package and regenerates the source-aligned word (PR #194's pipeline), then for each of the two physical layers runs
PR #184's flow (`--witness`) and exact lift, emits the gcert/1 program with `gcert_emit.py`, runs `gx.check1`,
compares the block histogram (control: Sussman's `references/sussman/pr193-blocks.json`; result: PR #233's child
histogram), certifies the five-stage moment at 7547/10⁷ (7548/10⁷ rejected) and compares the regenerated
certificates byte for byte (uncompressed JSON) with `certificates/` and the run with `certificate/expected.json`.
`--write` regenerates the committed files; `--temp-root` chooses scratch storage.

To check a certificate with Sussman's tools directly:

python3 -B tools/gx/refcheck.py <this package>/certificates/gcert1-p11-pr233-flow.json.gz # in his repository
python3 -B tools/gx/gxdry.py <this package>/certificates/gcert1-p11-pr233-flow.json.gz # mirror and price

## Files

`verify.py`, `gcert_emit.py` (the lowering), `gx/gx.py` (Jacob Sussman's reference checker, unchanged),
`scripts/moment.py` (exact moment bounds, from PR #225), `certificates/gcert1-p11-pr194-flow.json.gz` and
`certificates/gcert1-p11-pr233-flow.json.gz` (the programs, 0.5 MB each), `certificate/expected.json`,
`references/pr233-layer/` (PR #233's package at `109a857`: baseline tarball, witness, verify helpers, certificate),
`references/sussman/pr193-blocks.json` (the histogram and counts of his certificate of #193), `SOURCE.json`,
`PROOF.md`, `NOTICE`. `.github/workflows/gcert-program-233.yml` runs the verifier on Python 3.11 and 3.13.
47 changes: 47 additions & 0 deletions research/gcert-program-233/SOURCE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"description": "Pinned inputs of research/gcert-program-233 (sha256). Vendored byte for byte; nothing is fetched at run time.",
"files": {
"gx/gx.py": "6f3dc8bb639933227a8dae181ec4a542e85c7276be9c9e330f49518e7b630b95",
"references/pr233-layer/NOTICE": "5826b9f155b70d496d729cbaddeadb881abfb68da77f82dfc1746ddfc753313b",
"references/pr233-layer/SOURCE.json": "9ad0549ba2403e8d84d7c0c8e71e5ca952a0604ad626f403426164bd4bc2982c",
"references/pr233-layer/baseline-pr202.tar.gz": "5d08386f71c421d2b83b21020e3b74198e9d0c75884d7d81987307740d98883f",
"references/pr233-layer/certificate.json": "691cb0aaeb0d6b993e1e1e5116ae7a5c57af058a8c413249016347d1b40d3b90",
"references/pr233-layer/verify.py": "cd61a8c61462b4eee95c0858335a9a11bdf1ff8e8e63ebb1e488da29f061ca71",
"references/pr233-layer/witness/kernel-pairs.json": "e33b753fc4519170373207b0527b9cb53e0b552e2a27f48f72381a881c7a227f",
"references/pr233-layer/witness/physical-frames.json": "1a6c215cdc58216f7ec96fb898a471e25d094fd86de085f6c06e86fd8997bfad",
"references/pr233-layer/witness/physical-pairs.json": "e6409fffbf5f3b1ac6434acf2e426503de3a8a18537b8fee761fc4fc931fb896",
"references/sussman/pr193-blocks.json": "4049d066f71119fa72bbc37f7db753ce1e79ae5a69aef9cd2651d618bea5c855",
"scripts/moment.py": "0c7c68122cea18503e973ccf0d244adf8fa0edab95f104393528c6c57f24863a"
},
"prerequisites": {
"pr202": {
"commit": "8d8d67bcf69c5ea67d3a29dbc64ba588156d6e8d",
"note": "the 308 files rebuilt by references/pr233-layer/verify.py: PR #184 flow/lift (icekylinx), PR #194 v4 scripts (ikeboy), PR #168 modules (eumemic), PR #200 checker (chafreaky)",
"repository": "CrocSwap/integer-mult-bounds"
},
"pr225": {
"note": "scripts/moment.py: exact rational moment bounds (chafreaky; adapted from eumemic/exact-dft-bounds scripts/verify_moment.py, Apache-2.0)",
"path": "research/exact-dft-transfer/scripts/moment.py",
"pr": 225,
"repository": "CrocSwap/integer-mult-bounds"
},
"pr233": {
"author": "chafreaky (Anthropic Claude and OpenAI Codex assistance); PR #202 baseline by ikeboy et al., see NOTICE",
"commit": "109a857",
"complex_saving": "3549537/5000000000",
"path": "research/source-assisted-v4-layer",
"pr": 233,
"repository": "CrocSwap/integer-mult-bounds",
"vendored": "references/pr233-layer (baseline-pr202.tar.gz, SOURCE.json, verify.py, certificate.json, NOTICE, witness/)"
},
"sussman": {
"commit": "f010392c",
"files": {
"tools/certificate/gcert1-p11-pr193.json.gz": "15251deb0c11e0504d7b297c9786818888a93f08b92b03c6c122784b70488633 (its block histogram and counts in references/sussman/pr193-blocks.json)",
"tools/gx/gx.py": "6f3dc8bb639933227a8dae181ec4a542e85c7276be9c9e330f49518e7b630b95 (vendored unchanged as gx/gx.py)"
},
"licence": "Apache-2.0, Copyright 2026 Jacob Sussman",
"repository": "jacobalansussman/wht-power-saving-lean"
}
}
}
Loading
Loading