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
885 changes: 885 additions & 0 deletions research/complex-ck-helper-basis/CERTIFICATE.json

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions research/complex-ck-helper-basis/CLAIM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Sprint claim

Seed: 24 (OS randomness, secrets.randbelow(100)). Track: complex supplier.
Base: 66849e1475c930fd7732b1a0067ffee7e1e95f60.
Claim: investigate disjoint signed-unit helper-basis shears in the selected CK
frame-zero compensation matrix. For each ordered helper pair and sign ±1,
price preparation, changed rational additions, and restoration under the
unchanged binary-Horner primitive invoice; retain a deterministic disjoint set.
Verify the complete arbitrary-input block map in both orientations, source pins,
frame boundaries, prefix bound and mutation controls. No new kappa claim.
Expected deliverable: finite circuit research note, exact certificate, verifier,
and a focused patch.

Candidates considered:
1. CK frame-zero helper-basis factorization (chosen; seed 24 modulo 3 = 0).
2. ATM3 scalar coefficient microcircuits (not selected; inactive supplier).
3. CK multi-scale relocation (not selected; overlaps pending #750).

Overlap: read all 585 open PRs through #764 and the central review ledger.
#749 factors JP8 target rows through a restored target basis; this instead
factors CK helper columns, with explicit dirty-helper restoration. #719 concerns
fixed-middle cleanup pairs; #750 relocates a cleanup scale. #696/#734 change
coefficient lowering. No pending implementation is imported or additive savings
claimed. Only open non-PR issue is #650; no sprint coordination issue found, so the
claim was recorded here.

Result: finite 124-pair CK helper-basis construction saves 35,872 real primitives
per orientation; no new kappa. All 716 columns and native frames/wrappers pass.
Final overlap refresh through #773 credits #769's distinct CK coefficient
sharing. Main remains at the base.
183 changes: 183 additions & 0 deletions research/complex-ck-helper-basis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
# Restored helper pairs in CK frame-zero compensation

**Status: finite complex-supplier circuit construction; no new κ.**

The selected #626/#622 CK word's compensation can use 124 disjoint temporary
helper shears. Its complete scalar program saves **35,872 real-component
primitives per orientation**, including preparation, rational coefficient work,
source reads and restoration. All 716 arbitrary live input columns are checked
in both orientations, with separate primitive replay of the replacement and
arbitrary incoming coefficient-work input. Every helper is restored before
entry adapters or any paid recursive child.

| Quantity | Selected CK | Replacement |
|---|---:|---:|
| Compensation additions (including basis changes) | 8,704 | 5,804 |
| Compensation real primitives | 99,248 | 63,376 |
| Full scalar macros, either orientation | 21,936 | 19,036 |
| Forward real primitives | 224,938 | 189,066 |
| Backward real primitives | 224,986 | 189,114 |
| Forward conservative prefix bits | 40 | 41 |
| Backward conservative prefix bits | 62 | 63 |

This is a different finite circuit, not a faster implementation of its checker.
The conservative positive prefix envelopes grow, but remain below the inherited
192-bit allowance. No practical runtime or improved outer exponent is asserted.

## Reproduce

From the repository root, with Python 3.11+ and no third-party packages:

```sh
python3 -I -B research/complex-ck-helper-basis/verify.py --out /tmp/ck-helper-replay
```

The output directory must be fresh. Expected final line:

```text
PASS_CK_RESTORED_HELPER_BASIS pairs=124 real_saved=35872 columns=716+1 orientations=2 controls=6+25 kappa=unchanged
```

The command validates pinned inputs, exhausts the search, reconstructs both
programs with the retained emitter, runs the retained frame/wrapper auditor and
its 25 negative controls, and checks all proof-relevant fields against
[CERTIFICATE.json](CERTIFICATE.json). Generated words, programs, audit receipts,
logs and `EVIDENCE.json` go only in the chosen directory. Existing output is
never overwritten. `--write-certificate` is an explicit maintainer regeneration
option; normal verification never changes the committed certificate.

The independent search census and mathematical failure-mode tests are:

```sh
TEST_SKIP_LOG=/tmp/test-skips.log python3 -B research/complex-ck-helper-basis/test_circuit.py
```

Eleven tests; zero expected skips. The runner writes the actual skipped tests
and reasons to `TEST_SKIP_LOG`. The certificate replay also works under `-I -O`
and `PYTHONOPTIMIZE=2`: new checks use explicit exceptions, and retained native
subprocesses run with assertions enabled (`-E`, without optimization flags).

## Exact local identity and cost

Write the frame-zero compensation as `y <- y + C h`. For a chosen ordered
helper pair `(a,b)` and `s` in `{−1,+1}`, replace its contribution by:

1. Prepare `h_a <- h_a + s h_b`.
2. For every target, use coefficients `C_a` and `C_b − s C_a` on the new
`h_a` and unchanged `h_b`, omitting zero coefficients.
3. Restore `h_a <- h_a − s h_b`.

For arbitrary dirty helpers and arbitrary targets,
`C_a(h_a+s h_b) + (C_b−s C_a)h_b = C_a h_a + C_b h_b`.
The preparation/restoration product is the identity on helpers. Pairs are
disjoint, so the column substitutions compose without cross terms. The six
unpaired eligible helpers keep their original coefficients. Unused entering
and cold-ended helpers are untouched.

Every used helper has `start=0` and `final=FULL`. In particular it is not a
wrapped helper, so this temporary change occurs entirely before all entry
adapters and wrappers. All other canonical-word fields and every emitted
non-scalar event are unchanged. The native auditor rechecks the common frames,
wrapper lifetimes, paid children, private centres and complete scalar endpoints.

For the backward orientation, apply inverse transpose to each gate, in the
same chronological order, exactly as the native emitter does. This is valid
because inverse transpose is a group homomorphism. Forward helper preparation
becomes its dual helper shear, and target updates become source/target-swapped
updates with negated coefficients. Both full emitted programs pass exact replay;
independent dense three-coordinate maps check every pair/target in both
orientations. No commutation through the unchanged intervening word is needed.

For nonzero reduced dyadic `q=n/d`, the retained binary-Horner real price is

```text
P(q) = 2 [3 + (bit_length(|n|)−1) + popcount(|n|) + (bit_length(d)−1)].
P(0) = 0.
```

The factor two is for the real and imaginary components. The three constant
operations are the initial work clear, signed target accumulation and final
work clear. The remaining terms charge all source additions, doubles and
halves. Each unit preparation or restoration costs eight real primitives;
every chosen pair pays sixteen. The primitive interpreter independently
executes those operations and clears arbitrary incoming private work.

There are 5,556 nonzero middle additions and 248 preparation/restoration gates.
The ordinary Horner lowering is unchanged. No new scratch register, recursive
child, helper allocation, frame transition or uncharged copy is introduced.
The complete native prefix bounds, including coefficient work, are
`1258556220792` forward and `153667580418596477857/32` backward. The native
positive-bound method does not cancel restoration terms, so it is conservative.

## Completed search and rejection evidence

OS seed **24** assigns the complex-supplier track. Three candidates and the
local-only claim are in [CLAIM.md](CLAIM.md). The seed also sets the cyclic
helper-index tie break. This is a new helper-column search class, distinct
from prior fixed-middle cleanup searches and JP8 target-row factorization.

The domain is all **254 × 253 × 2 = 128,524** legal ordered helper pairs and
signs. Exact integer quarter-unit coefficients suffice. **9,756** candidates
have positive complete savings. Sort by descending saving, then helper indices
cyclically shifted by 24, then sign; accept the first pair whose helpers are
both unused. This one deterministic greedy pass selects 124 pairs. The
certificate lists every selected pair and binds the entire sorted profitable
list by SHA-256. No timeout, randomized sampling, additional rounds or matching
optimality claim is involved. Different matchings and general bases remain open.

The test census reconstructs sparse coefficient columns and prices all pairs
using joint coefficient histograms and repeated integer division, independently
of the production search and its `bit_length`/`bit_count` cost formula.
It reproduces the complete positive-candidate digest and chosen pairs.

Six new semantic controls reject omitted preparation/restoration, either wrong
basis sign, a wrong middle coefficient and an aliased preparation. Tests also
reject duplicate pairs, nonzero-frame and cold-wrapped helpers, favorable cost
corruption, a wrong dual sign and corrupt source bytes. Gzip recompression is
accepted by binding decompressed payloads. Twenty-five retained native controls
remain active, including cold-wrapper and frame errors. Finite matrix replay
is not a formal proof of the full multiplication theorem.

## Source pins, attribution and limits

Base: `66849e1475c930fd7732b1a0067ffee7e1e95f60`.
Selected #626: `660de893d27bb7abd1d5b01b1640207528a5c851`.
Construction #622: `f69477f4f6d3c7eb1f740b166881bffed4ffa9f6`.
[SOURCE-PINS.json](SOURCE-PINS.json) pins every consumed source, including the
native emitter and auditor. Native word/program payloads are additionally
checked against the selected #626 SPEC. The selected κ remains
`51110230636731/31250000000000000 = 0.001635527380375392`.

Credit to Jeremy Kothe and the #622 Claude Code contributors, Chafik Boukhalfa's
#626 packaging, DreamingOfClouds' native cold-helper construction and checks,
icekylinx's direct-delivery/emitter and Horner invoice lineage, and all retained
predecessors. The inherited bit supplier is eumemic's #543. Original source
notices and licenses remain in their packages.

The conceptual relation to pending **#749** (Sricharan Vagvala / @theon199,
Codex-assisted) is explicit: it factors JP8 target rows through target bases;
this contribution factors CK helper columns and checks temporary helper dirt
and restoration. **#719** proves a fixed-middle CK cleanup obstruction;
**#750** moves a cleanup scale; **#696/#734** change individual coefficient
lowering. None of their implementations is imported, and no additive saving
relative to any pending PR is claimed. Initial overlap inspection covered all
585 open PRs through #764; the only open non-PR issue was #650, not a sprint
coordination issue. The final refresh reaches #773; new **#769**
(`e891b2b19e3185ec91bcf001e255af87f42389ce`) shares varying-magnitude CK
coefficient preparation while retaining the macro word. It is distinct from
this helper-basis replacement; no combined saving is asserted. Main remains
the exact base commit.

This isolated package changes neither the selected certificate nor production
supplier sources. Production use would require an admitted typed compensation
rewrite, refreshed bindings and global owner/invoice/assembly receipts. The
paid profile and rank deficit are unchanged, so this scalar saving alone does
not supply a better recurrence exponent. The all-size compiler, common-label
and mutable-basis realization, whole-call hosting, normalized residuals,
precision/tape/recovery, bit and analytic assumptions remain inherited. Global
assembly, full cold supplier regeneration, repository-wide `make verify`,
remote CI and Lean are not claimed by this local result.

Contributed by David Awad. Prepared with substantial AI assistance (OpenAI Codex)
throughout. No independent human review is claimed. New work is Apache-2.0
under the repository license.
31 changes: 31 additions & 0 deletions research/complex-ck-helper-basis/SOURCE-PINS.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60",
"selected_source_head": "660de893d27bb7abd1d5b01b1640207528a5c851",
"construction_source_head": "f69477f4f6d3c7eb1f740b166881bffed4ffa9f6",
"files": {
"word": {
"path": "research/community-k492-audit/pr626/replay/mixed-global/base/providers/ck/CANONICAL-WORD.json.gz",
"payload_sha256": "9bbc75dede090cfd7a0a0252424ea9d9f6211e2350d2a801d4e4f2f0784167c7"
},
"programs": {
"path": "research/community-k492-audit/pr626/replay/mixed-global/base/providers/ck/LOCAL-PROGRAMS.json.gz",
"payload_sha256": "854f17274092263dc25e60367f4cd0d29f60a8446becd17cc1883ebed7a97900"
},
"checks": {
"path": "research/community-k492-audit/pr626/replay/mixed-global/base/providers/ck/LOCAL-CHECKS.json",
"payload_sha256": "059c4e59142bdf5c19dc7c0afebcddfec28e6e60cbc7299b8bdcc624afbc0cbe"
},
"spec": {
"path": "research/complex-k492-owner-repair/data/SPEC.json",
"payload_sha256": "2a2577ac526535826fed9d5f7f83f6e2e0ec058a146c64f7286720b995fa2323"
},
"emitter": {
"path": "research/complex-k492-owner-repair/code/hpe_emit_local.py",
"payload_sha256": "7e4a6fbc38c8228157b6311457d1496bf460291393043932d2c365f004f77805"
},
"auditor": {
"path": "research/complex-k492-owner-repair/code/hpe_audit_local.py",
"payload_sha256": "6bd9a1e279c9c9e4f3767d9f82e537b559292906feb2ddab02f380fb6523a810"
}
}
}
38 changes: 38 additions & 0 deletions research/complex-ck-helper-basis/VALIDATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Local validation

Linux x86_64, CPython 3.13.5; base
`66849e1475c930fd7732b1a0067ffee7e1e95f60`.

- Full certificate generation: PASS; both complete emitted scalar programs,
all 716 arbitrary live columns, frame incidence and wrapper ordering.
- Independent primitive block replay: PASS in both orientations, all 716 live
columns plus one arbitrary incoming coefficient-work column.
- New semantic mutations: 6/6 rejected. Retained native mutations: 25/25
rejected. These are rejection controls, not additional unittest test cases.
- `PYTHONOPTIMIZE=2 python3 -I -O -B .../verify.py --out <fresh-dir>`:
PASS, exact committed certificate match. Retained subprocess assertions stay
enabled. No optimized false PASS is accepted.
- Focused mathematical and packaging unittest suite under isolated optimized
Python: **11 passed, 0 failed, 0 skipped**. `TEST_SKIP_LOG` is empty (0 lines,
no skip reasons). Includes all 128,524 pair/sign prices by a separate census,
27,776 pair/target/orientation dense maps, source corruption rejection,
gzip-container portability and dirty private work clearing.
- `make selected-record-check`: PASS; selected result unchanged.
- Staged whitespace, Python syntax and package-relative documentation links:
PASS before local commit.

The initial discovery run completed mathematical checks but encountered a
report-packaging KeyError (`negative_controls` versus the retained receipt's
`negative_controls_rejected`). This was corrected, then complete certificate
generation and the independent optimized replay passed. No failed or skipped
check is counted as a pass.

No repository-wide `make verify`, full selected cold regeneration, global
owner/invoice/assembly regeneration, remote CI or Lean was run. Only the new
research package is changed.

Initial read-only overlap review covered 585 open PRs through #764, the review
ledger and open issues. Final refresh reaches #773 and credits #769's distinct
CK coefficient reuse. The relevant #749/#750/#719/#696/#734 heads remain pinned
in the overlap snapshots; upstream main remains at the exact base.
No independent human review is claimed.
Loading